diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b666a15..2976f3c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -147,6 +147,6 @@ jobs: steps: - uses: actions/checkout@v4 - uses: hendrikmuhs/ccache-action@v1.2 - - run: cmake -Bbuild -DBUILD_DEPS=ON -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache + - run: cmake -Bbuild -DBUILD_DEPS=ON -DBUILD_TESTING=ON -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache - run: cmake --build build --parallel $(nproc) - run: ctest --test-dir build --output-on-failure --parallel $(nproc) diff --git a/CMakeLists.txt b/CMakeLists.txt index bcc4223..6a7d19c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,9 +7,8 @@ include(CMakePackageConfigHelpers) # for write_basic_package_version_file option(BUILD_DEPS "Use FetchContent download and build dependencies" OFF) -if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) +if(BUILD_TESTING AND CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) set(CMAKE_CXX_STANDARD 20) - set(BUILD_TESTING ON) endif() if(BUILD_DEPS)