Skip to content

Commit

Permalink
Refactor Catch2 CMake to reuse existing build system.
Browse files Browse the repository at this point in the history
  • Loading branch information
Allison Vacanti authored and gevtushenko committed Dec 3, 2022
1 parent 01a2388 commit eb08906
Show file tree
Hide file tree
Showing 4 changed files with 129 additions and 214 deletions.
16 changes: 0 additions & 16 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,6 @@ option(CUB_ENABLE_HEADER_TESTING "Test that all public headers compile." ON)
option(CUB_ENABLE_TESTING "Build CUB testing suite." ON)
option(CUB_ENABLE_EXAMPLES "Build CUB examples." ON)

option(CUB_ENABLE_CT_PROFILING "Enable compilation time profiling" OFF)

if ("NVCXX" STREQUAL "${CMAKE_CUDA_COMPILER_ID}")
# NVBugs 200770766
set(CUB_SEPARATE_CATCH2 ON)
else ()
option(CUB_SEPARATE_CATCH2 "Build each catch2 as a separate executable." OFF)
endif ()
# This is needed for NVCXX QA, which requires a static set of executable names.
# Only a single dialect may be enabled when this is off.
option(CUB_ENABLE_CPP_DIALECT_IN_NAMES
Expand Down Expand Up @@ -121,14 +113,6 @@ if (CUB_ENABLE_TESTING OR CUB_ENABLE_EXAMPLES)
endif()

if (CUB_ENABLE_TESTING)
include(cmake/CPM.cmake)
CPMAddPackage("gh:catchorg/[email protected]")

option(METAL_BUILD_DOC OFF)
option(METAL_BUILD_EXAMPLES OFF)
option(METAL_BUILD_TESTS OFF)
CPMAddPackage("gh:brunocodutra/[email protected]")

add_subdirectory(test)
endif()

Expand Down
1 change: 1 addition & 0 deletions cmake/CubBuildCompilerTargets.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ function(cub_build_compiler_targets)
endif()

if ("Clang" STREQUAL "${CMAKE_CXX_COMPILER_ID}")
option(CUB_ENABLE_CT_PROFILING "Enable compilation time profiling" OFF)
if (CUB_ENABLE_CT_PROFILING)
append_option_if_available("-ftime-trace" cxx_compile_options)
endif()
Expand Down
Loading

0 comments on commit eb08906

Please sign in to comment.