From 12db891b94701e3c8330b585ad8a613c001aeb72 Mon Sep 17 00:00:00 2001 From: Antony Polukhin Date: Wed, 31 Dec 2025 14:52:27 +0300 Subject: [PATCH 1/6] CI update --- test/cmake_subdir_test/CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/test/cmake_subdir_test/CMakeLists.txt b/test/cmake_subdir_test/CMakeLists.txt index a934b81..bfcca7c 100644 --- a/test/cmake_subdir_test/CMakeLists.txt +++ b/test/cmake_subdir_test/CMakeLists.txt @@ -15,7 +15,6 @@ add_subdirectory(../../../detail boostorg/detail) add_subdirectory(../../../integer boostorg/integer) add_subdirectory(../../../mp11 boostorg/mp11) add_subdirectory(../../../preprocessor boostorg/preprocessor) -add_subdirectory(../../../static_assert boostorg/static_assert) add_subdirectory(../../../throw_exception boostorg/throw_exception) add_subdirectory(../../../type_index boostorg/type_index) add_subdirectory(../../../type_traits boostorg/type_traits) From 43eacadd5a3f32de45840e8715b5f5b09aa47986 Mon Sep 17 00:00:00 2001 From: Antony Polukhin Date: Wed, 31 Dec 2025 15:54:17 +0300 Subject: [PATCH 2/6] fix attempt --- test/cmake_subdir_test/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/cmake_subdir_test/CMakeLists.txt b/test/cmake_subdir_test/CMakeLists.txt index bfcca7c..e83fac7 100644 --- a/test/cmake_subdir_test/CMakeLists.txt +++ b/test/cmake_subdir_test/CMakeLists.txt @@ -21,6 +21,8 @@ add_subdirectory(../../../type_traits boostorg/type_traits) add_subdirectory(../../ boostorg/any) +set(CMAKE_CXX_SCAN_FOR_MODULES OFF) + enable_testing() if (BOOST_USE_MODULES) From d38b82af429b791e517580d48fa93111e9622f81 Mon Sep 17 00:00:00 2001 From: Antony Polukhin Date: Wed, 31 Dec 2025 16:08:41 +0300 Subject: [PATCH 3/6] another fix attempt --- CMakeLists.txt | 13 +++++++++---- test/cmake_subdir_test/CMakeLists.txt | 4 +--- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 014cdad..8fd8717 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,19 +2,24 @@ # Distributed under the Boost Software License, Version 1.0. # See accompanying file LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt -cmake_minimum_required( VERSION 3.5...3.31 ) +cmake_minimum_required( VERSION 3.8...3.31 ) project( boost_any VERSION "${BOOST_SUPERPROJECT_VERSION}" LANGUAGES CXX ) if (BOOST_USE_MODULES) add_library(boost_any) target_sources(boost_any PUBLIC - FILE_SET modules_public TYPE CXX_MODULES FILES - ${CMAKE_CURRENT_LIST_DIR}/modules/boost_any.cppm + FILE_SET modules_public + TYPE CXX_MODULES + FILES modules/boost_any.cppm ) target_compile_features(boost_any PUBLIC cxx_std_20) target_compile_definitions(boost_any PUBLIC BOOST_USE_MODULES) - if (CMAKE_CXX_COMPILER_IMPORT_STD) + set(__boost_cxx_standard ${CMAKE_CXX_STANDARD}) + if (NOT __boost_cxx_standard) + set(__boost_cxx_standard 20) + endif() + if (CMAKE_CXX_COMPILER_IMPORT_STD AND ${__boost_cxx_standard} IN_LIST CMAKE_CXX_COMPILER_IMPORT_STD) target_compile_definitions(boost_any PRIVATE BOOST_ANY_USE_STD_MODULE) message(STATUS "Using `import std;`") else() diff --git a/test/cmake_subdir_test/CMakeLists.txt b/test/cmake_subdir_test/CMakeLists.txt index e83fac7..d082126 100644 --- a/test/cmake_subdir_test/CMakeLists.txt +++ b/test/cmake_subdir_test/CMakeLists.txt @@ -21,8 +21,6 @@ add_subdirectory(../../../type_traits boostorg/type_traits) add_subdirectory(../../ boostorg/any) -set(CMAKE_CXX_SCAN_FOR_MODULES OFF) - enable_testing() if (BOOST_USE_MODULES) @@ -51,7 +49,7 @@ list(APPEND RUN_TESTS_SOURCES foreach (testsourcefile ${RUN_TESTS_SOURCES}) get_filename_component(testname ${testsourcefile} NAME_WLE) add_executable(${PROJECT_NAME}_${testname} ../${testsourcefile}) - target_link_libraries(${PROJECT_NAME}_${testname} Boost::any) + target_link_libraries(${PROJECT_NAME}_${testname} Boost::any Boost::core) add_test(NAME ${PROJECT_NAME}_${testname} COMMAND ${PROJECT_NAME}_${testname}) endforeach() From 9888a26b7c4089ca229dd7cac70b35d056558869 Mon Sep 17 00:00:00 2001 From: Antony Polukhin Date: Wed, 31 Dec 2025 16:19:43 +0300 Subject: [PATCH 4/6] Boost::any must depend on Boost::core --- .github/workflows/ci.yml | 4 ++-- test/cmake_subdir_test/CMakeLists.txt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 12efe5e..6544662 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -85,7 +85,7 @@ jobs: cd .. rm -rf __build - - name: Run modules tests wihtout 'import std;' + - name: Run modules tests without 'import std;' if: ${{matrix.toolset == 'clang-19'}} run: | cd ../boost-root/libs/any @@ -218,7 +218,7 @@ jobs: cd .. rm -rf build_module - - name: Run modules tests wihtout 'import std;' + - name: Run modules tests without 'import std;' if: ${{matrix.toolset == 'msvc-14.3'}} shell: cmd run: | diff --git a/test/cmake_subdir_test/CMakeLists.txt b/test/cmake_subdir_test/CMakeLists.txt index d082126..bfcca7c 100644 --- a/test/cmake_subdir_test/CMakeLists.txt +++ b/test/cmake_subdir_test/CMakeLists.txt @@ -49,7 +49,7 @@ list(APPEND RUN_TESTS_SOURCES foreach (testsourcefile ${RUN_TESTS_SOURCES}) get_filename_component(testname ${testsourcefile} NAME_WLE) add_executable(${PROJECT_NAME}_${testname} ../${testsourcefile}) - target_link_libraries(${PROJECT_NAME}_${testname} Boost::any Boost::core) + target_link_libraries(${PROJECT_NAME}_${testname} Boost::any) add_test(NAME ${PROJECT_NAME}_${testname} COMMAND ${PROJECT_NAME}_${testname}) endforeach() From 5c04482d8b3fa20611bfbc4ae6620913256b60c9 Mon Sep 17 00:00:00 2001 From: Antony Polukhin Date: Wed, 31 Dec 2025 16:23:19 +0300 Subject: [PATCH 5/6] fix --- test/cmake_subdir_test/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/cmake_subdir_test/CMakeLists.txt b/test/cmake_subdir_test/CMakeLists.txt index bfcca7c..d082126 100644 --- a/test/cmake_subdir_test/CMakeLists.txt +++ b/test/cmake_subdir_test/CMakeLists.txt @@ -49,7 +49,7 @@ list(APPEND RUN_TESTS_SOURCES foreach (testsourcefile ${RUN_TESTS_SOURCES}) get_filename_component(testname ${testsourcefile} NAME_WLE) add_executable(${PROJECT_NAME}_${testname} ../${testsourcefile}) - target_link_libraries(${PROJECT_NAME}_${testname} Boost::any) + target_link_libraries(${PROJECT_NAME}_${testname} Boost::any Boost::core) add_test(NAME ${PROJECT_NAME}_${testname} COMMAND ${PROJECT_NAME}_${testname}) endforeach() From d953b5136740525004f49d44d1d1492c7d2e9ff7 Mon Sep 17 00:00:00 2001 From: Antony Polukhin Date: Wed, 31 Dec 2025 16:25:08 +0300 Subject: [PATCH 6/6] try different directory --- test/cmake_subdir_test/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/cmake_subdir_test/CMakeLists.txt b/test/cmake_subdir_test/CMakeLists.txt index d082126..496c2dd 100644 --- a/test/cmake_subdir_test/CMakeLists.txt +++ b/test/cmake_subdir_test/CMakeLists.txt @@ -24,7 +24,7 @@ add_subdirectory(../../ boostorg/any) enable_testing() if (BOOST_USE_MODULES) - add_executable(boost_any_module_usage ../modules/usage_sample.cpp) + add_executable(boost_any_module_usage ../../modules/usage_sample.cpp) target_link_libraries(boost_any_module_usage PRIVATE Boost::any) add_test(NAME boost_any_module_usage COMMAND boost_any_module_usage) endif()