From 629109884e1d5504ec3fbdfea65e09fdccfbe63b Mon Sep 17 00:00:00 2001 From: Andrei Avram <6795248+andreiavrammsd@users.noreply.github.com> Date: Sat, 7 Jun 2025 18:49:10 +0300 Subject: [PATCH 01/13] Set copyright --- LICENSE | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/LICENSE b/LICENSE index 72e5ace..999d4e0 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2023 Andrei Avram +Copyright (c) 2020-2025 Andrei Avram Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -16,4 +16,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. \ No newline at end of file +THE SOFTWARE. From d17ec64e9abf6fdf474dc3542bb4d9b798ce8c11 Mon Sep 17 00:00:00 2001 From: Andrei Avram <6795248+andreiavrammsd@users.noreply.github.com> Date: Sat, 7 Jun 2025 19:11:27 +0300 Subject: [PATCH 02/13] Allow std override --- .vscode/settings.json | 3 ++- CMakeLists.txt | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 31c655f..eb7754b 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,7 +1,8 @@ { "cmake.configureArgs": [ "-Dcpp_channel_build_examples=ON", - "-Dcpp_channel_build_tests=ON" + "-Dcpp_channel_build_tests=ON", + "-DCMAKE_CXX_STANDARD=11" ], "clang-tidy.fixOnSave": false, "clang-tidy.lintOnSave": false, diff --git a/CMakeLists.txt b/CMakeLists.txt index b1be169..3e80437 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.12) project(cpp_channel) set(PROJECT_VERSION 0.8.3) -set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_STANDARD 11 CACHE STRING "C++ standard") set(CMAKE_CXX_STANDARD_REQUIRED YES) set(CXX_EXTENSIONS NO) From af476fd376d4eaa64e87743c73ada5f57c669b10 Mon Sep 17 00:00:00 2001 From: Andrei Avram <6795248+andreiavrammsd@users.noreply.github.com> Date: Sat, 7 Jun 2025 19:24:16 +0300 Subject: [PATCH 03/13] Use one target, multiple jobs --- .github/workflows/cmake.yml | 42 ++++++++++++++++++++++++++++++------- tests/CMakeLists.txt | 10 ++------- 2 files changed, 37 insertions(+), 15 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 6808ee2..891f549 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -29,24 +29,52 @@ jobs: matrix: config: - { - name: "Ubuntu Latest GCC (Release)", + name: "Ubuntu Latest GCC, C++11 (Release)", os: ubuntu-latest, build_type: "Release", + std: "11", } - { - name: "Ubuntu 22.04 GCC (Debug)", + name: "Ubuntu 22.04 GCC, C++11 (Debug)", os: ubuntu-22.04, build_type: "Debug", + std: "11", } - { - name: "macOS Latest Clang (Release)", + name: "Ubuntu 22.04 GCC, C++14 (Debug)", + os: ubuntu-22.04, + build_type: "Debug", + std: "14", + } + - { + name: "Ubuntu 22.04 GCC, C++17 (Debug)", + os: ubuntu-22.04, + build_type: "Debug", + std: "17", + } + - { + name: "Ubuntu 22.04 GCC, C++20 (Debug)", + os: ubuntu-22.04, + build_type: "Debug", + std: "20", + } + - { + name: "Ubuntu 22.04 GCC, C++23 (Debug)", + os: ubuntu-22.04, + build_type: "Debug", + std: "23", + } + - { + name: "macOS Latest Clang, C++11 (Release)", os: macos-latest, build_type: "Release", + std: "11", } - { - name: "Windows Latest (Release)", + name: "Windows Latest, C++11 (Release)", os: windows-latest, build_type: "Release", + std: "11", } steps: @@ -57,7 +85,7 @@ jobs: - name: Configure CMake working-directory: ${{github.workspace}}/build - run: cmake ${{ github.workspace }} -DCMAKE_BUILD_TYPE=${{ matrix.config.build_type }} -Dcpp_channel_build_examples=ON -Dcpp_channel_build_tests=ON + run: cmake ${{ github.workspace }} -DCMAKE_BUILD_TYPE=${{ matrix.config.build_type }} -DCMAKE_CXX_STANDARD=${{ matrix.config.std }} -Dcpp_channel_build_examples=ON -Dcpp_channel_build_tests=ON - name: Build working-directory: ${{github.workspace}}/build @@ -65,7 +93,7 @@ jobs: - name: Test working-directory: ${{github.workspace}}/build - run: ctest -C ${{ matrix.config.build_type }} --verbose -R channel_test* + run: ctest -C ${{ matrix.config.build_type }} --verbose -R channel_test - name: Run examples working-directory: ${{github.workspace}}/build @@ -91,7 +119,7 @@ jobs: - name: Test working-directory: ${{github.workspace}}/build - run: ctest -C Debug --verbose -R channel_test11 + run: ctest -C Debug --verbose -R channel_test - name: Upload coverage reports to Codecov uses: codecov/codecov-action@v4.0.1 diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index d0d4893..c4ce123 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -36,17 +36,11 @@ endfunction() add_custom_target(tests) # Tests -package_add_test(channel_test11 channel_test.cpp blocking_iterator_test.cpp) -package_add_test(channel_test14 channel_test.cpp blocking_iterator_test.cpp) -package_add_test(channel_test17 channel_test.cpp blocking_iterator_test.cpp) - -set_target_properties(channel_test14 PROPERTIES CXX_STANDARD 14 CXX_STANDARD_REQUIRED YES) -set_target_properties(channel_test17 PROPERTIES CXX_STANDARD 17 CXX_STANDARD_REQUIRED YES) +package_add_test(channel_test channel_test.cpp blocking_iterator_test.cpp) if (CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang") # Disable warnings about C++17 extensions - target_compile_options(channel_test11 PRIVATE -Wno-c++17-extensions) - target_compile_options(channel_test14 PRIVATE -Wno-c++17-extensions) + target_compile_options(channel_test PRIVATE -Wno-c++17-extensions) endif() # Benchmark From 1fd50f7dba2039bbbd46f40e0875eaae4e8a950e Mon Sep 17 00:00:00 2001 From: Andrei Avram <6795248+andreiavrammsd@users.noreply.github.com> Date: Sat, 7 Jun 2025 19:28:00 +0300 Subject: [PATCH 04/13] Test with 11 and 17 --- .github/workflows/cmake.yml | 26 ++++---------------------- 1 file changed, 4 insertions(+), 22 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 891f549..b2787e5 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -28,24 +28,12 @@ jobs: fail-fast: false matrix: config: - - { - name: "Ubuntu Latest GCC, C++11 (Release)", - os: ubuntu-latest, - build_type: "Release", - std: "11", - } - { name: "Ubuntu 22.04 GCC, C++11 (Debug)", os: ubuntu-22.04, build_type: "Debug", std: "11", } - - { - name: "Ubuntu 22.04 GCC, C++14 (Debug)", - os: ubuntu-22.04, - build_type: "Debug", - std: "14", - } - { name: "Ubuntu 22.04 GCC, C++17 (Debug)", os: ubuntu-22.04, @@ -53,16 +41,10 @@ jobs: std: "17", } - { - name: "Ubuntu 22.04 GCC, C++20 (Debug)", - os: ubuntu-22.04, - build_type: "Debug", - std: "20", - } - - { - name: "Ubuntu 22.04 GCC, C++23 (Debug)", - os: ubuntu-22.04, - build_type: "Debug", - std: "23", + name: "Ubuntu Latest GCC, C++11 (Release)", + os: ubuntu-latest, + build_type: "Release", + std: "11", } - { name: "macOS Latest Clang, C++11 (Release)", From 53a7bc9aa54ba62baa646651984fdcafd50e86ab Mon Sep 17 00:00:00 2001 From: Andrei Avram <6795248+andreiavrammsd@users.noreply.github.com> Date: Sat, 7 Jun 2025 19:30:48 +0300 Subject: [PATCH 05/13] Upgrade runners --- .github/workflows/cmake.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index b2787e5..03b953c 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -29,14 +29,14 @@ jobs: matrix: config: - { - name: "Ubuntu 22.04 GCC, C++11 (Debug)", - os: ubuntu-22.04, + name: "Ubuntu 24.04 GCC, C++11 (Debug)", + os: ubuntu-24.04, build_type: "Debug", std: "11", } - { - name: "Ubuntu 22.04 GCC, C++17 (Debug)", - os: ubuntu-22.04, + name: "Ubuntu Latest GCC, C++17 (Debug)", + os: ubuntu-latest, build_type: "Debug", std: "17", } From 0023a5a21811aba2d750f7990da37f558542f8a8 Mon Sep 17 00:00:00 2001 From: Andrei Avram <6795248+andreiavrammsd@users.noreply.github.com> Date: Sat, 7 Jun 2025 19:34:40 +0300 Subject: [PATCH 06/13] Upgrade codecov --- .github/workflows/cmake.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 03b953c..2922138 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -104,7 +104,7 @@ jobs: run: ctest -C Debug --verbose -R channel_test - name: Upload coverage reports to Codecov - uses: codecov/codecov-action@v4.0.1 + uses: codecov/codecov-action@v5 with: token: ${{ secrets.CODECOV_TOKEN }} From a1665c364e20b5b5be33ce40b9b70fad91b1c691 Mon Sep 17 00:00:00 2001 From: Andrei Avram <6795248+andreiavrammsd@users.noreply.github.com> Date: Sat, 7 Jun 2025 19:35:47 +0300 Subject: [PATCH 07/13] Parallel builds --- .github/workflows/cmake.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 2922138..e09459b 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -71,15 +71,15 @@ jobs: - name: Build working-directory: ${{github.workspace}}/build - run: cmake --build . --config ${{ matrix.config.build_type }} --target tests + run: cmake --build . --config ${{ matrix.config.build_type }} --target tests -j - name: Test working-directory: ${{github.workspace}}/build - run: ctest -C ${{ matrix.config.build_type }} --verbose -R channel_test + run: ctest -C ${{ matrix.config.build_type }} --verbose -R channel_test --output-on-failure -j - name: Run examples working-directory: ${{github.workspace}}/build - run: cmake --build . --config ${{ matrix.config.build_type }} --target examples + run: cmake --build . --config ${{ matrix.config.build_type }} --target examples -j coverage: name: Coverage From 69ffcd8b570baec2a7806ce69263de84235235ab Mon Sep 17 00:00:00 2001 From: Andrei Avram <6795248+andreiavrammsd@users.noreply.github.com> Date: Sat, 7 Jun 2025 19:42:07 +0300 Subject: [PATCH 08/13] Add cpp_channel_coverage cmake option --- .github/workflows/cmake.yml | 2 +- .vscode/settings.json | 1 + CMakeLists.txt | 1 + tests/CMakeLists.txt | 2 +- 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index e09459b..395cdd2 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -93,7 +93,7 @@ jobs: - name: Configure CMake working-directory: ${{github.workspace}}/build - run: cmake ${{ github.workspace }} -DCMAKE_BUILD_TYPE=Debug -Dcpp_channel_build_tests=ON + run: cmake ${{ github.workspace }} -DCMAKE_BUILD_TYPE=Debug -Dcpp_channel_build_tests=ON -Dcpp_channel_coverage=ON - name: Build working-directory: ${{github.workspace}}/build diff --git a/.vscode/settings.json b/.vscode/settings.json index eb7754b..fedcb41 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -2,6 +2,7 @@ "cmake.configureArgs": [ "-Dcpp_channel_build_examples=ON", "-Dcpp_channel_build_tests=ON", + "-Dcpp_channel_coverage=ON", "-DCMAKE_CXX_STANDARD=11" ], "clang-tidy.fixOnSave": false, diff --git a/CMakeLists.txt b/CMakeLists.txt index 3e80437..eacea7e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,6 +16,7 @@ target_include_directories(msd_channel INTERFACE include) option(cpp_channel_build_tests "Build all of cpp_channel's own tests." OFF) option(cpp_channel_build_examples "Build cpp_channel's example programs." OFF) +option(cpp_channel_coverage "Generate test coverage." OFF) if (cpp_channel_build_tests) enable_testing() diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index c4ce123..fd3f5f8 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -23,7 +23,7 @@ function(package_add_test TESTNAME) set_target_warnings(${TESTNAME} PRIVATE) target_link_libraries(${TESTNAME} gtest gtest_main) - if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + if (cpp_channel_coverage) target_link_libraries(${TESTNAME} -lgcov -lubsan) target_compile_options(${TESTNAME} PRIVATE --coverage -fsanitize=undefined) endif () From 5d7d2eec3c493b3d100d1d5a98e5bba7b11dd901 Mon Sep 17 00:00:00 2001 From: Andrei Avram <6795248+andreiavrammsd@users.noreply.github.com> Date: Sat, 7 Jun 2025 19:43:40 +0300 Subject: [PATCH 09/13] Uppercase cmake options --- .github/workflows/cmake.yml | 4 ++-- .vscode/settings.json | 6 +++--- CMakeLists.txt | 10 +++++----- tests/CMakeLists.txt | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 395cdd2..befc91a 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -67,7 +67,7 @@ jobs: - name: Configure CMake working-directory: ${{github.workspace}}/build - run: cmake ${{ github.workspace }} -DCMAKE_BUILD_TYPE=${{ matrix.config.build_type }} -DCMAKE_CXX_STANDARD=${{ matrix.config.std }} -Dcpp_channel_build_examples=ON -Dcpp_channel_build_tests=ON + run: cmake ${{ github.workspace }} -DCMAKE_BUILD_TYPE=${{ matrix.config.build_type }} -DCMAKE_CXX_STANDARD=${{ matrix.config.std }} -DCPP_CHANNEL_BUILD_EXAMPLES=ON -DCPP_CHANNEL_BUILD_TESTS=ON - name: Build working-directory: ${{github.workspace}}/build @@ -93,7 +93,7 @@ jobs: - name: Configure CMake working-directory: ${{github.workspace}}/build - run: cmake ${{ github.workspace }} -DCMAKE_BUILD_TYPE=Debug -Dcpp_channel_build_tests=ON -Dcpp_channel_coverage=ON + run: cmake ${{ github.workspace }} -DCMAKE_BUILD_TYPE=Debug -DCPP_CHANNEL_BUILD_TESTS=ON -DCPP_CHANNEL_COVERAGE=ON - name: Build working-directory: ${{github.workspace}}/build diff --git a/.vscode/settings.json b/.vscode/settings.json index fedcb41..04ad36a 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,8 +1,8 @@ { "cmake.configureArgs": [ - "-Dcpp_channel_build_examples=ON", - "-Dcpp_channel_build_tests=ON", - "-Dcpp_channel_coverage=ON", + "-DCPP_CHANNEL_BUILD_EXAMPLES=ON", + "-DCPP_CHANNEL_BUILD_TESTS=ON", + "-DCPP_CHANNEL_COVERAGE=ON", "-DCMAKE_CXX_STANDARD=11" ], "clang-tidy.fixOnSave": false, diff --git a/CMakeLists.txt b/CMakeLists.txt index eacea7e..889e8a2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,15 +14,15 @@ include_directories(include) add_library(msd_channel INTERFACE) target_include_directories(msd_channel INTERFACE include) -option(cpp_channel_build_tests "Build all of cpp_channel's own tests." OFF) -option(cpp_channel_build_examples "Build cpp_channel's example programs." OFF) -option(cpp_channel_coverage "Generate test coverage." OFF) +option(CPP_CHANNEL_BUILD_TESTS "Build all of cpp_channel's own tests." OFF) +option(CPP_CHANNEL_BUILD_EXAMPLES "Build cpp_channel's example programs." OFF) +option(CPP_CHANNEL_COVERAGE "Generate test coverage." OFF) -if (cpp_channel_build_tests) +if (CPP_CHANNEL_BUILD_TESTS) enable_testing() add_subdirectory(tests) endif() -if (cpp_channel_build_examples) +if (CPP_CHANNEL_BUILD_EXAMPLES) add_subdirectory(examples) endif() diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index fd3f5f8..c831e33 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -23,7 +23,7 @@ function(package_add_test TESTNAME) set_target_warnings(${TESTNAME} PRIVATE) target_link_libraries(${TESTNAME} gtest gtest_main) - if (cpp_channel_coverage) + if (CPP_CHANNEL_COVERAGE) target_link_libraries(${TESTNAME} -lgcov -lubsan) target_compile_options(${TESTNAME} PRIVATE --coverage -fsanitize=undefined) endif () From f07f978af7884df2d77c98f3603424f5dfa55eaa Mon Sep 17 00:00:00 2001 From: Andrei Avram <6795248+andreiavrammsd@users.noreply.github.com> Date: Sat, 7 Jun 2025 19:46:45 +0300 Subject: [PATCH 10/13] Add CPP_CHANNEL_SANITIZERS cmake option --- .github/workflows/cmake.yml | 13 ++++++++++++- .vscode/settings.json | 1 + CMakeLists.txt | 1 + 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index befc91a..4fcfe90 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -33,30 +33,35 @@ jobs: os: ubuntu-24.04, build_type: "Debug", std: "11", + sanitizers: "ON", } - { name: "Ubuntu Latest GCC, C++17 (Debug)", os: ubuntu-latest, build_type: "Debug", std: "17", + sanitizers: "OFF", } - { name: "Ubuntu Latest GCC, C++11 (Release)", os: ubuntu-latest, build_type: "Release", std: "11", + sanitizers: "OFF", } - { name: "macOS Latest Clang, C++11 (Release)", os: macos-latest, build_type: "Release", std: "11", + sanitizers: "OFF", } - { name: "Windows Latest, C++11 (Release)", os: windows-latest, build_type: "Release", std: "11", + sanitizers: "OFF", } steps: @@ -67,7 +72,13 @@ jobs: - name: Configure CMake working-directory: ${{github.workspace}}/build - run: cmake ${{ github.workspace }} -DCMAKE_BUILD_TYPE=${{ matrix.config.build_type }} -DCMAKE_CXX_STANDARD=${{ matrix.config.std }} -DCPP_CHANNEL_BUILD_EXAMPLES=ON -DCPP_CHANNEL_BUILD_TESTS=ON + run: | + cmake ${{ github.workspace }} \ + -DCMAKE_BUILD_TYPE=${{ matrix.config.build_type }} \ + -DCMAKE_CXX_STANDARD=${{ matrix.config.std }} \ + -DCPP_CHANNEL_BUILD_EXAMPLES=ON \ + -DCPP_CHANNEL_BUILD_TESTS=ON \ + -DCPP_CHANNEL_SANITIZERS=${{ matrix.config.sanitizers }} - name: Build working-directory: ${{github.workspace}}/build diff --git a/.vscode/settings.json b/.vscode/settings.json index 04ad36a..c8217dc 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -3,6 +3,7 @@ "-DCPP_CHANNEL_BUILD_EXAMPLES=ON", "-DCPP_CHANNEL_BUILD_TESTS=ON", "-DCPP_CHANNEL_COVERAGE=ON", + "-DCPP_CHANNEL_SANITIZERS=ON", "-DCMAKE_CXX_STANDARD=11" ], "clang-tidy.fixOnSave": false, diff --git a/CMakeLists.txt b/CMakeLists.txt index 889e8a2..f124e51 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,6 +17,7 @@ target_include_directories(msd_channel INTERFACE include) option(CPP_CHANNEL_BUILD_TESTS "Build all of cpp_channel's own tests." OFF) option(CPP_CHANNEL_BUILD_EXAMPLES "Build cpp_channel's example programs." OFF) option(CPP_CHANNEL_COVERAGE "Generate test coverage." OFF) +option(CPP_CHANNEL_SANITIZERS "Build with sanitizers." OFF) if (CPP_CHANNEL_BUILD_TESTS) enable_testing() From 2a9972dc1d8786e5b855c26c22304ffb0acfc27e Mon Sep 17 00:00:00 2001 From: Andrei Avram <6795248+andreiavrammsd@users.noreply.github.com> Date: Sat, 7 Jun 2025 19:50:26 +0300 Subject: [PATCH 11/13] Use bash shell --- .github/workflows/cmake.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 4fcfe90..cdce49c 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -71,6 +71,7 @@ jobs: run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake + shell: bash working-directory: ${{github.workspace}}/build run: | cmake ${{ github.workspace }} \ From c462807d942cbd75f5876e7c1378e38b0760e948 Mon Sep 17 00:00:00 2001 From: Andrei Avram <6795248+andreiavrammsd@users.noreply.github.com> Date: Sat, 7 Jun 2025 19:52:39 +0300 Subject: [PATCH 12/13] Single line cmd --- .github/workflows/cmake.yml | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index cdce49c..74d5e11 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -71,15 +71,8 @@ jobs: run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake - shell: bash working-directory: ${{github.workspace}}/build - run: | - cmake ${{ github.workspace }} \ - -DCMAKE_BUILD_TYPE=${{ matrix.config.build_type }} \ - -DCMAKE_CXX_STANDARD=${{ matrix.config.std }} \ - -DCPP_CHANNEL_BUILD_EXAMPLES=ON \ - -DCPP_CHANNEL_BUILD_TESTS=ON \ - -DCPP_CHANNEL_SANITIZERS=${{ matrix.config.sanitizers }} + run: cmake ${{ github.workspace }} -DCMAKE_BUILD_TYPE=${{ matrix.config.build_type }} -DCMAKE_CXX_STANDARD=${{ matrix.config.std }} -DCPP_CHANNEL_BUILD_EXAMPLES=ON -DCPP_CHANNEL_BUILD_TESTS=ON -DCPP_CHANNEL_SANITIZERS=${{ matrix.config.sanitizers }} - name: Build working-directory: ${{github.workspace}}/build From 4233faf2720020a146af28da737781d32463f262 Mon Sep 17 00:00:00 2001 From: Andrei Avram <6795248+andreiavrammsd@users.noreply.github.com> Date: Sat, 7 Jun 2025 19:57:48 +0300 Subject: [PATCH 13/13] Use CPP_CHANNEL_SANITIZERS --- tests/CMakeLists.txt | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index c831e33..1a70fa2 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -24,8 +24,13 @@ function(package_add_test TESTNAME) target_link_libraries(${TESTNAME} gtest gtest_main) if (CPP_CHANNEL_COVERAGE) - target_link_libraries(${TESTNAME} -lgcov -lubsan) - target_compile_options(${TESTNAME} PRIVATE --coverage -fsanitize=undefined) + target_link_libraries(${TESTNAME} -lgcov) + target_compile_options(${TESTNAME} PRIVATE --coverage) + endif () + + if (CPP_CHANNEL_SANITIZERS) + target_link_libraries(${TESTNAME} -lubsan) + target_compile_options(${TESTNAME} PRIVATE -fsanitize=undefined) endif () add_test(NAME ${TESTNAME} COMMAND ${TESTNAME})