From 61c290d8718dd1e1a849e98d0dc1722627903246 Mon Sep 17 00:00:00 2001 From: ITesserakt Date: Sun, 31 Oct 2021 21:36:43 +0300 Subject: [PATCH 01/24] Ignoring .idea folder from git --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 3fce1b92d..ac680e1d0 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ build*/ boost/ boost_*.tar.xz +.idea/ \ No newline at end of file From 3e2b5b709d0a144b3b34012c832efb31f82511fd Mon Sep 17 00:00:00 2001 From: ITesserakt Date: Mon, 1 Nov 2021 00:24:34 +0300 Subject: [PATCH 02/24] Bumped Boost version to 1.77.0 --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 16d48dc87..40fb3ec06 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,8 +3,8 @@ project(Boost-CMake) option(BOOST_DISABLE_TESTS "Do not build test targets, even if building standalone" OFF) -set(BOOST_URL "https://boostorg.jfrog.io/artifactory/main/release/1.71.0/source/boost_1_71_0.tar.bz2" CACHE STRING "Boost download URL") -set(BOOST_URL_SHA256 "d73a8da01e8bf8c7eda40b4c84915071a8c8a0df4a6734537ddde4a8580524ee" CACHE STRING "Boost download URL SHA256 checksum") +set(BOOST_URL "https://boostorg.jfrog.io/artifactory/main/release/1.77.0/source/boost_1_77_0.tar.bz2" CACHE STRING "Boost download URL") +set(BOOST_URL_SHA256 "fc9f85fc030e233142908241af7a846e60630aa7388de9a5fafb1f3a26840854" CACHE STRING "Boost download URL SHA256 checksum") include(FetchContent) FetchContent_Declare( From 818ee6885303750a232843bac32b5c5f307d4863 Mon Sep 17 00:00:00 2001 From: ITesserakt Date: Mon, 1 Nov 2021 00:25:36 +0300 Subject: [PATCH 03/24] Fixed various errors after bump --- libs/atomic.cmake | 15 ++++++++++++--- libs/container.cmake | 1 - libs/context.cmake | 1 - libs/date_time.cmake | 2 -- libs/exception.cmake | 3 +++ libs/fiber.cmake | 2 +- libs/filesystem.cmake | 6 ++++++ libs/locale.cmake | 3 ++- libs/random.cmake | 5 +++-- libs/regex.cmake | 12 ------------ 10 files changed, 27 insertions(+), 23 deletions(-) diff --git a/libs/atomic.cmake b/libs/atomic.cmake index e76b7044c..a359c7efa 100644 --- a/libs/atomic.cmake +++ b/libs/atomic.cmake @@ -1,7 +1,18 @@ +set(atomic_srcs + ${BOOST_SOURCE}/libs/atomic/src/lock_pool.cpp + ${BOOST_SOURCE}/libs/atomic/src/find_address_sse2.cpp) + +if (WIN32) + set(atomic_libs ${atomic_srcs} + ${BOOST_SOURCE}/libs/atomic/src/wait_ops_windows.cpp) +endif() + _add_boost_lib( NAME atomic SOURCES - ${BOOST_SOURCE}/libs/atomic/src/lockpool.cpp + ${atomic_srcs} + INCLUDE_PRIVATE + ${BOOST_SOURCE}/libs/atomic/src DEFINE_PRIVATE BOOST_ATOMIC_STATIC_LINK=1 BOOST_ATOMIC_SOURCE @@ -17,8 +28,6 @@ _add_boost_test( BOOST_THREAD_PROVIDES_NESTED_LOCKS=1 BOOST_THREAD_USES_DATETIME=1 TESTS - RUN ${BOOST_SOURCE}/libs/atomic/test/native_api.cpp - RUN ${BOOST_SOURCE}/libs/atomic/test/fallback_api.cpp RUN ${BOOST_SOURCE}/libs/atomic/test/atomicity.cpp RUN ${BOOST_SOURCE}/libs/atomic/test/ordering.cpp RUN ${BOOST_SOURCE}/libs/atomic/test/lockfree.cpp diff --git a/libs/container.cmake b/libs/container.cmake index a0cc1fc8d..4c9b89523 100644 --- a/libs/container.cmake +++ b/libs/container.cmake @@ -54,7 +54,6 @@ _add_boost_test( RUN ${BOOST_SOURCE}/libs/container/test/pmr_slist_test.cpp RUN ${BOOST_SOURCE}/libs/container/test/pmr_small_vector_test.cpp RUN ${BOOST_SOURCE}/libs/container/test/pmr_stable_vector_test.cpp - RUN ${BOOST_SOURCE}/libs/container/test/pmr_static_vector_test.cpp RUN ${BOOST_SOURCE}/libs/container/test/pmr_string_test.cpp RUN ${BOOST_SOURCE}/libs/container/test/pmr_vector_test.cpp RUN ${BOOST_SOURCE}/libs/container/test/polymorphic_allocator_test.cpp diff --git a/libs/context.cmake b/libs/context.cmake index ac5d6ff37..c2398d28b 100644 --- a/libs/context.cmake +++ b/libs/context.cmake @@ -56,5 +56,4 @@ _add_boost_test( RUN ${BOOST_SOURCE}/libs/context/test/test_fcontext.cpp RUN ${BOOST_SOURCE}/libs/context/test/test_fiber.cpp RUN ${BOOST_SOURCE}/libs/context/test/test_callcc.cpp - RUN ${BOOST_SOURCE}/libs/context/test/test_execution_context_v2.cpp ) diff --git a/libs/date_time.cmake b/libs/date_time.cmake index 2ed96e0d6..0d5282425 100644 --- a/libs/date_time.cmake +++ b/libs/date_time.cmake @@ -2,8 +2,6 @@ _add_boost_lib( NAME date_time SOURCES ${BOOST_SOURCE}/libs/date_time/src/gregorian/greg_month.cpp - ${BOOST_SOURCE}/libs/date_time/src/gregorian/greg_weekday.cpp - ${BOOST_SOURCE}/libs/date_time/src/gregorian/date_generators.cpp DEFINE_PRIVATE BOOST_DATE_TIME_STATIC_LINK DATE_TIME_INLINE diff --git a/libs/exception.cmake b/libs/exception.cmake index 646df6a0d..c93fe557b 100644 --- a/libs/exception.cmake +++ b/libs/exception.cmake @@ -38,3 +38,6 @@ _add_boost_test( RUN ${BOOST_SOURCE}/libs/exception/test/errinfos_test.cpp RUN ${BOOST_SOURCE}/libs/exception/test/exception_ptr_test.cpp ) + +target_compile_definitions(Boost_exception_test_2-throw_exception_no_exceptions_test PUBLIC BOOST_NO_EXCEPTIONS) +target_compile_definitions(Boost_exception_test_4-throw_exception_no_both_test PUBLIC BOOST_NO_EXCEPTIONS) \ No newline at end of file diff --git a/libs/fiber.cmake b/libs/fiber.cmake index 17435041a..bafb69a42 100644 --- a/libs/fiber.cmake +++ b/libs/fiber.cmake @@ -1,7 +1,6 @@ _add_boost_lib( NAME fiber SOURCES - ${BOOST_SOURCE}/libs/fiber/src/ ${BOOST_SOURCE}/libs/fiber/src/algo/algorithm.cpp ${BOOST_SOURCE}/libs/fiber/src/algo/round_robin.cpp ${BOOST_SOURCE}/libs/fiber/src/algo/shared_work.cpp @@ -17,6 +16,7 @@ _add_boost_lib( ${BOOST_SOURCE}/libs/fiber/src/recursive_timed_mutex.cpp ${BOOST_SOURCE}/libs/fiber/src/timed_mutex.cpp ${BOOST_SOURCE}/libs/fiber/src/scheduler.cpp + ${BOOST_SOURCE}/libs/fiber/src/waker.cpp DEFINE_PRIVATE BOOST_FIBERS_SOURCE=1 LINK diff --git a/libs/filesystem.cmake b/libs/filesystem.cmake index 21014db97..29d75eec7 100644 --- a/libs/filesystem.cmake +++ b/libs/filesystem.cmake @@ -2,6 +2,8 @@ _add_boost_lib( NAME filesystem SOURCES ${BOOST_SOURCE}/libs/filesystem/src/codecvt_error_category.cpp + ${BOOST_SOURCE}/libs/filesystem/src/directory.cpp + ${BOOST_SOURCE}/libs/filesystem/src/exception.cpp ${BOOST_SOURCE}/libs/filesystem/src/operations.cpp ${BOOST_SOURCE}/libs/filesystem/src/path.cpp ${BOOST_SOURCE}/libs/filesystem/src/path_traits.cpp @@ -13,6 +15,10 @@ _add_boost_lib( BOOST_FILESYSTEM_STATIC_LINK=1 ) +set_target_properties(Boost_filesystem PROPERTIES + CXX_STANDARD 20 + CXX_STANDARD_REQUIRED ON) + _add_boost_test( NAME filesystem_test LINK diff --git a/libs/locale.cmake b/libs/locale.cmake index c7bf5a5c3..6fc0d73a9 100644 --- a/libs/locale.cmake +++ b/libs/locale.cmake @@ -157,7 +157,8 @@ _add_boost_test( # icu RUN ${BOOST_SOURCE}/libs/locale/test/test_collate.cpp RUN ${BOOST_SOURCE}/libs/locale/test/test_convert.cpp - RUN ${BOOST_SOURCE}/libs/locale/test/test_boundary.cpp + # TODO fails on Linux x86_64 +# RUN ${BOOST_SOURCE}/libs/locale/test/test_boundary.cpp # RUN ${BOOST_SOURCE}/libs/locale/test/test_formatting.cpp RUN ${BOOST_SOURCE}/libs/locale/test/test_icu_vs_os_timezone.cpp diff --git a/libs/random.cmake b/libs/random.cmake index afc82a671..2f0f01f0a 100644 --- a/libs/random.cmake +++ b/libs/random.cmake @@ -11,8 +11,9 @@ _add_boost_test( Boost::unit_test_framework TESTS RUN ${BOOST_SOURCE}/libs/random/test/histogram.cpp - RUN ${BOOST_SOURCE}/libs/random/test/multiprecision_float_test.cpp - RUN ${BOOST_SOURCE}/libs/random/test/multiprecision_int_test.cpp +# TODO Fails to compile. Cannot find boost::mpl::list correctly +# RUN ${BOOST_SOURCE}/libs/random/test/multiprecision_float_test.cpp +# RUN ${BOOST_SOURCE}/libs/random/test/multiprecision_int_test.cpp # RUN ${BOOST_SOURCE}/libs/random/test/statistic_tests.cpp RUN ${BOOST_SOURCE}/libs/random/test/test_bernoulli.cpp RUN ${BOOST_SOURCE}/libs/random/test/test_bernoulli_distribution.cpp diff --git a/libs/regex.cmake b/libs/regex.cmake index c4801296c..b568bc1f2 100644 --- a/libs/regex.cmake +++ b/libs/regex.cmake @@ -1,21 +1,9 @@ _add_boost_lib( NAME regex SOURCES - ${BOOST_SOURCE}/libs/regex/src/c_regex_traits.cpp - ${BOOST_SOURCE}/libs/regex/src/cpp_regex_traits.cpp - ${BOOST_SOURCE}/libs/regex/src/cregex.cpp - ${BOOST_SOURCE}/libs/regex/src/fileiter.cpp - ${BOOST_SOURCE}/libs/regex/src/icu.cpp - ${BOOST_SOURCE}/libs/regex/src/instances.cpp ${BOOST_SOURCE}/libs/regex/src/posix_api.cpp ${BOOST_SOURCE}/libs/regex/src/regex.cpp ${BOOST_SOURCE}/libs/regex/src/regex_debug.cpp - ${BOOST_SOURCE}/libs/regex/src/regex_raw_buffer.cpp - ${BOOST_SOURCE}/libs/regex/src/regex_traits_defaults.cpp ${BOOST_SOURCE}/libs/regex/src/static_mutex.cpp - ${BOOST_SOURCE}/libs/regex/src/w32_regex_traits.cpp - ${BOOST_SOURCE}/libs/regex/src/wc_regex_traits.cpp ${BOOST_SOURCE}/libs/regex/src/wide_posix_api.cpp - ${BOOST_SOURCE}/libs/regex/src/winstances.cpp - ${BOOST_SOURCE}/libs/regex/src/usinstances.cpp ) From 06a091632e3dcecaeb0afddb3e9d84845704a52a Mon Sep 17 00:00:00 2001 From: ITesserakt Date: Mon, 1 Nov 2021 01:08:04 +0300 Subject: [PATCH 04/24] Add compile definitions only on test builds --- libs/exception.cmake | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libs/exception.cmake b/libs/exception.cmake index c93fe557b..9da386725 100644 --- a/libs/exception.cmake +++ b/libs/exception.cmake @@ -39,5 +39,7 @@ _add_boost_test( RUN ${BOOST_SOURCE}/libs/exception/test/exception_ptr_test.cpp ) -target_compile_definitions(Boost_exception_test_2-throw_exception_no_exceptions_test PUBLIC BOOST_NO_EXCEPTIONS) -target_compile_definitions(Boost_exception_test_4-throw_exception_no_both_test PUBLIC BOOST_NO_EXCEPTIONS) \ No newline at end of file +if (BOOST_STANDALONE AND NOT BOOST_DISABLE_TESTS) + target_compile_definitions(Boost_exception_test_2-throw_exception_no_exceptions_test PUBLIC BOOST_NO_EXCEPTIONS) + target_compile_definitions(Boost_exception_test_4-throw_exception_no_both_test PUBLIC BOOST_NO_EXCEPTIONS) +endif() \ No newline at end of file From bada2084d7056ef3681f31e64725cb297789845a Mon Sep 17 00:00:00 2001 From: Kevin Thierauf Date: Sat, 25 Dec 2021 03:59:11 -0500 Subject: [PATCH 05/24] Updated download URL/hash for 1.78 --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 40fb3ec06..95e31d958 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,8 +3,8 @@ project(Boost-CMake) option(BOOST_DISABLE_TESTS "Do not build test targets, even if building standalone" OFF) -set(BOOST_URL "https://boostorg.jfrog.io/artifactory/main/release/1.77.0/source/boost_1_77_0.tar.bz2" CACHE STRING "Boost download URL") -set(BOOST_URL_SHA256 "fc9f85fc030e233142908241af7a846e60630aa7388de9a5fafb1f3a26840854" CACHE STRING "Boost download URL SHA256 checksum") +set(BOOST_URL "https://boostorg.jfrog.io/artifactory/main/release/1.78.0/source/boost_1_78_0.7z" CACHE STRING "Boost download URL") +set(BOOST_URL_SHA256 "090cefea470bca990fa3f3ed793d865389426915b37a2a3258524a7258f0790c" CACHE STRING "Boost download URL SHA256 checksum") include(FetchContent) FetchContent_Declare( From c0b1432b92a178317bc1507b421e4a3a14333f7c Mon Sep 17 00:00:00 2001 From: Kevin Thierauf Date: Sun, 2 Jan 2022 13:25:31 -0500 Subject: [PATCH 06/24] Fixed Boost.filesystem compilation error for C++17 or earlier --- libs/filesystem.cmake | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/libs/filesystem.cmake b/libs/filesystem.cmake index 29d75eec7..d023c7288 100644 --- a/libs/filesystem.cmake +++ b/libs/filesystem.cmake @@ -15,9 +15,11 @@ _add_boost_lib( BOOST_FILESYSTEM_STATIC_LINK=1 ) -set_target_properties(Boost_filesystem PROPERTIES - CXX_STANDARD 20 - CXX_STANDARD_REQUIRED ON) +set_target_properties(Boost_filesystem PROPERTIES CXX_STANDARD_REQUIRED ON) +get_target_property(filesystemStandardVersion Boost_filesystem CXX_STANDARD) +if(${filesystemStandardVersion} LESS 20) + target_compile_definitions(Boost_filesystem PUBLIC BOOST_FILESYSTEM_NO_CXX20_ATOMIC_REF) +endif() _add_boost_test( NAME filesystem_test From 8cb2ca909a33acdeae3c2fa136d9f4a6a4319f41 Mon Sep 17 00:00:00 2001 From: Kevin Thierauf Date: Mon, 3 Jan 2022 00:14:58 -0500 Subject: [PATCH 07/24] ResourceCompiler work + other --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 95e31d958..40fb3ec06 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,8 +3,8 @@ project(Boost-CMake) option(BOOST_DISABLE_TESTS "Do not build test targets, even if building standalone" OFF) -set(BOOST_URL "https://boostorg.jfrog.io/artifactory/main/release/1.78.0/source/boost_1_78_0.7z" CACHE STRING "Boost download URL") -set(BOOST_URL_SHA256 "090cefea470bca990fa3f3ed793d865389426915b37a2a3258524a7258f0790c" CACHE STRING "Boost download URL SHA256 checksum") +set(BOOST_URL "https://boostorg.jfrog.io/artifactory/main/release/1.77.0/source/boost_1_77_0.tar.bz2" CACHE STRING "Boost download URL") +set(BOOST_URL_SHA256 "fc9f85fc030e233142908241af7a846e60630aa7388de9a5fafb1f3a26840854" CACHE STRING "Boost download URL SHA256 checksum") include(FetchContent) FetchContent_Declare( From 6635022af1d116a35acd251b5f2c31f321333bde Mon Sep 17 00:00:00 2001 From: Kevin Thierauf Date: Mon, 3 Jan 2022 00:19:59 -0500 Subject: [PATCH 08/24] Revert "ResourceCompiler work + other" This reverts commit 8cb2ca909a33acdeae3c2fa136d9f4a6a4319f41. --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 40fb3ec06..95e31d958 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,8 +3,8 @@ project(Boost-CMake) option(BOOST_DISABLE_TESTS "Do not build test targets, even if building standalone" OFF) -set(BOOST_URL "https://boostorg.jfrog.io/artifactory/main/release/1.77.0/source/boost_1_77_0.tar.bz2" CACHE STRING "Boost download URL") -set(BOOST_URL_SHA256 "fc9f85fc030e233142908241af7a846e60630aa7388de9a5fafb1f3a26840854" CACHE STRING "Boost download URL SHA256 checksum") +set(BOOST_URL "https://boostorg.jfrog.io/artifactory/main/release/1.78.0/source/boost_1_78_0.7z" CACHE STRING "Boost download URL") +set(BOOST_URL_SHA256 "090cefea470bca990fa3f3ed793d865389426915b37a2a3258524a7258f0790c" CACHE STRING "Boost download URL SHA256 checksum") include(FetchContent) FetchContent_Declare( From e332360c9596f7be11fe86bfbe86a543cb888c81 Mon Sep 17 00:00:00 2001 From: ClausKlein Date: Fri, 27 May 2022 23:15:21 +0200 Subject: [PATCH 09/24] Upgrade to boost v1.79.0 --- CMakeLists.txt | 20 +++++++++++++------- cmake/Modules/AddBoostLib.cmake | 4 ++-- cmake/Modules/CheckBoostVersion.cmake | 5 +++++ cmake/Modules/StandaloneBuild.cmake | 4 +++- 4 files changed, 23 insertions(+), 10 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 95e31d958..25eb1c554 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,10 +1,15 @@ -cmake_minimum_required(VERSION 3.12) -project(Boost-CMake) +cmake_minimum_required(VERSION 3.16...3.23) -option(BOOST_DISABLE_TESTS "Do not build test targets, even if building standalone" OFF) +project(Boost-CMake LANGUAGES CXX VERSION 1.79.0) -set(BOOST_URL "https://boostorg.jfrog.io/artifactory/main/release/1.78.0/source/boost_1_78_0.7z" CACHE STRING "Boost download URL") -set(BOOST_URL_SHA256 "090cefea470bca990fa3f3ed793d865389426915b37a2a3258524a7258f0790c" CACHE STRING "Boost download URL SHA256 checksum") +option(BOOST_DISABLE_TESTS "Do not build test targets, even if building standalone" ON) + +if(EXISTS "$ENV{HOME}/.cache/CPM/boost_1_79_0") + set(FETCHCONTENT_SOURCE_DIR_BOOST CACHE PATH "Boost source DIR") +endif() + +set(BOOST_URL "https://boostorg.jfrog.io/artifactory/main/release/1.79.0/source/boost_1_79_0.tar.bz2" CACHE STRING "Boost download URL") +set(BOOST_URL_SHA256 "475d589d51a7f8b3ba2ba4eda022b170e562ca3b760ee922c146b6c65856ef39" CACHE STRING "Boost download URL SHA256 checksum") include(FetchContent) FetchContent_Declare( @@ -12,8 +17,8 @@ FetchContent_Declare( URL ${BOOST_URL} URL_HASH SHA256=${BOOST_URL_SHA256} ) -FetchContent_GetProperties(Boost) +FetchContent_GetProperties(Boost) if(NOT Boost_POPULATED) message(STATUS "Fetching Boost") FetchContent_Populate(Boost) @@ -91,8 +96,9 @@ if(NOT BOOST_STANDALONE) # Compilation options required by all platforms target_compile_definitions(Boost::boost INTERFACE $<$:BOOST_DISABLE_ASSERT> + BOOST_ASIO_NO_DEPRECATED BOOST_SYSTEM_NO_DEPRECATED - BOOST_THREAD_VERSION=4 + BOOST_THREAD_VERSION=5 BOOST_THREAD_USES_CHRONO BOOST_THREAD_PROVIDES_EXECUTORS ) diff --git a/cmake/Modules/AddBoostLib.cmake b/cmake/Modules/AddBoostLib.cmake index 89e220f80..ceb03d505 100644 --- a/cmake/Modules/AddBoostLib.cmake +++ b/cmake/Modules/AddBoostLib.cmake @@ -2,8 +2,8 @@ function(_add_boost_lib) set(options ) set(oneValueArgs NAME) set(multiValueArgs SOURCES LINK DEFINE DEFINE_PRIVATE CXXFLAGS_PRIVATE INCLUDE_PRIVATE) - cmake_parse_arguments(BOOSTLIB "${options}" "${oneValueArgs}" - "${multiValueArgs}" ${ARGN}) + cmake_parse_arguments(BOOSTLIB "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) + add_library(Boost_${BOOSTLIB_NAME} STATIC ${BOOSTLIB_SOURCES}) add_library(Boost::${BOOSTLIB_NAME} ALIAS Boost_${BOOSTLIB_NAME}) set_target_properties(Boost_${BOOSTLIB_NAME} PROPERTIES diff --git a/cmake/Modules/CheckBoostVersion.cmake b/cmake/Modules/CheckBoostVersion.cmake index e9fceb383..b28041d4d 100644 --- a/cmake/Modules/CheckBoostVersion.cmake +++ b/cmake/Modules/CheckBoostVersion.cmake @@ -1,4 +1,9 @@ # Detect Boost version + +if(NOT EXISTS "${BOOST_SOURCE}/boost/version.hpp") + message(FATAL_ERROR "missing ${BOOST_SOURCE}/boost/version.hpp") +endif() + file(STRINGS "${BOOST_SOURCE}/boost/version.hpp" boost_version_raw REGEX "define BOOST_VERSION " ) diff --git a/cmake/Modules/StandaloneBuild.cmake b/cmake/Modules/StandaloneBuild.cmake index 22083ce00..d8f78fb2d 100644 --- a/cmake/Modules/StandaloneBuild.cmake +++ b/cmake/Modules/StandaloneBuild.cmake @@ -1,7 +1,9 @@ if(CMAKE_CURRENT_SOURCE_DIR STREQUAL "${CMAKE_SOURCE_DIR}") message(STATUS "Standalone mode detected") set(BOOST_STANDALONE ON) - set(CMAKE_CXX_STANDARD 11) + if(NOT DEFINED CMAKE_CXX_STANDARD) + set(CMAKE_CXX_STANDARD 17) + endif() set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_EXTENSIONS OFF) enable_testing() From 0fbb328a2e975862e338004f804e37266e2f257d Mon Sep 17 00:00:00 2001 From: ClausKlein Date: Fri, 27 May 2022 23:32:26 +0200 Subject: [PATCH 10/24] use ubuntu-latest on CI --- azure-pipelines.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 2e9835fc7..90ae3e7d6 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -6,27 +6,27 @@ strategy: matrix: Linux-GCC: - imageName: 'ubuntu-16.04' + imageName: 'ubuntu-latest' BUILD_TARGET: 'Linux' BUILD_COMPILER: 'GCC' Linux-Clang: - imageName: 'ubuntu-16.04' + imageName: 'ubuntu-latest' BUILD_TARGET: 'Linux' BUILD_COMPILER: 'Clang' Android-arm64: - imageName: 'ubuntu-16.04' + imageName: 'ubuntu-latest' BUILD_TARGET: 'Android' BUILD_ARCH: 'arm64-v8a' Android-arm: - imageName: 'ubuntu-16.04' + imageName: 'ubuntu-latest' BUILD_TARGET: 'Android' BUILD_ARCH: 'armeabi-v7a' Android-x86: - imageName: 'ubuntu-16.04' + imageName: 'ubuntu-latest' BUILD_TARGET: 'Android' BUILD_ARCH: 'x86' Android-x86_64: - imageName: 'ubuntu-16.04' + imageName: 'ubuntu-latest' BUILD_TARGET: 'Android' BUILD_ARCH: 'x86_64' macOS: From 908b954d5e6865e415e43cee6d8965dde1e3c523 Mon Sep 17 00:00:00 2001 From: ClausKlein Date: Fri, 27 May 2022 23:42:58 +0200 Subject: [PATCH 11/24] use gcc-11 and clang-12 on linux CI --- build.sh | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/build.sh b/build.sh index c2fa0f0e3..c2279e444 100644 --- a/build.sh +++ b/build.sh @@ -27,18 +27,17 @@ build_before_install() { } build_install() { - # Ubuntu Linux + GCC 4.8 + # Ubuntu Linux + GCC if [[ "$AGENT_OS" == "Linux" ]]; then sudo apt-get install \ build-essential \ - g++-5 \ - clang-6.0 \ + g++-11 \ + clang-12.0 \ aria2 \ ninja-build \ ccache - download_extract "https://github.com/Kitware/CMake/releases/download/v3.13.2/cmake-3.13.2-Linux-x86_64.tar.gz" cmake-3.13.2-Linux-x86_64.tar.gz - export PATH=$(pwd)/cmake-3.13.2-Linux-x86_64/bin:$PATH + pip install cmake ninja elif [[ "$AGENT_OS" == "Darwin" ]]; then brew_install ccache brew_install cmake @@ -61,11 +60,11 @@ build_script() { if [[ "$BUILD_TARGET" == "Linux" ]]; then if [[ "$BUILD_COMPILER" == "GCC" ]]; then - CC=gcc-5 - CXX=g++-5 + CC=gcc-11 + CXX=g++-11 else - CC=clang-6.0 - CXX=clang++-6.0 + CC=clang-12.0 + CXX=clang++-12.0 fi cmake .. -GNinja \ -DCMAKE_C_COMPILER=$CC \ From 0b667127950539e53908867bac614dcdcf7d6293 Mon Sep 17 00:00:00 2001 From: ClausKlein Date: Fri, 27 May 2022 23:48:02 +0200 Subject: [PATCH 12/24] use default gcc and clang on linux CI --- build.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/build.sh b/build.sh index c2279e444..4ee028b1d 100644 --- a/build.sh +++ b/build.sh @@ -31,8 +31,8 @@ build_install() { if [[ "$AGENT_OS" == "Linux" ]]; then sudo apt-get install \ build-essential \ - g++-11 \ - clang-12.0 \ + g++ \ + clang \ aria2 \ ninja-build \ ccache @@ -60,11 +60,11 @@ build_script() { if [[ "$BUILD_TARGET" == "Linux" ]]; then if [[ "$BUILD_COMPILER" == "GCC" ]]; then - CC=gcc-11 - CXX=g++-11 + CC=gcc + CXX=g++ else - CC=clang-12.0 - CXX=clang++-12.0 + CC=clang + CXX=clang fi cmake .. -GNinja \ -DCMAKE_C_COMPILER=$CC \ From 8c659ab53f26264017f04d3ae1704e4d1ea1c8c2 Mon Sep 17 00:00:00 2001 From: ClausKlein Date: Sat, 28 May 2022 06:30:47 +0200 Subject: [PATCH 13/24] enable tests again --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 25eb1c554..ed1ee1a72 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,10 +2,10 @@ cmake_minimum_required(VERSION 3.16...3.23) project(Boost-CMake LANGUAGES CXX VERSION 1.79.0) -option(BOOST_DISABLE_TESTS "Do not build test targets, even if building standalone" ON) +option(BOOST_DISABLE_TESTS "Do not build test targets, even if building standalone" OFF) if(EXISTS "$ENV{HOME}/.cache/CPM/boost_1_79_0") - set(FETCHCONTENT_SOURCE_DIR_BOOST CACHE PATH "Boost source DIR") + set(FETCHCONTENT_SOURCE_DIR_BOOST "$ENV{HOME}/.cache/CPM/boost_1_79_0" CACHE PATH "Boost source DIR") endif() set(BOOST_URL "https://boostorg.jfrog.io/artifactory/main/release/1.79.0/source/boost_1_79_0.tar.bz2" CACHE STRING "Boost download URL") From bac969047eb0554ae98db0f635f73d3f0c4bd22f Mon Sep 17 00:00:00 2001 From: ClausKlein Date: Sat, 28 May 2022 10:03:36 +0200 Subject: [PATCH 14/24] Boost_container contains c files --- CMakeLists.txt | 2 +- libs/container.cmake | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ed1ee1a72..45a6578f4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.16...3.23) -project(Boost-CMake LANGUAGES CXX VERSION 1.79.0) +project(Boost-CMake LANGUAGES C CXX VERSION 1.79.0) option(BOOST_DISABLE_TESTS "Do not build test targets, even if building standalone" OFF) diff --git a/libs/container.cmake b/libs/container.cmake index 4c9b89523..69a117ec5 100644 --- a/libs/container.cmake +++ b/libs/container.cmake @@ -21,7 +21,7 @@ _add_boost_test( RUN ${BOOST_SOURCE}/libs/container/test/alloc_basic_test.cpp RUN ${BOOST_SOURCE}/libs/container/test/alloc_full_test.cpp RUN ${BOOST_SOURCE}/libs/container/test/allocator_traits_test.cpp - #RUN ${BOOST_SOURCE}/libs/container/test/deque_test.cpp + RUN ${BOOST_SOURCE}/libs/container/test/deque_test.cpp RUN ${BOOST_SOURCE}/libs/container/test/explicit_inst_deque_test.cpp RUN ${BOOST_SOURCE}/libs/container/test/explicit_inst_flat_map_test.cpp RUN ${BOOST_SOURCE}/libs/container/test/explicit_inst_flat_set_test.cpp @@ -62,13 +62,13 @@ _add_boost_test( RUN ${BOOST_SOURCE}/libs/container/test/scoped_allocator_usage_test.cpp RUN ${BOOST_SOURCE}/libs/container/test/set_test.cpp RUN ${BOOST_SOURCE}/libs/container/test/slist_test.cpp - #RUN ${BOOST_SOURCE}/libs/container/test/small_vector_test.cpp - #RUN ${BOOST_SOURCE}/libs/container/test/stable_vector_test.cpp + RUN ${BOOST_SOURCE}/libs/container/test/small_vector_test.cpp + RUN ${BOOST_SOURCE}/libs/container/test/stable_vector_test.cpp RUN ${BOOST_SOURCE}/libs/container/test/static_vector_test.cpp RUN ${BOOST_SOURCE}/libs/container/test/string_test.cpp RUN ${BOOST_SOURCE}/libs/container/test/synchronized_pool_resource_test.cpp RUN ${BOOST_SOURCE}/libs/container/test/throw_exception_test.cpp RUN ${BOOST_SOURCE}/libs/container/test/unsynchronized_pool_resource_test.cpp RUN ${BOOST_SOURCE}/libs/container/test/uses_allocator_test.cpp - #RUN ${BOOST_SOURCE}/libs/container/test/vector_test.cpp + RUN ${BOOST_SOURCE}/libs/container/test/vector_test.cpp ) From d035ea47c4feb8443618d8549943a40bb0c7ed02 Mon Sep 17 00:00:00 2001 From: ClausKlein Date: Sun, 29 May 2022 16:37:33 +0200 Subject: [PATCH 15/24] build only 64bit on CI --- azure-pipelines.yml | 14 +++----------- build.sh | 3 ++- cmake/Modules/StandaloneBuild.cmake | 7 ++++--- libs/header.cmake | 5 ++++- libs/log.cmake | 2 +- 5 files changed, 14 insertions(+), 17 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 90ae3e7d6..84ddef63c 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -17,14 +17,6 @@ strategy: imageName: 'ubuntu-latest' BUILD_TARGET: 'Android' BUILD_ARCH: 'arm64-v8a' - Android-arm: - imageName: 'ubuntu-latest' - BUILD_TARGET: 'Android' - BUILD_ARCH: 'armeabi-v7a' - Android-x86: - imageName: 'ubuntu-latest' - BUILD_TARGET: 'Android' - BUILD_ARCH: 'x86' Android-x86_64: imageName: 'ubuntu-latest' BUILD_TARGET: 'Android' @@ -39,10 +31,10 @@ strategy: imageName: 'vs2017-win2016' BUILD_TARGET: 'Windows' BUILD_TOOLCHAIN: 'amd64' - Windows-v141-x86: - imageName: 'vs2017-win2016' + Windows-v161-amd64: + imageName: 'windows-latest' BUILD_TARGET: 'Windows' - BUILD_TOOLCHAIN: 'amd64_x86' + BUILD_TOOLCHAIN: 'amd64' trigger: - master diff --git a/build.sh b/build.sh index 4ee028b1d..12010b015 100644 --- a/build.sh +++ b/build.sh @@ -1,6 +1,7 @@ #/usr/bin/env bash -NDK_VER=android-ndk-r18b +# Latest LTS Version (r23c) +NDK_VER=android-ndk-r23c download_extract() { aria2c -x 16 $1 -o $2 diff --git a/cmake/Modules/StandaloneBuild.cmake b/cmake/Modules/StandaloneBuild.cmake index d8f78fb2d..de048325f 100644 --- a/cmake/Modules/StandaloneBuild.cmake +++ b/cmake/Modules/StandaloneBuild.cmake @@ -1,9 +1,10 @@ +if(NOT DEFINED CMAKE_CXX_STANDARD) + set(CMAKE_CXX_STANDARD 17) +endif() + if(CMAKE_CURRENT_SOURCE_DIR STREQUAL "${CMAKE_SOURCE_DIR}") message(STATUS "Standalone mode detected") set(BOOST_STANDALONE ON) - if(NOT DEFINED CMAKE_CXX_STANDARD) - set(CMAKE_CXX_STANDARD 17) - endif() set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_EXTENSIONS OFF) enable_testing() diff --git a/libs/header.cmake b/libs/header.cmake index dd336546b..d150c24e7 100644 --- a/libs/header.cmake +++ b/libs/header.cmake @@ -1,6 +1,9 @@ -# Define the header-only Boost target +# Define the header-only Boost targets add_library(Boost::boost INTERFACE IMPORTED GLOBAL) +add_library(Boost::headers ALIAS Boost::boost) + target_include_directories(Boost::boost SYSTEM INTERFACE ${BOOST_SOURCE}) +target_compile_features(Boost::boost INTERFACE cxx_std_${CMAKE_CXX_STANDARD}) # Disable autolink target_compile_definitions(Boost::boost INTERFACE BOOST_ALL_NO_LIB=1) diff --git a/libs/log.cmake b/libs/log.cmake index bdbe709db..bf14a7ab9 100644 --- a/libs/log.cmake +++ b/libs/log.cmake @@ -39,7 +39,7 @@ _add_boost_lib( DEFINE_PRIVATE _STDC_CONSTANT_MACROS BOOST_SPIRIT_USE_PHOENIX_V3=1 - BOOST_THREAD_DONT_USE_CHRONO=1 + BOOST_THREAD_DONT_USE_CHRONO=1 BOOST_LOG_BUILDING_THE_LIB=1 $<$: NOMINMAX From 2a59565f56dee64f96c89f5681021dca41fe8726 Mon Sep 17 00:00:00 2001 From: ClausKlein Date: Sun, 29 May 2022 18:10:49 +0200 Subject: [PATCH 16/24] fix NKD download link --- .cmake-format.yaml | 38 +++++++++++++++++++++++++++++++++ azure-pipelines.yml | 6 +++--- build.sh | 8 +++---- cmake/Modules/AddBoostLib.cmake | 2 +- 4 files changed, 46 insertions(+), 8 deletions(-) create mode 100644 .cmake-format.yaml diff --git a/.cmake-format.yaml b/.cmake-format.yaml new file mode 100644 index 000000000..98348d41e --- /dev/null +++ b/.cmake-format.yaml @@ -0,0 +1,38 @@ +parse: + additional_commands: + _add_boost_lib: + # flags: + kwargs: + NAME: '1' + CXXFLAGS_PRIVATE: '*' + DEFINE: '*' + DEFINE_PRIVATE: '*' + INCLUDE_PRIVATE: '*' + LINK: '*' + SOURCES: '*' + _add_boost_test: + # flags: + kwargs: + NAME: '1' + RUN: '1' + DEFINE: '*' + LINK: '*' + TESTS: '*' + +format: + dangle_parens: true + line_ending: unix + line_width: 123 + max_lines_hwrap: 3 + max_pargs_hwrap: 4 + max_rows_cmdline: 8 + max_subgroups_hwrap: 4 + min_prefix_chars: 8 + separate_ctrl_name_with_space: false + separate_fn_name_with_space: false + tab_size: 2 + +markup: + bullet_char: "*" + enum_char: . + enable_markup: false diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 84ddef63c..4415c9190 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -27,11 +27,11 @@ strategy: iOS: imageName: 'macos-latest' BUILD_TARGET: 'iOS' - Windows-v141-amd64: - imageName: 'vs2017-win2016' + Windows-2019-amd64: + imageName: 'windows-2019' BUILD_TARGET: 'Windows' BUILD_TOOLCHAIN: 'amd64' - Windows-v161-amd64: + Windows-latest-amd64: imageName: 'windows-latest' BUILD_TARGET: 'Windows' BUILD_TOOLCHAIN: 'amd64' diff --git a/build.sh b/build.sh index 12010b015..ac9345775 100644 --- a/build.sh +++ b/build.sh @@ -33,7 +33,7 @@ build_install() { sudo apt-get install \ build-essential \ g++ \ - clang \ + clang-12 \ aria2 \ ninja-build \ ccache @@ -50,7 +50,7 @@ build_install() { # Android NDK if [[ "$BUILD_TARGET" == "Android" ]]; then - download_extract_zip http://dl.google.com/android/repository/${NDK_VER}-linux-x86_64.zip ${NDK_VER}-linux-x86_64.zip + download_extract_zip http://dl.google.com/android/repository/${NDK_VER}-linux.zip ${NDK_VER}-linux.zip export ANDROID_NDK=$(pwd)/${NDK_VER} fi } @@ -64,8 +64,8 @@ build_script() { CC=gcc CXX=g++ else - CC=clang - CXX=clang + CC=clang-12 + CXX=clang++-12 fi cmake .. -GNinja \ -DCMAKE_C_COMPILER=$CC \ diff --git a/cmake/Modules/AddBoostLib.cmake b/cmake/Modules/AddBoostLib.cmake index ceb03d505..e88413765 100644 --- a/cmake/Modules/AddBoostLib.cmake +++ b/cmake/Modules/AddBoostLib.cmake @@ -1,5 +1,5 @@ function(_add_boost_lib) - set(options ) + set(options) set(oneValueArgs NAME) set(multiValueArgs SOURCES LINK DEFINE DEFINE_PRIVATE CXXFLAGS_PRIVATE INCLUDE_PRIVATE) cmake_parse_arguments(BOOSTLIB "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) From cd4557111e41665ee9ce6b545f36e0ad7e162ea0 Mon Sep 17 00:00:00 2001 From: ClausKlein Date: Sun, 29 May 2022 19:59:36 +0200 Subject: [PATCH 17/24] prevent bcopy macro conflict on android builds TODO: disable again for now! --- README.md | 2 +- libs/container.cmake | 13 +++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 37cf8e1d7..3bf27c88e 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ target_link_libraries(lib_using_header_only PUBLIC Boost::boost) ## Configuration -Boost will automatically be downloaded from GitHub as a minified archive created with the `repack.sh` script. +Boost will automatically be downloaded from https://boostorg.jfrog.io/artifactory ! If that is not acceptable to you, you can use an alternate Boost version, apply custom patches or just mirror the current archive in your internal network like so: ``` diff --git a/libs/container.cmake b/libs/container.cmake index 69a117ec5..49a748333 100644 --- a/libs/container.cmake +++ b/libs/container.cmake @@ -21,7 +21,7 @@ _add_boost_test( RUN ${BOOST_SOURCE}/libs/container/test/alloc_basic_test.cpp RUN ${BOOST_SOURCE}/libs/container/test/alloc_full_test.cpp RUN ${BOOST_SOURCE}/libs/container/test/allocator_traits_test.cpp - RUN ${BOOST_SOURCE}/libs/container/test/deque_test.cpp + #RUN ${BOOST_SOURCE}/libs/container/test/deque_test.cpp RUN ${BOOST_SOURCE}/libs/container/test/explicit_inst_deque_test.cpp RUN ${BOOST_SOURCE}/libs/container/test/explicit_inst_flat_map_test.cpp RUN ${BOOST_SOURCE}/libs/container/test/explicit_inst_flat_set_test.cpp @@ -62,13 +62,18 @@ _add_boost_test( RUN ${BOOST_SOURCE}/libs/container/test/scoped_allocator_usage_test.cpp RUN ${BOOST_SOURCE}/libs/container/test/set_test.cpp RUN ${BOOST_SOURCE}/libs/container/test/slist_test.cpp - RUN ${BOOST_SOURCE}/libs/container/test/small_vector_test.cpp - RUN ${BOOST_SOURCE}/libs/container/test/stable_vector_test.cpp + #RUN ${BOOST_SOURCE}/libs/container/test/small_vector_test.cpp + #RUN ${BOOST_SOURCE}/libs/container/test/stable_vector_test.cpp RUN ${BOOST_SOURCE}/libs/container/test/static_vector_test.cpp RUN ${BOOST_SOURCE}/libs/container/test/string_test.cpp RUN ${BOOST_SOURCE}/libs/container/test/synchronized_pool_resource_test.cpp RUN ${BOOST_SOURCE}/libs/container/test/throw_exception_test.cpp RUN ${BOOST_SOURCE}/libs/container/test/unsynchronized_pool_resource_test.cpp RUN ${BOOST_SOURCE}/libs/container/test/uses_allocator_test.cpp - RUN ${BOOST_SOURCE}/libs/container/test/vector_test.cpp + #RUN ${BOOST_SOURCE}/libs/container/test/vector_test.cpp + #TODO: rename bcopy with bcopy1 at vector_test.hpp line 235! CK + # ./vector_test.cpp:#include "vector_test.hpp" + # ./stable_vector_test.cpp:#include "vector_test.hpp" + # ./small_vector_test.cpp:#include "vector_test.hpp" + # ./deque_test.cpp:#include "vector_test.hpp" ) From bb1921cad54f9e4047be74f9db425bbaaa99fa36 Mon Sep 17 00:00:00 2001 From: ClausKlein Date: Mon, 30 May 2022 07:54:18 +0200 Subject: [PATCH 18/24] rm old patch files rm repack.sh too --- patch/1.63.0/context_0001_arm64_cpu.patch | 47 ------------------- ...context_0002_macOS_execution_context.patch | 23 --------- repack.sh | 44 ----------------- 3 files changed, 114 deletions(-) delete mode 100644 patch/1.63.0/context_0001_arm64_cpu.patch delete mode 100644 patch/1.63.0/context_0002_macOS_execution_context.patch delete mode 100755 repack.sh diff --git a/patch/1.63.0/context_0001_arm64_cpu.patch b/patch/1.63.0/context_0001_arm64_cpu.patch deleted file mode 100644 index 977eba4eb..000000000 --- a/patch/1.63.0/context_0001_arm64_cpu.patch +++ /dev/null @@ -1,47 +0,0 @@ -From 26b61a67cf1d384796e5ae2f207c5b6fa56015e5 Mon Sep 17 00:00:00 2001 -From: Oliver Kowalke -Date: Thu, 5 Jan 2017 10:38:47 -0800 -Subject: [PATCH] remove directive '.cpu' for ARM64/AAPCS/ELF - ---- - src/asm/jump_arm64_aapcs_elf_gas.S | 1 - - src/asm/make_arm64_aapcs_elf_gas.S | 1 - - src/asm/ontop_arm64_aapcs_elf_gas.S | 1 - - 3 files changed, 3 deletions(-) - -diff --git a/libs/context/src/asm/jump_arm64_aapcs_elf_gas.S b/libs/context/src/asm/jump_arm64_aapcs_elf_gas.S -index 7c0c2fa..1b8ce9e 100644 ---- a/libs/context/src/asm/jump_arm64_aapcs_elf_gas.S -+++ b/libs/context/src/asm/jump_arm64_aapcs_elf_gas.S -@@ -51,7 +51,6 @@ - * * - *******************************************************/ - --.cpu generic+fp+simd - .text - .align 2 - .global jump_fcontext -diff --git a/libs/context/src/asm/make_arm64_aapcs_elf_gas.S b/libs/context/src/asm/make_arm64_aapcs_elf_gas.S -index e71a91c..c1fa843 100644 ---- a/libs/context/src/asm/make_arm64_aapcs_elf_gas.S -+++ b/libs/context/src/asm/make_arm64_aapcs_elf_gas.S -@@ -51,7 +51,6 @@ - * * - *******************************************************/ - --.cpu generic+fp+simd - .text - .align 2 - .global make_fcontext -diff --git a/libs/context/src/asm/ontop_arm64_aapcs_elf_gas.S b/libs/context/src/asm/ontop_arm64_aapcs_elf_gas.S -index 7e3b047..02a3b07 100644 ---- a/libs/context/src/asm/ontop_arm64_aapcs_elf_gas.S -+++ b/libs/context/src/asm/ontop_arm64_aapcs_elf_gas.S -@@ -51,7 +51,6 @@ - * * - *******************************************************/ - --.cpu generic+fp+simd - .text - .align 2 - .global ontop_fcontext diff --git a/patch/1.63.0/context_0002_macOS_execution_context.patch b/patch/1.63.0/context_0002_macOS_execution_context.patch deleted file mode 100644 index e3fb42033..000000000 --- a/patch/1.63.0/context_0002_macOS_execution_context.patch +++ /dev/null @@ -1,23 +0,0 @@ -From 3167d4dfb82aa74fcf41c755d6c9bc7a3401bfea Mon Sep 17 00:00:00 2001 -From: Timo Sandmann -Date: Sun, 8 Jan 2017 18:24:20 +0100 -Subject: [PATCH] Fixes #38 - -Use correct type cast and tuple extracting for pointer to transfered data tuples ---- - include/boost/context/execution_context_v2.hpp | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/boost/context/execution_context_v2.hpp b/boost/context/execution_context_v2.hpp -index 33b9bda..bbd4eb1 100644 ---- a/boost/context/execution_context_v2.hpp -+++ b/boost/context/execution_context_v2.hpp -@@ -103,7 +103,7 @@ class record { - - transfer_t run( transfer_t t) { - Ctx from{ t.fctx }; -- typename Ctx::args_tpl_t args = std::move( * static_cast< typename Ctx::args_tpl_t * >( t.data) ); -+ typename Ctx::args_tpl_t args = std::move( std::get<1>( * static_cast< std::tuple< std::exception_ptr, typename Ctx::args_tpl_t > * >( t.data) ) ); - auto tpl = std::tuple_cat( - params_, - std::forward_as_tuple( std::move( from) ), diff --git a/repack.sh b/repack.sh deleted file mode 100755 index adea2069c..000000000 --- a/repack.sh +++ /dev/null @@ -1,44 +0,0 @@ -#!/usr/bin/env bash - -set -e - -BOOST_VERSION=1.67.0 - -function finish { - rm -rf ${tmp_dir} -} -trap finish EXIT - -out_dir=$(pwd) -patch_dir=$(pwd)/patch/${BOOST_VERSION} -tmp_dir=$(mktemp -d) - -echo "Downloading Boost ${BOOST_VERSION}..." -curl -L "https://boostorg.jfrog.io/artifactory/main/release/${BOOST_VERSION}/source/boost_${BOOST_VERSION//\./_}.tar.bz2" > ${tmp_dir}/boost_${BOOST_VERSION}.tar.bz2 - -mkdir -p ${tmp_dir}/extract -cd ${tmp_dir}/extract -echo "Extracting archive..." -tar xf ${tmp_dir}/boost_${BOOST_VERSION}.tar.bz2 - -cd boost_* - -if [ -d "${patch_dir}" ]; then - mkdir patch - for f in ${patch_dir}/*.patch; do - echo "Applying patch ${f}..." - git apply --verbose $f - cp $f patch/ - done -fi - -echo "Removing extra files..." -find . -name "doc" -print0 | xargs -0 -- rm -rf -find . -name "*.htm*" -delete -find . -name "*.png" -delete -find . -name "*.bmp" -delete -find . -name "*.jpg" -delete - -cd .. -echo "Recompressing archive..." -tar cfJ ${out_dir}/boost_${BOOST_VERSION//./_}.tar.xz boost_* From bf868195c0195c22c27c63a05c03b787b2eb19a2 Mon Sep 17 00:00:00 2001 From: Claus Klein Date: Wed, 1 Jun 2022 10:20:48 +0200 Subject: [PATCH 19/24] add boost_json lib --- .cmake-format.yaml | 1 + CMakeLists.txt | 3 ++- cmake/Modules/AddBoostTest.cmake | 9 ++++++--- libs/json.cmake | 29 +++++++++++++++++++++++++++++ 4 files changed, 38 insertions(+), 4 deletions(-) create mode 100644 libs/json.cmake diff --git a/.cmake-format.yaml b/.cmake-format.yaml index 98348d41e..adab885b7 100644 --- a/.cmake-format.yaml +++ b/.cmake-format.yaml @@ -16,6 +16,7 @@ parse: NAME: '1' RUN: '1' DEFINE: '*' + INCLUDE: '*' LINK: '*' TESTS: '*' diff --git a/CMakeLists.txt b/CMakeLists.txt index 45a6578f4..8556e92d7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -60,12 +60,13 @@ set(BOOST_LIBS_OPTIONAL fiber filesystem graph + graph_parallel iostreams + json locale log math mpi - graph_parallel # depends on mpi, so needs to be put after it program_options #python # complex module random diff --git a/cmake/Modules/AddBoostTest.cmake b/cmake/Modules/AddBoostTest.cmake index 62e41e124..c7300265d 100644 --- a/cmake/Modules/AddBoostTest.cmake +++ b/cmake/Modules/AddBoostTest.cmake @@ -5,7 +5,7 @@ function(_add_boost_test) set(options) set(oneValueArgs NAME) - set(multiValueArgs LINK DEFINE TESTS) + set(multiValueArgs LINK DEFINE INCLUDE TESTS) cmake_parse_arguments(BOOSTTEST "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) @@ -53,10 +53,13 @@ function(_add_boost_test) set_target_properties(${test_name} PROPERTIES EXCLUDE_FROM_ALL 1) endif() if(BOOSTTEST_DEFINE) - target_compile_definitions(${test_name} PUBLIC ${BOOSTTEST_DEFINE}) + target_compile_definitions(${test_name} PRIVATE ${BOOSTTEST_DEFINE}) + endif() + if(BOOSTTEST_INCLUDE) + target_include_directories(${test_name} PRIVATE ${BOOSTTEST_INCLUDE}) endif() if(BOOSTTEST_LINK) - target_link_libraries(${test_name} PUBLIC ${BOOSTTEST_LINK}) + target_link_libraries(${test_name} PRIVATE ${BOOSTTEST_LINK}) endif() else() message(FATAL_ERROR "Unknown test command: ${test_command}") diff --git a/libs/json.cmake b/libs/json.cmake new file mode 100644 index 000000000..c11cb514c --- /dev/null +++ b/libs/json.cmake @@ -0,0 +1,29 @@ +_add_boost_lib(NAME json SOURCES ${BOOST_SOURCE}/libs/json/src/src.cpp LINK Boost::container Boost::system) + +file(GLOB_RECURSE BOOST_JSON_TESTS_FILES ${BOOST_SOURCE}/libs/json/test/*.cpp) +list(FILTER + BOOST_JSON_TESTS_FILES + EXCLUDE + REGEX + .*/cmake_install_test/.*$ +) +message(TRACE "RUN ${BOOST_JSON_TESTS_FILES}") + +_add_boost_test( + NAME json_test + INCLUDE ${BOOST_SOURCE}/libs/json/test + LINK Boost::json + TESTS + RUN ${BOOST_JSON_TESTS_FILES} +) + +_add_boost_test( + NAME json_test + INCLUDE ${BOOST_SOURCE}/libs/json/test + DEFINE BOOST_JSON_MAX_STRING_SIZE=1000 BOOST_JSON_MAX_STRUCTURED_SIZE=20 BOOST_JSON_STACK_BUFFER_SIZE=256 + BOOST_JSON_NO_LIB=1 + LINK Boost::boost + TESTS + RUN ${BOOST_SOURCE}/libs/json/test/limits.cpp ${BOOST_SOURCE}/libs/json/test/main.cpp + ${BOOST_SOURCE}/libs/json/src/src.cpp +) From b7c741f42b089117221622c72783d2cb821843dc Mon Sep 17 00:00:00 2001 From: Claus Klein Date: Wed, 1 Jun 2022 11:28:40 +0200 Subject: [PATCH 20/24] define BOOST_JSON_STATIC_LINK=1 to Boost::json --- libs/json.cmake | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libs/json.cmake b/libs/json.cmake index c11cb514c..7703f8c2b 100644 --- a/libs/json.cmake +++ b/libs/json.cmake @@ -1,4 +1,7 @@ -_add_boost_lib(NAME json SOURCES ${BOOST_SOURCE}/libs/json/src/src.cpp LINK Boost::container Boost::system) +_add_boost_lib( + NAME json SOURCES ${BOOST_SOURCE}/libs/json/src/src.cpp DEFINE_PRIVATE BOOST_JSON_STATIC_LINK=1 + LINK Boost::container Boost::system Boost::boost +) file(GLOB_RECURSE BOOST_JSON_TESTS_FILES ${BOOST_SOURCE}/libs/json/test/*.cpp) list(FILTER From c8fcc96aefcc42b8343d77698b6e0c922b83fe39 Mon Sep 17 00:00:00 2001 From: ClausKlein Date: Thu, 2 Jun 2022 10:30:13 +0200 Subject: [PATCH 21/24] install CMakeLists.txt add BOOST_SOURCE --- CMakeLists.txt | 99 ++++++++++---------- cmake/CMakeLists.txt.in | 195 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 246 insertions(+), 48 deletions(-) create mode 100644 cmake/CMakeLists.txt.in diff --git a/CMakeLists.txt b/CMakeLists.txt index 8556e92d7..27194ecbb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,19 +4,19 @@ project(Boost-CMake LANGUAGES C CXX VERSION 1.79.0) option(BOOST_DISABLE_TESTS "Do not build test targets, even if building standalone" OFF) -if(EXISTS "$ENV{HOME}/.cache/CPM/boost_1_79_0") +if(EXISTS "$ENV{CPM_SOURCE_CACHE}/boost_1_79_0") set(FETCHCONTENT_SOURCE_DIR_BOOST "$ENV{HOME}/.cache/CPM/boost_1_79_0" CACHE PATH "Boost source DIR") endif() -set(BOOST_URL "https://boostorg.jfrog.io/artifactory/main/release/1.79.0/source/boost_1_79_0.tar.bz2" CACHE STRING "Boost download URL") -set(BOOST_URL_SHA256 "475d589d51a7f8b3ba2ba4eda022b170e562ca3b760ee922c146b6c65856ef39" CACHE STRING "Boost download URL SHA256 checksum") +set(BOOST_URL "https://boostorg.jfrog.io/artifactory/main/release/1.79.0/source/boost_1_79_0.tar.bz2" + CACHE STRING "Boost download URL" +) +set(BOOST_URL_SHA256 "475d589d51a7f8b3ba2ba4eda022b170e562ca3b760ee922c146b6c65856ef39" + CACHE STRING "Boost download URL SHA256 checksum" +) include(FetchContent) -FetchContent_Declare( - Boost - URL ${BOOST_URL} - URL_HASH SHA256=${BOOST_URL_SHA256} -) +FetchContent_Declare(Boost URL ${BOOST_URL} URL_HASH SHA256=${BOOST_URL_SHA256}) FetchContent_GetProperties(Boost) if(NOT Boost_POPULATED) @@ -36,6 +36,9 @@ include(PlatformDetect) include(AddBoostLib) include(AddBoostTest) +# NOTE: only to be there, but not yet used! CK +configure_file(cmake/CMakeLists.txt.in ${BOOST_SOURCE}/CMakeLists.txt @ONLY) + set_property(GLOBAL PROPERTY USE_FOLDERS TRUE) if(USE_ANDROID) @@ -44,41 +47,40 @@ if(USE_ANDROID) set(CMAKE_ASM_COMPILER_TARGET "${CMAKE_CXX_COMPILER_TARGET}") endif() -set(BOOST_LIBS_REQUIRED - # Header only libs - header +set(BOOST_LIBS_REQUIRED # Header only libs + header ) set(BOOST_LIBS_OPTIONAL - # Compiled libs - atomic - chrono - container - context - coroutine - date_time - exception - fiber - filesystem - graph - graph_parallel - iostreams - json - locale - log - math - mpi - program_options - #python # complex module - random - regex - serialization - system - test - thread - timer - type_erasure - wave - CACHE STRING "Boost libs to be compiled" + # Compiled libs + atomic + chrono + container + context + coroutine + date_time + exception + fiber + filesystem + graph + graph_parallel + iostreams + json + locale + log + math + mpi + program_options + #python # complex module + random + regex + serialization + system + test + thread + timer + type_erasure + wave + CACHE STRING "Boost libs to be compiled" ) foreach(lib ${BOOST_LIBS_REQUIRED}) @@ -95,13 +97,14 @@ endforeach() # TODO: Move those to option() calls in the right file if(NOT BOOST_STANDALONE) # Compilation options required by all platforms - target_compile_definitions(Boost::boost INTERFACE - $<$:BOOST_DISABLE_ASSERT> - BOOST_ASIO_NO_DEPRECATED - BOOST_SYSTEM_NO_DEPRECATED - BOOST_THREAD_VERSION=5 - BOOST_THREAD_USES_CHRONO - BOOST_THREAD_PROVIDES_EXECUTORS + target_compile_definitions( + Boost::boost + INTERFACE $<$:BOOST_DISABLE_ASSERT> + BOOST_ASIO_NO_DEPRECATED + BOOST_SYSTEM_NO_DEPRECATED + BOOST_THREAD_VERSION=5 + BOOST_THREAD_USES_CHRONO + BOOST_THREAD_PROVIDES_EXECUTORS ) endif() diff --git a/cmake/CMakeLists.txt.in b/cmake/CMakeLists.txt.in new file mode 100644 index 000000000..4862e41d0 --- /dev/null +++ b/cmake/CMakeLists.txt.in @@ -0,0 +1,195 @@ +# Use this cmake project to build and run the unit tests +# $ pip install cmake ninja +# $ cmake -B cmake-build -S . -G Ninja +# $ cmake --build cmake-build +# $ cmake --build cmake-build --target test + +cmake_minimum_required(VERSION 3.21...3.23) +set(CMAKE_EXPORT_COMPILE_COMMANDS ON) + +project(Boost VERSION @Boost-CMake_VERSION@ LANGUAGES CXX C) + +set(BOOST_SUPERPROJECT_VERSION ${Boost_VERSION}) +set(BOOST_SUPERPROJECT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}) + +list(INSERT CMAKE_MODULE_PATH 0 ${CMAKE_CURRENT_SOURCE_DIR}/tools/cmake/include) + +include(BoostInstall) + +option(CMAKE_CXX_EXTENSIONS "Default value for CXX_EXTENSIONS property of targets." NO) +option(CMAKE_CXX_STANDARD_REQUIRED "The c++ standard is requrired" YES) +option(CMAKE_SKIP_INSTALL_RULES "do NOT create install targes!" ${PROJECT_IS_TOP_LEVEL}) + +option(BOOST_ENABLE_MPI "Enable MPI" ${PROJECT_IS_TOP_LEVEL}) +option(BUILD_TESTING "Build ctests" ${PROJECT_IS_TOP_LEVEL}) + +set(CMAKE_CXX_STANDARD @CMAKE_CXX_STANDARD@ CACHE STRING "The used c++ standard") + +# Where to put all the RUNTIME targets when build. (ddl, and exe) +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) +set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) + +# Define the header-only Boost targets +add_library(Boost::boost INTERFACE IMPORTED GLOBAL) +add_library(Boost::headers ALIAS Boost::boost) +# NOTE: workaround for missing project! CK +add_library(Boost::numeric_conversion ALIAS Boost::boost) + +include_directories(${CMAKE_CURRENT_SOURCE_DIR}) +target_include_directories(Boost::boost INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) +target_compile_features(Boost::boost INTERFACE cxx_std_${CMAKE_CXX_STANDARD}) + +# Disable autolink +target_compile_definitions(Boost::boost INTERFACE BOOST_ALL_NO_LIB=1) + +set(ALL_LIBS_WITH_CMAKE_LIST_FILES + libs/accumulators + libs/algorithm + libs/align + libs/any + libs/array + libs/asio + libs/assert + libs/assign + libs/atomic + libs/beast + libs/bimap + libs/bind + libs/callable_traits + libs/chrono + libs/circular_buffer + libs/compatibility + libs/compute + libs/concept_check + libs/config + libs/container + libs/container_hash + libs/context + libs/contract + libs/conversion + libs/convert + libs/core + libs/coroutine + libs/coroutine2 + libs/crc + libs/date_time + libs/describe + libs/detail + libs/dll + libs/dynamic_bitset + libs/endian + libs/exception + libs/fiber + libs/filesystem + libs/flyweight + libs/foreach + libs/format + libs/function + libs/function_types + libs/functional + libs/fusion + libs/geometry + libs/gil + libs/graph + libs/graph_parallel + libs/hana + libs/heap + libs/histogram + libs/hof + libs/icl + libs/integer + libs/interprocess + libs/intrusive + libs/io + libs/iostreams + libs/iterator + libs/json + libs/lambda + libs/lambda2 + libs/leaf + libs/lexical_cast + libs/local_function + libs/locale + libs/lockfree + libs/log + libs/logic + libs/math + libs/metaparse + libs/move + libs/mp11 + libs/mpi + libs/mpl + libs/msm + libs/multi_array + libs/multi_index + libs/multiprecision + libs/nowide + libs/optional + libs/outcome + libs/parameter + libs/parameter_python + libs/pfr + libs/phoenix + libs/poly_collection + libs/polygon + libs/pool + libs/predef + libs/preprocessor + libs/process + libs/program_options + libs/property_map + libs/property_map_parallel + libs/property_tree + libs/proto + libs/ptr_container + libs/python + libs/qvm + libs/random + libs/range + libs/ratio + libs/rational + libs/regex + libs/safe_numerics + libs/scope_exit + libs/serialization + libs/signals2 + libs/smart_ptr + libs/sort + libs/spirit + libs/stacktrace + libs/statechart + libs/static_assert + libs/static_string + libs/stl_interfaces + libs/system + libs/test + libs/thread + libs/throw_exception + libs/timer + libs/tokenizer + libs/tti + libs/tuple + libs/type_erasure + libs/type_index + libs/type_traits + libs/typeof + libs/units + libs/unordered + libs/utility + libs/uuid + libs/variant + libs/variant2 + libs/vmd + libs/wave + libs/winapi + libs/xpressive + libs/yap +) + +if(PROJECT_IS_TOP_LEVEL) + enable_testing() +endif() + +foreach(_LIB IN LISTS ALL_LIBS_WITH_CMAKE_LIST_FILES) + add_subdirectory(${_LIB}) +endforeach() From 8c25594a1782e86139d56777ccd5ee7f0be5ffe7 Mon Sep 17 00:00:00 2001 From: ClausKlein Date: Sat, 4 Jun 2022 14:42:48 +0200 Subject: [PATCH 22/24] modernice some cmake files --- CMakeLists.txt | 5 +- cmake/CMakeLists.txt.in | 221 +++++++++---------------------------- cmake/Modules/ccache.cmake | 10 +- 3 files changed, 60 insertions(+), 176 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 27194ecbb..71a4cd4d6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,6 +6,7 @@ option(BOOST_DISABLE_TESTS "Do not build test targets, even if building standalo if(EXISTS "$ENV{CPM_SOURCE_CACHE}/boost_1_79_0") set(FETCHCONTENT_SOURCE_DIR_BOOST "$ENV{HOME}/.cache/CPM/boost_1_79_0" CACHE PATH "Boost source DIR") + set(CPM_Boost_SOURCE ${FETCHCONTENT_SOURCE_DIR_BOOST} CACHE PATH "Manual override") endif() set(BOOST_URL "https://boostorg.jfrog.io/artifactory/main/release/1.79.0/source/boost_1_79_0.tar.bz2" @@ -36,8 +37,10 @@ include(PlatformDetect) include(AddBoostLib) include(AddBoostTest) -# NOTE: only to be there, but not yet used! CK +# NOTE: Install the missing CMakeList.txt file, but it will not yet used! CK +# If the tar achive contains one, it will not overridden. configure_file(cmake/CMakeLists.txt.in ${BOOST_SOURCE}/CMakeLists.txt @ONLY) +configure_file(cmake/Modules/ccache.cmake ${BOOST_SOURCE}/tools/cmake/include/ccache.cmake COPYONLY) set_property(GLOBAL PROPERTY USE_FOLDERS TRUE) diff --git a/cmake/CMakeLists.txt.in b/cmake/CMakeLists.txt.in index 4862e41d0..fdac7092e 100644 --- a/cmake/CMakeLists.txt.in +++ b/cmake/CMakeLists.txt.in @@ -1,195 +1,76 @@ +# Copyright 2019, 2021, 2022 Peter Dimov +# Distributed under the Boost Software License, Version 1.0. +# See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt +# # Use this cmake project to build and run the unit tests # $ pip install cmake ninja -# $ cmake -B cmake-build -S . -G Ninja +# $ cmake -B cmake-build -S . -G Ninja -Wdev --log-level=DEBUG # $ cmake --build cmake-build # $ cmake --build cmake-build --target test cmake_minimum_required(VERSION 3.21...3.23) + set(CMAKE_EXPORT_COMPILE_COMMANDS ON) -project(Boost VERSION @Boost-CMake_VERSION@ LANGUAGES CXX C) +find_program(CACHE_BINARY NAMES ccache sccache) +if(CACHE_BINARY) + message(STATUS "${CACHE_BINARY} found and enabled") + set(CMAKE_CXX_COMPILER_LAUNCHER ${CACHE_BINARY} CACHE FILEPATH "CXX compiler cache used") + set(CMAKE_C_COMPILER_LAUNCHER ${CACHE_BINARY} CACHE FILEPATH "C compiler cache used") +endif() -set(BOOST_SUPERPROJECT_VERSION ${Boost_VERSION}) -set(BOOST_SUPERPROJECT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}) +# The default build type must be set before project() +if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR AND NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) + set(CMAKE_BUILD_TYPE Release CACHE STRING "Build type" FORCE) + set_property( + CACHE CMAKE_BUILD_TYPE + PROPERTY STRINGS + "Debug" + "Release" + "MinSizeRel" + "RelWithDebInfo" + ) +endif() -list(INSERT CMAKE_MODULE_PATH 0 ${CMAKE_CURRENT_SOURCE_DIR}/tools/cmake/include) +project(Boost VERSION @Boost-CMake_VERSION@ LANGUAGES CXX C) -include(BoostInstall) +set(BOOST_SUPERPROJECT_VERSION ${PROJECT_VERSION}) +set(BOOST_SUPERPROJECT_SOURCE_DIR ${PROJECT_SOURCE_DIR}) + +list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/tools/cmake/include) option(CMAKE_CXX_EXTENSIONS "Default value for CXX_EXTENSIONS property of targets." NO) option(CMAKE_CXX_STANDARD_REQUIRED "The c++ standard is requrired" YES) -option(CMAKE_SKIP_INSTALL_RULES "do NOT create install targes!" ${PROJECT_IS_TOP_LEVEL}) +option(BUILD_SHARED_LIBS "Build shared libraries" ${PROJECT_IS_TOP_LEVEL}) -option(BOOST_ENABLE_MPI "Enable MPI" ${PROJECT_IS_TOP_LEVEL}) -option(BUILD_TESTING "Build ctests" ${PROJECT_IS_TOP_LEVEL}) +### see tools/cmake/include/BoostRoot.cmake +#XXX option(CMAKE_SKIP_INSTALL_RULES "do NOT create install targes!" ${PROJECT_IS_TOP_LEVEL}) +# option(BOOST_ENABLE_MPI "Enable MPI" ${PROJECT_IS_TOP_LEVEL}) +# option(BUILD_TESTING "Enable testing" ${PROJECT_IS_TOP_LEVEL}) set(CMAKE_CXX_STANDARD @CMAKE_CXX_STANDARD@ CACHE STRING "The used c++ standard") -# Where to put all the RUNTIME targets when build. (ddl, and exe) -set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) -set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) - -# Define the header-only Boost targets -add_library(Boost::boost INTERFACE IMPORTED GLOBAL) -add_library(Boost::headers ALIAS Boost::boost) -# NOTE: workaround for missing project! CK -add_library(Boost::numeric_conversion ALIAS Boost::boost) - +### Workaround to compile some boost libs. CK include_directories(${CMAKE_CURRENT_SOURCE_DIR}) -target_include_directories(Boost::boost INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) -target_compile_features(Boost::boost INTERFACE cxx_std_${CMAKE_CXX_STANDARD}) - -# Disable autolink -target_compile_definitions(Boost::boost INTERFACE BOOST_ALL_NO_LIB=1) -set(ALL_LIBS_WITH_CMAKE_LIST_FILES - libs/accumulators - libs/algorithm - libs/align - libs/any - libs/array - libs/asio - libs/assert - libs/assign - libs/atomic - libs/beast - libs/bimap - libs/bind - libs/callable_traits - libs/chrono - libs/circular_buffer - libs/compatibility - libs/compute - libs/concept_check - libs/config - libs/container - libs/container_hash - libs/context - libs/contract - libs/conversion - libs/convert - libs/core - libs/coroutine - libs/coroutine2 - libs/crc - libs/date_time - libs/describe - libs/detail - libs/dll - libs/dynamic_bitset - libs/endian - libs/exception - libs/fiber - libs/filesystem - libs/flyweight - libs/foreach - libs/format - libs/function - libs/function_types - libs/functional - libs/fusion - libs/geometry - libs/gil - libs/graph - libs/graph_parallel - libs/hana - libs/heap - libs/histogram - libs/hof - libs/icl - libs/integer - libs/interprocess - libs/intrusive - libs/io - libs/iostreams - libs/iterator - libs/json - libs/lambda - libs/lambda2 - libs/leaf - libs/lexical_cast - libs/local_function - libs/locale - libs/lockfree - libs/log - libs/logic - libs/math - libs/metaparse - libs/move - libs/mp11 - libs/mpi - libs/mpl - libs/msm - libs/multi_array - libs/multi_index - libs/multiprecision - libs/nowide - libs/optional - libs/outcome - libs/parameter - libs/parameter_python - libs/pfr - libs/phoenix - libs/poly_collection - libs/polygon - libs/pool - libs/predef - libs/preprocessor - libs/process - libs/program_options - libs/property_map - libs/property_map_parallel - libs/property_tree - libs/proto - libs/ptr_container - libs/python - libs/qvm - libs/random - libs/range - libs/ratio - libs/rational - libs/regex - libs/safe_numerics - libs/scope_exit - libs/serialization - libs/signals2 - libs/smart_ptr - libs/sort - libs/spirit - libs/stacktrace - libs/statechart - libs/static_assert - libs/static_string - libs/stl_interfaces - libs/system - libs/test - libs/thread - libs/throw_exception - libs/timer - libs/tokenizer - libs/tti - libs/tuple - libs/type_erasure - libs/type_index - libs/type_traits - libs/typeof - libs/units - libs/unordered - libs/utility - libs/uuid - libs/variant - libs/variant2 - libs/vmd - libs/wave - libs/winapi - libs/xpressive - libs/yap -) +# NOTE: prepared, but not used! CK +### Define the header-only Boost targets +# add_library(Boost::boost SYSTEM INTERFACE IMPORTED GLOBAL) +# add_library(Boost::headers ALIAS Boost::boost) +# target_include_directories(Boost::boost INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) +# target_compile_features(Boost::boost INTERFACE cxx_std_${CMAKE_CXX_STANDARD}) +# target_compile_definitions( +# Boost::boost +# INTERFACE $<$:BOOST_DISABLE_ASSERT> +# BOOST_ASIO_NO_DEPRECATED +# BOOST_SYSTEM_NO_DEPRECATED +# BOOST_THREAD_VERSION=5 +# BOOST_THREAD_USES_CHRONO +# BOOST_THREAD_PROVIDES_EXECUTORS +# ) if(PROJECT_IS_TOP_LEVEL) enable_testing() endif() -foreach(_LIB IN LISTS ALL_LIBS_WITH_CMAKE_LIST_FILES) - add_subdirectory(${_LIB}) -endforeach() +include(BoostRoot) diff --git a/cmake/Modules/ccache.cmake b/cmake/Modules/ccache.cmake index 9388b0a28..39b96e5ee 100644 --- a/cmake/Modules/ccache.cmake +++ b/cmake/Modules/ccache.cmake @@ -1,11 +1,11 @@ -find_program(CCACHE_BIN ccache) +find_program(CCACHE_BIN NAMES ccache sccache) if(CCACHE_BIN) - set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ${CCACHE_BIN}) - set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ${CCACHE_BIN}) + set(CMAKE_CXX_COMPILER_LAUNCHER ${CCACHE_BIN} CACHE FILEPATH "CXX compiler cache used") + set(CMAKE_C_COMPILER_LAUNCHER ${CCACHE_BIN} CACHE FILEPATH "C compiler cache used") # ccache uses -I when compiling without preprocessor, which makes clang complain. if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Qunused-arguments -fcolor-diagnostics") - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Qunused-arguments -fcolor-diagnostics") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Qunused-arguments -fcolor-diagnostics") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Qunused-arguments -fcolor-diagnostics") endif() endif() From 127ef69ac6ccd3aa8d20fdac9b400c4649b1c4b3 Mon Sep 17 00:00:00 2001 From: ClausKlein Date: Tue, 7 Jun 2022 21:33:03 +0200 Subject: [PATCH 23/24] Add alias for Boost::asio lib --- CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 71a4cd4d6..fd591ddcf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -97,8 +97,11 @@ foreach(lib ${BOOST_LIBS_OPTIONAL}) endif() endforeach() + # TODO: Move those to option() calls in the right file if(NOT BOOST_STANDALONE) + find_package(Threads) + # Compilation options required by all platforms target_compile_definitions( Boost::boost @@ -109,6 +112,8 @@ if(NOT BOOST_STANDALONE) BOOST_THREAD_USES_CHRONO BOOST_THREAD_PROVIDES_EXECUTORS ) + add_library(Boost::asio ALIAS Boost::boost) + target_link_libraries(Boost::boost INTERFACE Threads::Threads) endif() if(USE_ANDROID) From 87c5ddb42bcd6ab239cc48ca60b0f9c596ff98ed Mon Sep 17 00:00:00 2001 From: ClausKlein Date: Wed, 8 Jun 2022 23:56:52 +0200 Subject: [PATCH 24/24] fix typo --- CMakeLists.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fd591ddcf..581ead596 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,7 +5,7 @@ project(Boost-CMake LANGUAGES C CXX VERSION 1.79.0) option(BOOST_DISABLE_TESTS "Do not build test targets, even if building standalone" OFF) if(EXISTS "$ENV{CPM_SOURCE_CACHE}/boost_1_79_0") - set(FETCHCONTENT_SOURCE_DIR_BOOST "$ENV{HOME}/.cache/CPM/boost_1_79_0" CACHE PATH "Boost source DIR") + set(FETCHCONTENT_SOURCE_DIR_BOOST "$ENV{CPM_SOURCE_CACHE}/boost_1_79_0" CACHE PATH "Boost source DIR") set(CPM_Boost_SOURCE ${FETCHCONTENT_SOURCE_DIR_BOOST} CACHE PATH "Manual override") endif() @@ -97,7 +97,6 @@ foreach(lib ${BOOST_LIBS_OPTIONAL}) endif() endforeach() - # TODO: Move those to option() calls in the right file if(NOT BOOST_STANDALONE) find_package(Threads)