From ffc35e8e3ea3353dfba508f5150977b9bbc74d50 Mon Sep 17 00:00:00 2001 From: Ruben Perez Date: Wed, 4 Oct 2023 17:23:48 +0200 Subject: [PATCH] copytree and cxxstd --- .github/workflows/ci.yml | 10 ++++++++-- tools/ci.py | 12 ++++++++++-- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 963e4ad3..71ac7db7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -60,6 +60,7 @@ jobs: run: | python3 tools/ci.py run-cmake-add-subdirectory-tests \ --build-type ${{ matrix.build-type }} \ + --cxxstd ${{ matrix.cxxstd }} \ --toolset ${{ matrix.toolset }} \ --generator "${{ matrix.generator }}" @@ -67,6 +68,7 @@ jobs: run: | python3 tools/ci.py run-cmake-find-package-tests \ --build-type ${{ matrix.build-type }} \ + --cxxstd ${{ matrix.cxxstd }} \ --toolset ${{ matrix.toolset }} \ --generator "${{ matrix.generator }}" @@ -74,6 +76,7 @@ jobs: run: | python3 tools/ci.py run-cmake-b2-find-package-tests \ --build-type ${{ matrix.build-type }} \ + --cxxstd ${{ matrix.cxxstd }} \ --toolset ${{ matrix.toolset }} \ --generator "${{ matrix.generator }}" @@ -117,9 +120,9 @@ jobs: - name: Build a Boost distribution using CMake run: | ./tools/ci.py build-cmake-distro \ - --toolset ${{ matrix.toolset }} \ --build-type ${{ matrix.build-type }} \ - --cxxstd ${{ matrix.cxxstd }} + --cxxstd ${{ matrix.cxxstd }} \ + --toolset ${{ matrix.toolset }} - name: Build the project tests run: | @@ -137,16 +140,19 @@ jobs: run: | ./tools/ci.py run-cmake-add-subdirectory-tests \ --build-type ${{ matrix.build-type }} \ + --cxxstd ${{ matrix.cxxstd }} \ --toolset ${{ matrix.toolset }} - name: Run find_package tests with the built cmake distribution run: | ./tools/ci.py run-cmake-find-package-tests \ --build-type ${{ matrix.build-type }} \ + --cxxstd ${{ matrix.cxxstd }} \ --toolset ${{ matrix.toolset }} - name: Run find_package tests with the built b2 distribution run: | ./tools/ci.py run-cmake-b2-find-package-tests \ --build-type ${{ matrix.build-type }} \ + --cxxstd ${{ matrix.cxxstd }} \ --toolset ${{ matrix.toolset }} diff --git a/tools/ci.py b/tools/ci.py index efbc99dc..bf81ad45 100755 --- a/tools/ci.py +++ b/tools/ci.py @@ -103,8 +103,7 @@ def _setup_boost( copytree( str(source_dir), str(lib_dir), - ignore=ignore_patterns('__build*__', '.git'), - dirs_exist_ok=True + ignore=ignore_patterns('__build*__', '.git') ) # Install Boost dependencies @@ -205,6 +204,7 @@ def _run_cmake_standalone_tests( def _run_cmake_add_subdirectory_tests( generator: str, build_type: str, + cxxstd: str, toolset: str, build_shared_libs: bool = False ): @@ -219,6 +219,7 @@ def _run_cmake_add_subdirectory_tests( '-DBOOST_CI_INSTALL_TEST=OFF', '-DCMAKE_BUILD_TYPE={}'.format(build_type), '-DBUILD_SHARED_LIBS={}'.format(_cmake_bool(build_shared_libs)), + '-DCMAKE_CXX_STANDARD={}'.format(cxxstd), '..' ]) _run(['cmake', '--build', '.', '--config', build_type]) @@ -229,6 +230,7 @@ def _run_cmake_add_subdirectory_tests( def _run_cmake_find_package_tests( generator: str, build_type: str, + cxxstd: str, toolset: str, build_shared_libs: bool = False ): @@ -242,6 +244,7 @@ def _run_cmake_find_package_tests( '-DBOOST_CI_INSTALL_TEST=ON', '-DCMAKE_BUILD_TYPE={}'.format(build_type), '-DBUILD_SHARED_LIBS={}'.format(_cmake_bool(build_shared_libs)), + '-DCMAKE_CXX_STANDARD={}'.format(cxxstd), '-DCMAKE_PREFIX_PATH={}'.format(_build_prefix_path(_cmake_distro)), '..' ]) @@ -253,6 +256,7 @@ def _run_cmake_find_package_tests( def _run_cmake_b2_find_package_tests( generator: str, build_type: str, + cxxstd: str, toolset: str, build_shared_libs: bool = False ): @@ -266,6 +270,7 @@ def _run_cmake_b2_find_package_tests( '-DCMAKE_PREFIX_PATH={}'.format(_build_prefix_path(_b2_distro)), '-DCMAKE_BUILD_TYPE={}'.format(build_type), '-DBUILD_SHARED_LIBS={}'.format(_cmake_bool(build_shared_libs)), + '-DCMAKE_CXX_STANDARD={}'.format(cxxstd), '-DBUILD_TESTING=ON', '..' ]) @@ -310,6 +315,7 @@ def main(): subp = subparsers.add_parser('run-cmake-add-subdirectory-tests') subp.add_argument('--generator', default='Unix Makefiles') subp.add_argument('--build-type', default='Debug') + subp.add_argument('--cxxstd', default='20') subp.add_argument('--toolset', default='gcc') subp.add_argument('--build-shared-libs', type=_str2bool, default=False) subp.set_defaults(func=_run_cmake_add_subdirectory_tests) @@ -317,6 +323,7 @@ def main(): subp = subparsers.add_parser('run-cmake-find-package-tests') subp.add_argument('--generator', default='Unix Makefiles') subp.add_argument('--build-type', default='Debug') + subp.add_argument('--cxxstd', default='20') subp.add_argument('--toolset', default='gcc') subp.add_argument('--build-shared-libs', type=_str2bool, default=False) subp.set_defaults(func=_run_cmake_find_package_tests) @@ -324,6 +331,7 @@ def main(): subp = subparsers.add_parser('run-cmake-b2-find-package-tests') subp.add_argument('--generator', default='Unix Makefiles') subp.add_argument('--build-type', default='Debug') + subp.add_argument('--cxxstd', default='20') subp.add_argument('--toolset', default='gcc') subp.add_argument('--build-shared-libs', type=_str2bool, default=False) subp.set_defaults(func=_run_cmake_b2_find_package_tests)