diff --git a/.github/workflows/platform_gnu_linux.yml b/.github/workflows/platform_gnu_linux.yml index c66daba..f588b1b 100644 --- a/.github/workflows/platform_gnu_linux.yml +++ b/.github/workflows/platform_gnu_linux.yml @@ -37,7 +37,7 @@ jobs: with: submodules: 'true' - name: Configure - run: cmake -S . -B build + run: cmake -S . -B build -DBYTEPACK_BUILD_TESTS=ON - name: Build run: cmake --build build - name: Run tests diff --git a/.github/workflows/platform_macos.yml b/.github/workflows/platform_macos.yml index 06f98a5..b667222 100644 --- a/.github/workflows/platform_macos.yml +++ b/.github/workflows/platform_macos.yml @@ -18,7 +18,7 @@ jobs: with: submodules: 'true' - name: Configure - run: cmake -S . -B build + run: cmake -S . -B build -DBYTEPACK_BUILD_TESTS=ON - name: Build run: cmake --build build - name: Run tests diff --git a/.github/workflows/platform_windows.yml b/.github/workflows/platform_windows.yml index 515441d..e21677e 100644 --- a/.github/workflows/platform_windows.yml +++ b/.github/workflows/platform_windows.yml @@ -15,7 +15,7 @@ jobs: with: submodules: 'true' - name: Configure - run: cmake -S . -B build -DCMAKE_CXX_STANDARD=20 + run: cmake -S . -B build -DCMAKE_CXX_STANDARD=20 -DBYTEPACK_BUILD_TESTS=ON - name: Build run: cmake --build build --config Release - name: Run tests diff --git a/CMakeLists.txt b/CMakeLists.txt index 95f220d..6577ad1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,7 +15,11 @@ endif() add_library(bytepack INTERFACE) target_include_directories(bytepack INTERFACE ${PROJECT_SOURCE_DIR}/include) -add_subdirectory(extern/Catch2) - -enable_testing() -add_subdirectory(test) +# Option for building tests +option(BYTEPACK_BUILD_TESTS "Build the BytePack tests" OFF) +if(BYTEPACK_BUILD_TESTS) + message("Build the BytePack tests") + add_subdirectory(extern/Catch2) + enable_testing() + add_subdirectory(test) +endif()