From 8024cb3c5a4a8bc9f3e4d1b8308eeb25913bf6f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Bylica?= Date: Mon, 3 Apr 2023 17:06:37 +0200 Subject: [PATCH 1/4] ci: Remove old mips64 config --- circle.yml | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/circle.yml b/circle.yml index fb2b279d..1c112a3b 100644 --- a/circle.yml +++ b/circle.yml @@ -15,14 +15,6 @@ commands: $CXX --version cmake --version - install-mips64: - steps: - - run: - name: "Install mips64 toolchain" - command: | - sudo apt -q update - sudo apt -qy install g++-mips64-linux-gnuabi64 qemu-user-static - install-powerpc64: steps: - run: @@ -179,19 +171,6 @@ jobs: - build - test - mips64: - docker: - - image: ethereum/cpp-build-env:19-gcc-12 - environment: - - TESTS_EXCLUDE: _oom|_multithreaded - - CMAKE_OPTIONS: -DTOOLCHAIN=mips64 -DCMAKE_EXE_LINKER_FLAGS=-static - steps: - - checkout - - install-mips64 - - configure - - build-tests - - test - powerpc64: docker: - image: ethereum/cpp-build-env:19-gcc-12 @@ -338,7 +317,6 @@ workflows: - linux-gcc-coverage - linux-clang-sanitizers - linux-32bit-asan - # - mips64 toolchain is broken on recent Debian - powerpc64 - macos-xcode-tsan - macos-xcode-old From f1eea1bd3c0249f46998d63bcb35356352c5ba15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Bylica?= Date: Mon, 3 Apr 2023 17:06:58 +0200 Subject: [PATCH 2/4] cmake: Disable Hunter by default --- CMakeLists.txt | 20 +++++++------- circle.yml | 4 +-- .../HunterCacheServers-passwords.cmake | 18 ------------- cmake/cable/defaults/HunterCacheServers.cmake | 27 ------------------- 4 files changed, 11 insertions(+), 58 deletions(-) delete mode 100644 cmake/cable/defaults/HunterCacheServers-passwords.cmake delete mode 100644 cmake/cable/defaults/HunterCacheServers.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index 0c393105..b89a73d8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,7 +2,7 @@ # Copyright 2018 Pawel Bylica. # Licensed under the Apache License, Version 2.0. -cmake_minimum_required(VERSION 3.16.2) +cmake_minimum_required(VERSION 3.16.2...3.25) include(cmake/cable/bootstrap.cmake) @@ -11,12 +11,18 @@ include(CableCompilerSettings) include(CableToolchains) include(CMakeDependentOption) include(CMakePackageConfigHelpers) -include(HunterGate) cable_configure_toolchain(DEFAULT cxx14) cable_set_build_type(DEFAULT Release CONFIGURATION_TYPES Release RelWithDebInfo Debug) -include(cmake/Hunter/init.cmake) +option(ETHASH_INSTALL_CMAKE_CONFIG "Install CMake configuration scripts for find_package(CONFIG)" ON) +option(ETHASH_BUILD_ETHASH "Build ethash::ethash library (if NO only ethash::keccak is built)" YES) +cmake_dependent_option(ETHASH_BUILD_GLOBAL_CONTEXT "Build ethash::global-context library" YES "ETHASH_BUILD_ETHASH" NO) +option(ETHASH_TESTING "Build unit tests" NO) + +if(ETHASH_TESTING) + include(cmake/Hunter/init.cmake) +endif() project(ethash) set(PROJECT_VERSION 1.0.0) @@ -62,16 +68,8 @@ elseif(CMAKE_CXX_COMPILER_ID MATCHES GNU) set(CMAKE_CXX_FLAGS_COVERAGE "${CMAKE_CXX_FLAGS_DEBUG} --coverage") endif() -option(ETHASH_INSTALL_CMAKE_CONFIG "Install CMake configuration scripts for find_package(CONFIG)" ON) - set(include_dir ${PROJECT_SOURCE_DIR}/include) -option(ETHASH_BUILD_ETHASH "Build ethash::ethash library (if NO only ethash::keccak is built)" YES) - -cmake_dependent_option(ETHASH_BUILD_GLOBAL_CONTEXT "Build ethash::global-context library" YES "ETHASH_BUILD_ETHASH" NO) - -option(ETHASH_TESTING "Build unit tests" NO) - add_subdirectory(lib) if(ETHASH_TESTING) diff --git a/circle.yml b/circle.yml index 1c112a3b..5c01bbc4 100644 --- a/circle.yml +++ b/circle.yml @@ -195,7 +195,7 @@ jobs: docker: - image: ethereum/cpp-build-env:16-clang-11 environment: - - CMAKE_OPTIONS: -DETHASH_TESTING=OFF -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DHUNTER_ENABLED=OFF + - CMAKE_OPTIONS: -DETHASH_TESTING=OFF -DCMAKE_POSITION_INDEPENDENT_CODE=ON steps: - checkout - configure @@ -296,7 +296,7 @@ jobs: docker: - image: ethereum/cpp-build-env:17-gcc-10 environment: - CMAKE_OPTIONS: -DHUNTER_RUN_UPLOAD=FALSE -DTOOLCHAIN=wasm32-wasi -DETHASH_TESTING=NO -DETHASH_BUILD_GLOBAL_CONTEXT=NO + CMAKE_OPTIONS: -DTOOLCHAIN=wasm32-wasi -DETHASH_TESTING=NO -DETHASH_BUILD_GLOBAL_CONTEXT=NO steps: - run: name: "Install WASI SDK" diff --git a/cmake/cable/defaults/HunterCacheServers-passwords.cmake b/cmake/cable/defaults/HunterCacheServers-passwords.cmake deleted file mode 100644 index 30196694..00000000 --- a/cmake/cable/defaults/HunterCacheServers-passwords.cmake +++ /dev/null @@ -1,18 +0,0 @@ -# Cable: CMake Bootstrap Library. -# Copyright 2018 Pawel Bylica. -# Licensed under the Apache License, Version 2.0. See the LICENSE file. - -# Hunter passwords file used by HunterCacheServers.cmake. -# Do not include directly. - -hunter_upload_password( - # REPO_OWNER + REPO = https://github.com/ethereum/hunter-cache - REPO_OWNER ethereum - REPO hunter-cache - - # USERNAME = https://github.com/hunter-cache-bot - USERNAME hunter-cache-bot - - # PASSWORD = GitHub token saved as a secure environment variable - PASSWORD "$ENV{HUNTER_CACHE_TOKEN}" -) diff --git a/cmake/cable/defaults/HunterCacheServers.cmake b/cmake/cable/defaults/HunterCacheServers.cmake deleted file mode 100644 index b6f8449d..00000000 --- a/cmake/cable/defaults/HunterCacheServers.cmake +++ /dev/null @@ -1,27 +0,0 @@ -# Cable: CMake Bootstrap Library. -# Copyright 2018 Pawel Bylica. -# Licensed under the Apache License, Version 2.0. See the LICENSE file. - -# This module, when included, sets default values for params related to -# Hunter cache servers, including upload options. - -# Default Hunter cache servers. -set(HUNTER_CACHE_SERVERS - "https://github.com/ethereum/hunter-cache;https://github.com/ingenue/hunter-cache" - CACHE STRING "Hunter cache servers") - -# Default path to Hunter passwords file containing information how to access -# Ethereum's cache server. -set(HUNTER_PASSWORDS_PATH - ${CMAKE_CURRENT_LIST_DIR}/HunterCacheServers-passwords.cmake - CACHE STRING "Hunter passwords file") - -# In CI builds upload the binaries if the HUNTER_CACHE_TOKEN was decrypted -# (only for branches and internal PRs). -if("$ENV{CI}" AND NOT "$ENV{HUNTER_CACHE_TOKEN}" STREQUAL "") - set(run_upload YES) -else() - set(run_upload NO) -endif() -option(HUNTER_RUN_UPLOAD "Upload binaries to the Hunter cache server" ${run_upload}) -unset(run_upload) From 09fa9cfc71c78779591e46e4648d015ce2c137a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Bylica?= Date: Mon, 3 Apr 2023 18:48:01 +0200 Subject: [PATCH 3/4] cmake: Drop Cable toolchain helpers --- CMakeLists.txt | 2 -- appveyor.yml | 8 +------- circle.yml | 6 +++--- 3 files changed, 4 insertions(+), 12 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b89a73d8..19aa3af5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,11 +8,9 @@ include(cmake/cable/bootstrap.cmake) include(CableBuildType) include(CableCompilerSettings) -include(CableToolchains) include(CMakeDependentOption) include(CMakePackageConfigHelpers) -cable_configure_toolchain(DEFAULT cxx14) cable_set_build_type(DEFAULT Release CONFIGURATION_TYPES Release RelWithDebInfo Debug) option(ETHASH_INSTALL_CMAKE_CONFIG "Install CMake configuration scripts for find_package(CONFIG)" ON) diff --git a/appveyor.yml b/appveyor.yml index 85031b3c..3c199844 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -10,15 +10,9 @@ configuration: - Release environment: ARCH: amd64 - TOOLCHAIN: cxx11 - HUNTER_CACHE_TOKEN: - secure: agYfiC1OKfHnGOJQolOBorIRovVTgDW3TJ8JOb2+0XZiAnNwbrtPegxaaFM8/VWu matrix: - VS: 2019 APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019 - - VS: 2019 - TOOLCHAIN: cxx17 - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019 - VS: 2019 CC: clang-cl CXX: clang-cl @@ -37,7 +31,7 @@ install: before_build: - call "%ProgramFiles(x86)%\Microsoft Visual Studio\%VS%\Community\Common7\Tools\vsdevcmd" -arch=%ARCH% - - cmake -S . -B build -G Ninja -Wno-dev -DTOOLCHAIN=%TOOLCHAIN% -DCMAKE_INSTALL_PREFIX=./dist -DCMAKE_BUILD_TYPE=%CONFIGURATION% -DETHASH_TESTING=ON -DHUNTER_CONFIGURATION_TYPES=%CONFIGURATION% + - cmake -S . -B build -G Ninja -Wno-dev -DCMAKE_INSTALL_PREFIX=./dist -DCMAKE_BUILD_TYPE=%CONFIGURATION% -DETHASH_TESTING=ON -DHUNTER_CONFIGURATION_TYPES=%CONFIGURATION% build_script: - cmake --build build --target install diff --git a/circle.yml b/circle.yml index 5c01bbc4..3a1f1de1 100644 --- a/circle.yml +++ b/circle.yml @@ -162,7 +162,7 @@ jobs: - image: ethereum/cpp-build-env:19-gcc-12-multilib environment: - BUILD_TYPE: RelWithDebInfo - - CMAKE_OPTIONS: -DTOOLCHAIN=cxx11-32bit -DSANITIZE=address + - CMAKE_OPTIONS: -DCMAKE_TOOLCHAIN_FILE=cmake/cable/toolchains/cxx14-32bit.cmake -DSANITIZE=address - TESTS_EXCLUDE: _oom - ASAN_OPTIONS: allocator_may_return_null=1 steps: @@ -177,7 +177,7 @@ jobs: environment: - TESTS_EXCLUDE: _oom|_multithreaded - BUILD_TYPE: Coverage - - CMAKE_OPTIONS: -DTOOLCHAIN=powerpc64 -DCMAKE_EXE_LINKER_FLAGS=-static + - CMAKE_OPTIONS: -DCMAKE_TOOLCHAIN_FILE=cmake/cable/toolchains/powerpc64.cmake -DCMAKE_EXE_LINKER_FLAGS=-static steps: - checkout - install-powerpc64 @@ -296,7 +296,7 @@ jobs: docker: - image: ethereum/cpp-build-env:17-gcc-10 environment: - CMAKE_OPTIONS: -DTOOLCHAIN=wasm32-wasi -DETHASH_TESTING=NO -DETHASH_BUILD_GLOBAL_CONTEXT=NO + CMAKE_OPTIONS: -DCMAKE_TOOLCHAIN_FILE=cmake/toolchains/wasm32-wasi.cmake -DETHASH_TESTING=NO -DETHASH_BUILD_GLOBAL_CONTEXT=NO steps: - run: name: "Install WASI SDK" From 8ce526a8e534bf3ee0a58ef2fc0736c80dcea87c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Bylica?= Date: Mon, 3 Apr 2023 20:56:58 +0200 Subject: [PATCH 4/4] cmake: Do not set CMAKE_BUILD_TYPE, remove Cable --- CMakeLists.txt | 5 +- circle.yml | 4 +- cmake/{cable => }/CableCompilerSettings.cmake | 0 cmake/{cable => }/HunterGate.cmake | 0 cmake/cable/.gitignore | 1 - cmake/cable/CableBuildInfo.cmake | 98 --------- cmake/cable/CableBuildType.cmake | 44 ---- cmake/cable/CablePackage.cmake | 36 ---- cmake/cable/CableToolchains.cmake | 31 --- cmake/cable/LICENSE | 202 ------------------ cmake/cable/README.md | 92 -------- cmake/cable/bootstrap.cmake | 71 ------ cmake/cable/buildinfo/buildinfo.c.in | 24 --- cmake/cable/buildinfo/buildinfo.cmake | 84 -------- cmake/cable/buildinfo/buildinfo.h.in | 32 --- cmake/cable/buildinfo/buildinfo.json.in | 10 - cmake/cable/buildinfo/buildinfo.ps1.in | 5 - cmake/cable/buildinfo/buildinfo.sh.in | 5 - cmake/cable/buildinfo/gitinfo.cmake | 59 ----- cmake/cable/toolchains/cxx11-32bit.cmake | 10 - cmake/cable/toolchains/cxx11-c99.cmake | 10 - cmake/cable/toolchains/cxx11-fpic.cmake | 12 -- cmake/cable/toolchains/cxx11-pic.cmake | 9 - cmake/cable/toolchains/cxx11.cmake | 7 - cmake/cable/toolchains/cxx14-32bit.cmake | 10 - cmake/cable/toolchains/cxx14-pic.cmake | 9 - cmake/cable/toolchains/cxx14.cmake | 7 - cmake/cable/toolchains/cxx17-32bit.cmake | 10 - cmake/cable/toolchains/cxx17-pic.cmake | 9 - cmake/cable/toolchains/cxx17.cmake | 7 - cmake/cable/toolchains/default.cmake | 3 - cmake/cable/toolchains/mips64.cmake | 15 -- cmake/toolchains/32bit.cmake | 3 + cmake/{cable => }/toolchains/powerpc64.cmake | 0 34 files changed, 6 insertions(+), 918 deletions(-) rename cmake/{cable => }/CableCompilerSettings.cmake (100%) rename cmake/{cable => }/HunterGate.cmake (100%) delete mode 100644 cmake/cable/.gitignore delete mode 100644 cmake/cable/CableBuildInfo.cmake delete mode 100644 cmake/cable/CableBuildType.cmake delete mode 100644 cmake/cable/CablePackage.cmake delete mode 100644 cmake/cable/CableToolchains.cmake delete mode 100644 cmake/cable/LICENSE delete mode 100644 cmake/cable/README.md delete mode 100644 cmake/cable/bootstrap.cmake delete mode 100644 cmake/cable/buildinfo/buildinfo.c.in delete mode 100644 cmake/cable/buildinfo/buildinfo.cmake delete mode 100644 cmake/cable/buildinfo/buildinfo.h.in delete mode 100644 cmake/cable/buildinfo/buildinfo.json.in delete mode 100644 cmake/cable/buildinfo/buildinfo.ps1.in delete mode 100644 cmake/cable/buildinfo/buildinfo.sh.in delete mode 100644 cmake/cable/buildinfo/gitinfo.cmake delete mode 100644 cmake/cable/toolchains/cxx11-32bit.cmake delete mode 100644 cmake/cable/toolchains/cxx11-c99.cmake delete mode 100644 cmake/cable/toolchains/cxx11-fpic.cmake delete mode 100644 cmake/cable/toolchains/cxx11-pic.cmake delete mode 100644 cmake/cable/toolchains/cxx11.cmake delete mode 100644 cmake/cable/toolchains/cxx14-32bit.cmake delete mode 100644 cmake/cable/toolchains/cxx14-pic.cmake delete mode 100644 cmake/cable/toolchains/cxx14.cmake delete mode 100644 cmake/cable/toolchains/cxx17-32bit.cmake delete mode 100644 cmake/cable/toolchains/cxx17-pic.cmake delete mode 100644 cmake/cable/toolchains/cxx17.cmake delete mode 100644 cmake/cable/toolchains/default.cmake delete mode 100644 cmake/cable/toolchains/mips64.cmake create mode 100644 cmake/toolchains/32bit.cmake rename cmake/{cable => }/toolchains/powerpc64.cmake (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 19aa3af5..7de51be3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,15 +4,12 @@ cmake_minimum_required(VERSION 3.16.2...3.25) -include(cmake/cable/bootstrap.cmake) +list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake) -include(CableBuildType) include(CableCompilerSettings) include(CMakeDependentOption) include(CMakePackageConfigHelpers) -cable_set_build_type(DEFAULT Release CONFIGURATION_TYPES Release RelWithDebInfo Debug) - option(ETHASH_INSTALL_CMAKE_CONFIG "Install CMake configuration scripts for find_package(CONFIG)" ON) option(ETHASH_BUILD_ETHASH "Build ethash::ethash library (if NO only ethash::keccak is built)" YES) cmake_dependent_option(ETHASH_BUILD_GLOBAL_CONTEXT "Build ethash::global-context library" YES "ETHASH_BUILD_ETHASH" NO) diff --git a/circle.yml b/circle.yml index 3a1f1de1..c692494b 100644 --- a/circle.yml +++ b/circle.yml @@ -162,7 +162,7 @@ jobs: - image: ethereum/cpp-build-env:19-gcc-12-multilib environment: - BUILD_TYPE: RelWithDebInfo - - CMAKE_OPTIONS: -DCMAKE_TOOLCHAIN_FILE=cmake/cable/toolchains/cxx14-32bit.cmake -DSANITIZE=address + - CMAKE_OPTIONS: -DCMAKE_TOOLCHAIN_FILE=cmake/toolchains/32bit.cmake -DSANITIZE=address - TESTS_EXCLUDE: _oom - ASAN_OPTIONS: allocator_may_return_null=1 steps: @@ -177,7 +177,7 @@ jobs: environment: - TESTS_EXCLUDE: _oom|_multithreaded - BUILD_TYPE: Coverage - - CMAKE_OPTIONS: -DCMAKE_TOOLCHAIN_FILE=cmake/cable/toolchains/powerpc64.cmake -DCMAKE_EXE_LINKER_FLAGS=-static + - CMAKE_OPTIONS: -DCMAKE_TOOLCHAIN_FILE=cmake/toolchains/powerpc64.cmake -DCMAKE_EXE_LINKER_FLAGS=-static steps: - checkout - install-powerpc64 diff --git a/cmake/cable/CableCompilerSettings.cmake b/cmake/CableCompilerSettings.cmake similarity index 100% rename from cmake/cable/CableCompilerSettings.cmake rename to cmake/CableCompilerSettings.cmake diff --git a/cmake/cable/HunterGate.cmake b/cmake/HunterGate.cmake similarity index 100% rename from cmake/cable/HunterGate.cmake rename to cmake/HunterGate.cmake diff --git a/cmake/cable/.gitignore b/cmake/cable/.gitignore deleted file mode 100644 index a09c56df..00000000 --- a/cmake/cable/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/.idea diff --git a/cmake/cable/CableBuildInfo.cmake b/cmake/cable/CableBuildInfo.cmake deleted file mode 100644 index 51e27a3e..00000000 --- a/cmake/cable/CableBuildInfo.cmake +++ /dev/null @@ -1,98 +0,0 @@ -# Cable: CMake Bootstrap Library. -# Copyright 2019 Pawel Bylica. -# Licensed under the Apache License, Version 2.0. - -if(cable_build_info_included) - return() -endif() -set(cable_build_info_included TRUE) - -include(GNUInstallDirs) - -set(cable_buildinfo_template_dir ${CMAKE_CURRENT_LIST_DIR}/buildinfo) - -function(cable_add_buildinfo_library) - - cmake_parse_arguments("" "" PROJECT_NAME;EXPORT "" ${ARGN}) - - if(NOT _PROJECT_NAME) - message(FATAL_ERROR "The PROJECT_NAME argument missing") - endif() - - # Come up with the target and the C function names. - set(name ${_PROJECT_NAME}-buildinfo) - set(FUNCTION_NAME ${_PROJECT_NAME}_get_buildinfo) - - set(output_dir ${CMAKE_CURRENT_BINARY_DIR}/${_PROJECT_NAME}) - set(header_file ${output_dir}/buildinfo.h) - set(source_file ${output_dir}/buildinfo.c) - - if(CMAKE_CONFIGURATION_TYPES) - set(build_type ${CMAKE_CFG_INTDIR}) - else() - set(build_type ${CMAKE_BUILD_TYPE}) - endif() - - # Find git here to allow the user to provide hints. - find_package(Git) - - # Git info target. - # - # This target is named -git and is always built. - # The executed script gitinfo.cmake check git status and updates files - # containing git information if anything has changed. - add_custom_target( - ${name}-git - COMMAND ${CMAKE_COMMAND} - -DGIT=${GIT_EXECUTABLE} - -DSOURCE_DIR=${PROJECT_SOURCE_DIR} - -DOUTPUT_DIR=${output_dir} - -P ${cable_buildinfo_template_dir}/gitinfo.cmake - BYPRODUCTS ${output_dir}/gitinfo.txt - ) - - add_custom_command( - COMMENT "Updating ${name}:" - OUTPUT ${source_file} ${output_dir}/buildinfo.json - COMMAND ${CMAKE_COMMAND} - -DOUTPUT_DIR=${output_dir} - -DPROJECT_NAME=${_PROJECT_NAME} - -DFUNCTION_NAME=${FUNCTION_NAME} - -DPROJECT_VERSION=${PROJECT_VERSION} - -DSYSTEM_NAME=${CMAKE_SYSTEM_NAME} - -DSYSTEM_PROCESSOR=${CMAKE_SYSTEM_PROCESSOR} - -DCOMPILER_ID=${CMAKE_CXX_COMPILER_ID} - -DCOMPILER_VERSION=${CMAKE_CXX_COMPILER_VERSION} - -DBUILD_TYPE=${build_type} - -P ${cable_buildinfo_template_dir}/buildinfo.cmake - DEPENDS - ${cable_buildinfo_template_dir}/buildinfo.cmake - ${cable_buildinfo_template_dir}/buildinfo.c.in - ${cable_buildinfo_template_dir}/buildinfo.json.in - ${name}-git - ${output_dir}/gitinfo.txt - ) - - string(TIMESTAMP TIMESTAMP) - configure_file(${cable_buildinfo_template_dir}/buildinfo.h.in ${header_file}) - - # Add buildinfo library under given name. - # Make is static and do not build by default until some other target will actually use it. - add_library(${name} STATIC ${source_file} ${header_file}) - - target_include_directories(${name} PUBLIC $) - set_target_properties( - ${name} PROPERTIES - LIBRARY_OUTPUT_DIRECTORY ${output_dir} - ARCHIVE_OUTPUT_DIRECTORY ${output_dir} - ) - - if(_EXPORT) - install(TARGETS ${name} EXPORT ${_EXPORT} - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} - ) - endif() - -endfunction() diff --git a/cmake/cable/CableBuildType.cmake b/cmake/cable/CableBuildType.cmake deleted file mode 100644 index 80722965..00000000 --- a/cmake/cable/CableBuildType.cmake +++ /dev/null @@ -1,44 +0,0 @@ -# Cable: CMake Bootstrap Library. -# Copyright 2018 Pawel Bylica. -# Licensed under the Apache License, Version 2.0. See the LICENSE file. - -if(cable_build_type_included) - return() -endif() -set(cable_build_type_included TRUE) - -macro(cable_set_build_type) - if(NOT PROJECT_IS_NESTED) - # Do this configuration only in the top project. - if(PROJECT_SOURCE_DIR) - message(FATAL_ERROR "cable_set_build_type() can be used before project()") - endif() - - cmake_parse_arguments(build_type "" DEFAULT CONFIGURATION_TYPES ${ARGN}) - - if(CMAKE_CONFIGURATION_TYPES) - if(build_type_CONFIGURATION_TYPES) - set( - CMAKE_CONFIGURATION_TYPES - ${build_type_CONFIGURATION_TYPES} - CACHE - STRING - "Available configurations for multi-configuration generators" - FORCE - ) - endif() - cable_log("Configurations: ${CMAKE_CONFIGURATION_TYPES}") - else() - if(build_type_DEFAULT AND NOT CMAKE_BUILD_TYPE) - set( - CMAKE_BUILD_TYPE - ${build_type_DEFAULT} - CACHE STRING - "Build type for single-configuration generators" - FORCE - ) - endif() - cable_log("Build type: ${CMAKE_BUILD_TYPE}") - endif() - endif() -endmacro() diff --git a/cmake/cable/CablePackage.cmake b/cmake/cable/CablePackage.cmake deleted file mode 100644 index b051ad04..00000000 --- a/cmake/cable/CablePackage.cmake +++ /dev/null @@ -1,36 +0,0 @@ -# Cable: CMake Bootstrap Library -# Copyright 2019-2020 Pawel Bylica. -# Licensed under the Apache License, Version 2.0. - -# Cable Package, version 1.0.0 -# -# This CMake module provides default configuration for CPack -# -# CHANGELOG -# -# 1.0.0 - 2020-05-06 - -if(cable_package_included) - return() -endif() -set(cable_package_included TRUE) - -# Configures CPack to build the archive package. -macro(cable_add_archive_package) - if(WIN32) - set(CPACK_GENERATOR ZIP) - set(CPACK_SOURCE_GENERATOR ZIP) - else() - set(CPACK_GENERATOR TGZ) - set(CPACK_SOURCE_GENERATOR TGZ) - endif() - string(TOLOWER ${CMAKE_SYSTEM_NAME} system_name) - string(TOLOWER ${CMAKE_SYSTEM_PROCESSOR} system_processor) - set(CPACK_PACKAGE_FILE_NAME ${PROJECT_NAME}-${PROJECT_VERSION}-${system_name}-${system_processor}) - set(CPACK_SOURCE_PACKAGE_FILE_NAME ${PROJECT_NAME}-${PROJECT_VERSION}-source) - set(CPACK_PACKAGE_CHECKSUM SHA256) - set(CPACK_INCLUDE_TOPLEVEL_DIRECTORY FALSE) - unset(system_name) - unset(system_processor) - include(CPack) -endmacro() diff --git a/cmake/cable/CableToolchains.cmake b/cmake/cable/CableToolchains.cmake deleted file mode 100644 index d5af2cb3..00000000 --- a/cmake/cable/CableToolchains.cmake +++ /dev/null @@ -1,31 +0,0 @@ -# Cable: CMake Bootstrap Library. -# Copyright 2018 Pawel Bylica. -# Licensed under the Apache License, Version 2.0. See the LICENSE file. - -set(cable_toolchain_dir ${CMAKE_CURRENT_LIST_DIR}/toolchains) - -function(cable_configure_toolchain) - if(NOT PROJECT_IS_NESTED) - # Do this configuration only in the top project. - - cmake_parse_arguments("" "" "DEFAULT" "" ${ARGN}) - - set(default_toolchain default) - if(_DEFAULT) - set(default_toolchain ${_DEFAULT}) - endif() - - set(TOOLCHAIN ${default_toolchain} CACHE STRING "CMake toolchain") - - set(toolchain_file toolchains/${TOOLCHAIN}.cmake) - foreach(path ${CMAKE_MODULE_PATH}) - if(EXISTS "${path}/${toolchain_file}") - set(toolchain_file "${path}/${toolchain_file}") - break() - endif() - endforeach() - - cable_debug("Toolchain file: ${toolchain_file}") - set(CMAKE_TOOLCHAIN_FILE ${toolchain_file} CACHE FILEPATH "CMake toolchain file") - endif() -endfunction() diff --git a/cmake/cable/LICENSE b/cmake/cable/LICENSE deleted file mode 100644 index d6456956..00000000 --- a/cmake/cable/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/cmake/cable/README.md b/cmake/cable/README.md deleted file mode 100644 index a54d28eb..00000000 --- a/cmake/cable/README.md +++ /dev/null @@ -1,92 +0,0 @@ -# Cable - -[![readme style: standard][readme style standard badge]][standard readme] - -> Cable: CMake Bootstrap Library - -Cable is a set of CMake modules and scripts containing common patterns used -in CMake-based C++ projects. The design goal is to be pragmatic rather than -generic so the number of provided options is minimal. The Cable modules are -independent and it is easy to use them individually. - - -## Table of Contents - -- [Install](#install) -- [Usage](#usage) -- [Maintainer](#maintainer) -- [License](#license) - - -## Install - -The suggested Cable location is `cmake/cable` relative to your project root directory. - -### As git subtree - -Adding a dependency project as a [git subtree] is just a copy of the source code -done in a bit more systematic way. - -If you are not familiar with managing dependencies with git subtree read the -[Git subtree: the alternative to Git submodule][git subtree tutorial]. - -#### To install - -```sh -git remote add cable https://github.com/ethereum/cable -git subtree add --prefix cmake/cable cable master --squash -``` - -#### To update - -```sh -git subtree pull --prefix cmake/cable cable master --squash -``` - -### As git submodule - -Include the Cable library as [git submodule] in your project. - -```sh -git submodule add https://github.com/ethereum/cable cmake/cable -``` - -## Usage - -Cable contains the `bootstrap.cmake` file that initializes the library. -Start by including this file in your main `CMakeLists.txt` from the Cable -submodule/subtree or any other location. The `bootstrap.cmake` must be included -before the `project()` command. After that, you can include and use other -Cable modules. - -### Example - -```cmake -cmake_minimum_required(VERSION 3.5) - -include(cmake/cable/bootstrap.cmake) -include(CableBuildType) - -project(tothemoon) - -cable_set_build_type(DEFAULT RelWithDebInfo CONFIGURATION_TYPES Debug Release RelWithDebInfo) -``` - - -## Maintainer - -Paweł Bylica [@chfast] - -## License - -Licensed under the [Apache License, Version 2.0]. - - -[@chfast]: https://github.com/chfast -[Apache License, Version 2.0]: LICENSE -[git submodule]: https://git-scm.com/book/en/v2/Git-Tools-Submodules -[git subtree]: https://github.com/git/git/blob/master/contrib/subtree/git-subtree.txt -[git subtree tutorial]: https://www.atlassian.com/blog/git/alternatives-to-git-submodule-git-subtree -[standard readme]: https://github.com/RichardLitt/standard-readme - -[readme style standard badge]: https://img.shields.io/badge/readme%20style-standard-brightgreen.svg?style=flat-square diff --git a/cmake/cable/bootstrap.cmake b/cmake/cable/bootstrap.cmake deleted file mode 100644 index 3e9ba3da..00000000 --- a/cmake/cable/bootstrap.cmake +++ /dev/null @@ -1,71 +0,0 @@ -# Cable: CMake Bootstrap Library. -# Copyright 2019 Pawel Bylica. -# Licensed under the Apache License, Version 2.0. - -# Bootstrap the Cable - CMake Bootstrap Library by including this file. -# e.g. include(cmake/cable/bootstrap.cmake). - - -# Cable version. -# -# This is internal variable automatically updated with external tools. -# Use CABLE_VERSION variable if you need this information. -set(version 0.4.1) - -# For convenience, add the project CMake module dir to module path. -set(module_dir ${CMAKE_CURRENT_SOURCE_DIR}/cmake) -if(EXISTS ${module_dir}) - list(APPEND CMAKE_MODULE_PATH ${module_dir}) -endif() - -if(CABLE_VERSION) - # Some other instance of Cable has been initialized in the top project. - - # Mark this project as nested. - set(PROJECT_IS_NESTED TRUE) - - # Compare versions of the top project and this instances. - if(CABLE_VERSION VERSION_LESS version) - set(comment " (version older than ${version})") - elseif(CABLE_VERSION VERSION_GREATER version) - set(comment " (version newer than ${version})") - endif() - - # Log information about initialization in the top project. - file(RELATIVE_PATH subproject_dir ${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}) - cable_debug("${subproject_dir}: Cable ${CABLE_VERSION}${comment} already initialized in the top project") - cable_debug("Project CMake modules directory: ${module_dir}") - - unset(version) - unset(module_dir) - unset(comment) - return() -endif() - - -option(CABLE_DEBUG "Enable Cable debug logs" OFF) - -function(cable_log) - message(STATUS "[cable ] ${ARGN}") -endfunction() - -function(cable_debug) - if(CABLE_DEBUG) - message(STATUS "[cable*] ${ARGN}") - endif() -endfunction() - -# Export Cable version. -set(CABLE_VERSION ${version}) - -# Mark this project as non-nested. -set(PROJECT_IS_NESTED FALSE) - -# Add Cable modules to the CMake module path. -list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}) - -cable_log("Cable ${CABLE_VERSION} initialized") -cable_debug("Project CMake modules directory: ${module_dir}") - -unset(version) -unset(module_dir) diff --git a/cmake/cable/buildinfo/buildinfo.c.in b/cmake/cable/buildinfo/buildinfo.c.in deleted file mode 100644 index efd20405..00000000 --- a/cmake/cable/buildinfo/buildinfo.c.in +++ /dev/null @@ -1,24 +0,0 @@ -/* Cable: CMake Bootstrap Library. - * Copyright 2018 Pawel Bylica. - * Licensed under the Apache License, Version 2.0. See the LICENSE file. - */ - -/* Generated by Cable Build Info on @TIMESTAMP@. Do not modify directly. */ - -#include "buildinfo.h" - -const struct buildinfo* @FUNCTION_NAME@() -{ - static const struct buildinfo buildinfo = { - .project_name = "@PROJECT_NAME@", - .project_version = "@PROJECT_VERSION@", - .project_name_with_version = "@PROJECT_NAME@-@PROJECT_VERSION@", - .git_commit_hash = "@GIT_COMMIT_HASH@", - .system_name = "@SYSTEM_NAME@", - .system_processor = "@SYSTEM_PROCESSOR@", - .compiler_id = "@COMPILER_ID@", - .compiler_version = "@COMPILER_VERSION@", - .build_type = "@BUILD_TYPE@", - }; - return &buildinfo; -} diff --git a/cmake/cable/buildinfo/buildinfo.cmake b/cmake/cable/buildinfo/buildinfo.cmake deleted file mode 100644 index f4dbbc32..00000000 --- a/cmake/cable/buildinfo/buildinfo.cmake +++ /dev/null @@ -1,84 +0,0 @@ -# Cable: CMake Bootstrap Library. -# Copyright 2018 Pawel Bylica. -# Licensed under the Apache License, Version 2.0. See the LICENSE file. - -string(TOLOWER "${SYSTEM_NAME}" SYSTEM_NAME) -string(TOLOWER "${SYSTEM_PROCESSOR}" SYSTEM_PROCESSOR) -string(TOLOWER "${COMPILER_ID}" COMPILER_ID) -string(TOLOWER "${BUILD_TYPE}" BUILD_TYPE) -string(TIMESTAMP TIMESTAMP) - -# Read the git info from a file. The gitinfo is suppose to update the file -# only if the information has changed. -file(STRINGS ${OUTPUT_DIR}/gitinfo.txt gitinfo) -list(LENGTH gitinfo gitinfo_len) -if(gitinfo_len LESS 3) - message(WARNING "Git info not available") -else() - list(GET gitinfo 0 describe) - list(GET gitinfo 1 GIT_BRANCH) - list(GET gitinfo 2 GIT_ORIGIN_URL) -endif() - -# The output of `git describe --always --long --tags --match=v*`. -string(REGEX MATCH "(v(.+)-([0-9]+)-g)?([0-9a-f]+)(-dirty)?" match "${describe}") - -if(DEFINED describe AND NOT match) - message(WARNING "Cannot parse git describe: ${describe}") -endif() - -set(GIT_LATEST_PROJECT_VERSION ${CMAKE_MATCH_2}) -set(GIT_LATEST_PROJECT_VERSION_DISTANCE ${CMAKE_MATCH_3}) -set(GIT_COMMIT_HASH ${CMAKE_MATCH_4}) -if(CMAKE_MATCH_5) - set(GIT_DIRTY TRUE) - set(dirty_msg " (dirty)") -else() - set(GIT_DIRTY FALSE) -endif() - -if(GIT_COMMIT_HASH) - string(SUBSTRING ${GIT_COMMIT_HASH} 0 8 abbrev) - set(version_commit "+commit.${abbrev}") - if(GIT_DIRTY) - set(version_commit "${version_commit}.dirty") - endif() -endif() - -if(NOT PROJECT_VERSION) - message(WARNING "PROJECT_VERSION not specified") -endif() - -if(PROJECT_VERSION STREQUAL GIT_LATEST_PROJECT_VERSION) - if(${GIT_LATEST_PROJECT_VERSION_DISTANCE} GREATER 0) - set(PROJECT_VERSION "${PROJECT_VERSION}-${GIT_LATEST_PROJECT_VERSION_DISTANCE}${version_commit}") - endif() -else() - if(GIT_LATEST_PROJECT_VERSION) - message(WARNING "Git project version mismatch: '${GIT_LATEST_PROJECT_VERSION}' vs '${PROJECT_VERSION}'") - endif() - set(PROJECT_VERSION "${PROJECT_VERSION}${version_commit}") -endif() - -if(PROJECT_VERSION MATCHES "^([0-9]+)\\.([0-9]+)\\.([0-9]+)$") - set(PROJECT_VERSION_IS_PRERELEASE false) -else() - set(PROJECT_VERSION_IS_PRERELEASE true) - set(prerelease_comment " (prerelease)") -endif() - -message( - " Project Version: ${PROJECT_VERSION}${prerelease_comment}\n" - " System Name: ${SYSTEM_NAME}\n" - " System Processor: ${SYSTEM_PROCESSOR}\n" - " Compiler ID: ${COMPILER_ID}\n" - " Compiler Version: ${COMPILER_VERSION}\n" - " Build Type: ${BUILD_TYPE}\n" - " Git Info: ${GIT_LATEST_PROJECT_VERSION} ${GIT_LATEST_PROJECT_VERSION_DISTANCE} ${GIT_COMMIT_HASH}${dirty_msg}\n" - " Timestamp: ${TIMESTAMP}" -) - -configure_file(${CMAKE_CURRENT_LIST_DIR}/buildinfo.c.in ${OUTPUT_DIR}/buildinfo.c) -configure_file(${CMAKE_CURRENT_LIST_DIR}/buildinfo.json.in ${OUTPUT_DIR}/buildinfo.json) -configure_file(${CMAKE_CURRENT_LIST_DIR}/buildinfo.sh.in ${OUTPUT_DIR}/buildinfo.sh) -configure_file(${CMAKE_CURRENT_LIST_DIR}/buildinfo.ps1.in ${OUTPUT_DIR}/buildinfo.ps1) diff --git a/cmake/cable/buildinfo/buildinfo.h.in b/cmake/cable/buildinfo/buildinfo.h.in deleted file mode 100644 index d91974b1..00000000 --- a/cmake/cable/buildinfo/buildinfo.h.in +++ /dev/null @@ -1,32 +0,0 @@ -/* Cable: CMake Bootstrap Library. - * Copyright 2018 Pawel Bylica. - * Licensed under the Apache License, Version 2.0. See the LICENSE file. - */ - -/* Generated by Cable Build Info on @TIMESTAMP@. Do not modify directly. */ - -#pragma once - -#ifdef __cplusplus -extern "C" -{ -#endif - -struct buildinfo -{ - const char* project_name; - const char* project_version; - const char* project_name_with_version; - const char* git_commit_hash; - const char* system_name; - const char* system_processor; - const char* compiler_id; - const char* compiler_version; - const char* build_type; -}; - -const struct buildinfo* @FUNCTION_NAME@(); - -#ifdef __cplusplus -} -#endif diff --git a/cmake/cable/buildinfo/buildinfo.json.in b/cmake/cable/buildinfo/buildinfo.json.in deleted file mode 100644 index 6a36a738..00000000 --- a/cmake/cable/buildinfo/buildinfo.json.in +++ /dev/null @@ -1,10 +0,0 @@ -{ - "name": "@PROJECT_NAME@", - "version": "@PROJECT_VERSION@", - "is_prerelease": @PROJECT_VERSION_IS_PRERELEASE@, - "commit": "@GIT_COMMIT_HASH@", - "branch": "@GIT_BRANCH@", - "repo": "@GIT_ORIGIN_URL@", - "system_name": "@SYSTEM_NAME@", - "system_processor": "@SYSTEM_PROCESSOR@" -} diff --git a/cmake/cable/buildinfo/buildinfo.ps1.in b/cmake/cable/buildinfo/buildinfo.ps1.in deleted file mode 100644 index a121ec7a..00000000 --- a/cmake/cable/buildinfo/buildinfo.ps1.in +++ /dev/null @@ -1,5 +0,0 @@ -$env:project_name="@PROJECT_NAME@" -$env:project_version="@PROJECT_VERSION@" -$env:project_version_is_prerelease="@PROJECT_VERSION_IS_PRERELEASE@" -$env:system_name='@SYSTEM_NAME@' -$env:system_processor='@SYSTEM_PROCESSOR@' diff --git a/cmake/cable/buildinfo/buildinfo.sh.in b/cmake/cable/buildinfo/buildinfo.sh.in deleted file mode 100644 index 97cf1ae9..00000000 --- a/cmake/cable/buildinfo/buildinfo.sh.in +++ /dev/null @@ -1,5 +0,0 @@ -PROJECT_NAME='@PROJECT_NAME@' -PROJECT_VERSION='@PROJECT_VERSION@' -PROJECT_VERSION_IS_PRERELEASE='@PROJECT_VERSION_IS_PRERELEASE@' -SYSTEM_NAME='@SYSTEM_NAME@' -SYSTEM_PROCESSOR='@SYSTEM_PROCESSOR@' diff --git a/cmake/cable/buildinfo/gitinfo.cmake b/cmake/cable/buildinfo/gitinfo.cmake deleted file mode 100644 index 0d7bc2fc..00000000 --- a/cmake/cable/buildinfo/gitinfo.cmake +++ /dev/null @@ -1,59 +0,0 @@ -# Cable: CMake Bootstrap Library. -# Copyright 2018 Pawel Bylica. -# Licensed under the Apache License, Version 2.0. See the LICENSE file. - -# Execute git only if the tool is available. -if(GIT) - execute_process( - COMMAND ${GIT} describe --always --long --tags --first-parent --match=v* --abbrev=40 --dirty - WORKING_DIRECTORY ${SOURCE_DIR} - OUTPUT_VARIABLE gitinfo - OUTPUT_STRIP_TRAILING_WHITESPACE - ERROR_VARIABLE error - ERROR_STRIP_TRAILING_WHITESPACE - ) - if(error) - message(WARNING "Git ${error}") - endif() - - execute_process( - COMMAND ${GIT} rev-parse --abbrev-ref HEAD - WORKING_DIRECTORY ${SOURCE_DIR} - OUTPUT_VARIABLE gitbranch - OUTPUT_STRIP_TRAILING_WHITESPACE - ERROR_VARIABLE error - ERROR_STRIP_TRAILING_WHITESPACE - ) - if(error) - message(WARNING "Git ${error}") - else() - set(gitinfo "${gitinfo}\n${gitbranch}") - endif() - - execute_process( - COMMAND ${GIT} config --get remote.origin.url - WORKING_DIRECTORY ${SOURCE_DIR} - OUTPUT_VARIABLE gitorigin - OUTPUT_STRIP_TRAILING_WHITESPACE - ERROR_VARIABLE error - ERROR_STRIP_TRAILING_WHITESPACE - ) - if(error) - message(WARNING "Git ${error}") - else() - set(gitinfo "${gitinfo}\n${gitorigin}\n") - endif() -endif() - -set(gitinfo_file ${OUTPUT_DIR}/gitinfo.txt) - -if(EXISTS ${gitinfo_file}) - file(READ ${gitinfo_file} prev_gitinfo) -else() - # Create empty file, because other targets expect it to exist. - file(WRITE ${gitinfo_file} "") -endif() - -if(NOT "${gitinfo}" STREQUAL "${prev_gitinfo}") - file(WRITE ${gitinfo_file} ${gitinfo}) -endif() diff --git a/cmake/cable/toolchains/cxx11-32bit.cmake b/cmake/cable/toolchains/cxx11-32bit.cmake deleted file mode 100644 index f3f28cf2..00000000 --- a/cmake/cable/toolchains/cxx11-32bit.cmake +++ /dev/null @@ -1,10 +0,0 @@ -# Cable: CMake Bootstrap Library. -# Copyright 2018-2019 Pawel Bylica. -# Licensed under the Apache License, Version 2.0. - -set(CMAKE_CXX_STANDARD 11) -set(CMAKE_CXX_STANDARD_REQUIRED TRUE) -set(CMAKE_CXX_EXTENSIONS OFF) - -set(CMAKE_C_FLAGS_INIT -m32) -set(CMAKE_CXX_FLAGS_INIT -m32) diff --git a/cmake/cable/toolchains/cxx11-c99.cmake b/cmake/cable/toolchains/cxx11-c99.cmake deleted file mode 100644 index 91a93b33..00000000 --- a/cmake/cable/toolchains/cxx11-c99.cmake +++ /dev/null @@ -1,10 +0,0 @@ -# Cable: CMake Bootstrap Library. -# Copyright 2018 Pawel Bylica. -# Licensed under the Apache License, Version 2.0. See the LICENSE file. - -set(CMAKE_CXX_STANDARD 11) -set(CMAKE_CXX_STANDARD_REQUIRED TRUE) -set(CMAKE_CXX_EXTENSIONS OFF) - -set(CMAKE_C_STANDARD 99) -set(CMAKE_C_EXTENSIONS OFF) diff --git a/cmake/cable/toolchains/cxx11-fpic.cmake b/cmake/cable/toolchains/cxx11-fpic.cmake deleted file mode 100644 index 52d4f972..00000000 --- a/cmake/cable/toolchains/cxx11-fpic.cmake +++ /dev/null @@ -1,12 +0,0 @@ -# Cable: CMake Bootstrap Library. -# Copyright 2018 Pawel Bylica. -# Licensed under the Apache License, Version 2.0. See the LICENSE file. - -set(CMAKE_CXX_STANDARD 11) -set(CMAKE_CXX_STANDARD_REQUIRED TRUE) -set(CMAKE_CXX_EXTENSIONS OFF) - -set(CMAKE_POSITION_INDEPENDENT_CODE ON) - -set(CMAKE_CXX_FLAGS_INIT "-fPIC" CACHE STRING "" FORCE) -set(CMAKE_C_FLAGS_INIT "-fPIC" CACHE STRING "" FORCE) diff --git a/cmake/cable/toolchains/cxx11-pic.cmake b/cmake/cable/toolchains/cxx11-pic.cmake deleted file mode 100644 index db7d9e5b..00000000 --- a/cmake/cable/toolchains/cxx11-pic.cmake +++ /dev/null @@ -1,9 +0,0 @@ -# Cable: CMake Bootstrap Library. -# Copyright 2018 Pawel Bylica. -# Licensed under the Apache License, Version 2.0. See the LICENSE file. - -set(CMAKE_CXX_STANDARD 11) -set(CMAKE_CXX_STANDARD_REQUIRED TRUE) -set(CMAKE_CXX_EXTENSIONS OFF) - -set(CMAKE_POSITION_INDEPENDENT_CODE ON) diff --git a/cmake/cable/toolchains/cxx11.cmake b/cmake/cable/toolchains/cxx11.cmake deleted file mode 100644 index cd6b82ff..00000000 --- a/cmake/cable/toolchains/cxx11.cmake +++ /dev/null @@ -1,7 +0,0 @@ -# Cable: CMake Bootstrap Library. -# Copyright 2018 Pawel Bylica. -# Licensed under the Apache License, Version 2.0. See the LICENSE file. - -set(CMAKE_CXX_STANDARD 11) -set(CMAKE_CXX_STANDARD_REQUIRED TRUE) -set(CMAKE_CXX_EXTENSIONS OFF) diff --git a/cmake/cable/toolchains/cxx14-32bit.cmake b/cmake/cable/toolchains/cxx14-32bit.cmake deleted file mode 100644 index 15145ff9..00000000 --- a/cmake/cable/toolchains/cxx14-32bit.cmake +++ /dev/null @@ -1,10 +0,0 @@ -# Cable: CMake Bootstrap Library. -# Copyright 2019 Pawel Bylica. -# Licensed under the Apache License, Version 2.0. - -set(CMAKE_CXX_STANDARD 14) -set(CMAKE_CXX_STANDARD_REQUIRED TRUE) -set(CMAKE_CXX_EXTENSIONS OFF) - -set(CMAKE_C_FLAGS_INIT -m32) -set(CMAKE_CXX_FLAGS_INIT -m32) diff --git a/cmake/cable/toolchains/cxx14-pic.cmake b/cmake/cable/toolchains/cxx14-pic.cmake deleted file mode 100644 index 507771fc..00000000 --- a/cmake/cable/toolchains/cxx14-pic.cmake +++ /dev/null @@ -1,9 +0,0 @@ -# Cable: CMake Bootstrap Library. -# Copyright 2019 Pawel Bylica. -# Licensed under the Apache License, Version 2.0. - -set(CMAKE_CXX_STANDARD 14) -set(CMAKE_CXX_STANDARD_REQUIRED TRUE) -set(CMAKE_CXX_EXTENSIONS OFF) - -set(CMAKE_POSITION_INDEPENDENT_CODE ON) diff --git a/cmake/cable/toolchains/cxx14.cmake b/cmake/cable/toolchains/cxx14.cmake deleted file mode 100644 index 646acafb..00000000 --- a/cmake/cable/toolchains/cxx14.cmake +++ /dev/null @@ -1,7 +0,0 @@ -# Cable: CMake Bootstrap Library. -# Copyright 2019 Pawel Bylica. -# Licensed under the Apache License, Version 2.0. - -set(CMAKE_CXX_STANDARD 14) -set(CMAKE_CXX_STANDARD_REQUIRED TRUE) -set(CMAKE_CXX_EXTENSIONS OFF) diff --git a/cmake/cable/toolchains/cxx17-32bit.cmake b/cmake/cable/toolchains/cxx17-32bit.cmake deleted file mode 100644 index 183aab31..00000000 --- a/cmake/cable/toolchains/cxx17-32bit.cmake +++ /dev/null @@ -1,10 +0,0 @@ -# Cable: CMake Bootstrap Library. -# Copyright 2019 Pawel Bylica. -# Licensed under the Apache License, Version 2.0. - -set(CMAKE_CXX_STANDARD 17) -set(CMAKE_CXX_STANDARD_REQUIRED TRUE) -set(CMAKE_CXX_EXTENSIONS OFF) - -set(CMAKE_C_FLAGS_INIT -m32) -set(CMAKE_CXX_FLAGS_INIT -m32) diff --git a/cmake/cable/toolchains/cxx17-pic.cmake b/cmake/cable/toolchains/cxx17-pic.cmake deleted file mode 100644 index edb3559e..00000000 --- a/cmake/cable/toolchains/cxx17-pic.cmake +++ /dev/null @@ -1,9 +0,0 @@ -# Cable: CMake Bootstrap Library. -# Copyright 2019 Pawel Bylica. -# Licensed under the Apache License, Version 2.0. - -set(CMAKE_CXX_STANDARD 17) -set(CMAKE_CXX_STANDARD_REQUIRED TRUE) -set(CMAKE_CXX_EXTENSIONS OFF) - -set(CMAKE_POSITION_INDEPENDENT_CODE ON) diff --git a/cmake/cable/toolchains/cxx17.cmake b/cmake/cable/toolchains/cxx17.cmake deleted file mode 100644 index a4efcaa2..00000000 --- a/cmake/cable/toolchains/cxx17.cmake +++ /dev/null @@ -1,7 +0,0 @@ -# Cable: CMake Bootstrap Library. -# Copyright 2019 Pawel Bylica. -# Licensed under the Apache License, Version 2.0. - -set(CMAKE_CXX_STANDARD 17) -set(CMAKE_CXX_STANDARD_REQUIRED TRUE) -set(CMAKE_CXX_EXTENSIONS OFF) diff --git a/cmake/cable/toolchains/default.cmake b/cmake/cable/toolchains/default.cmake deleted file mode 100644 index 9869b6e1..00000000 --- a/cmake/cable/toolchains/default.cmake +++ /dev/null @@ -1,3 +0,0 @@ -# Cable: CMake Bootstrap Library. -# Copyright 2018 Pawel Bylica. -# Licensed under the Apache License, Version 2.0. See the LICENSE file. diff --git a/cmake/cable/toolchains/mips64.cmake b/cmake/cable/toolchains/mips64.cmake deleted file mode 100644 index 24b1a689..00000000 --- a/cmake/cable/toolchains/mips64.cmake +++ /dev/null @@ -1,15 +0,0 @@ -# Cable: CMake Bootstrap Library. -# Copyright 2018 Pawel Bylica. -# Licensed under the Apache License, Version 2.0. See the LICENSE file. - -set(CMAKE_SYSTEM_PROCESSOR mips64) -set(CMAKE_SYSTEM_NAME Linux) -set(CMAKE_C_COMPILER mips64-linux-gnuabi64-gcc) -set(CMAKE_CXX_COMPILER mips64-linux-gnuabi64-g++) - -set(CMAKE_FIND_ROOT_PATH /usr/mips64-linux-gnuabi64) -SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) -SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) -SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) - -set(CMAKE_CROSSCOMPILING_EMULATOR qemu-mips64-static;-L;${CMAKE_FIND_ROOT_PATH}) diff --git a/cmake/toolchains/32bit.cmake b/cmake/toolchains/32bit.cmake new file mode 100644 index 00000000..1ca68687 --- /dev/null +++ b/cmake/toolchains/32bit.cmake @@ -0,0 +1,3 @@ + +set(CMAKE_C_FLAGS_INIT -m32) +set(CMAKE_CXX_FLAGS_INIT -m32) diff --git a/cmake/cable/toolchains/powerpc64.cmake b/cmake/toolchains/powerpc64.cmake similarity index 100% rename from cmake/cable/toolchains/powerpc64.cmake rename to cmake/toolchains/powerpc64.cmake