Skip to content
This repository was archived by the owner on Apr 3, 2024. It is now read-only.

Commit eb08906

Browse files
Allison Vacantigevtushenko
Allison Vacanti
authored andcommitted
Refactor Catch2 CMake to reuse existing build system.
1 parent 01a2388 commit eb08906

File tree

4 files changed

+129
-214
lines changed

4 files changed

+129
-214
lines changed

CMakeLists.txt

-16
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,6 @@ option(CUB_ENABLE_HEADER_TESTING "Test that all public headers compile." ON)
5252
option(CUB_ENABLE_TESTING "Build CUB testing suite." ON)
5353
option(CUB_ENABLE_EXAMPLES "Build CUB examples." ON)
5454

55-
option(CUB_ENABLE_CT_PROFILING "Enable compilation time profiling" OFF)
56-
57-
if ("NVCXX" STREQUAL "${CMAKE_CUDA_COMPILER_ID}")
58-
# NVBugs 200770766
59-
set(CUB_SEPARATE_CATCH2 ON)
60-
else ()
61-
option(CUB_SEPARATE_CATCH2 "Build each catch2 as a separate executable." OFF)
62-
endif ()
6355
# This is needed for NVCXX QA, which requires a static set of executable names.
6456
# Only a single dialect may be enabled when this is off.
6557
option(CUB_ENABLE_CPP_DIALECT_IN_NAMES
@@ -121,14 +113,6 @@ if (CUB_ENABLE_TESTING OR CUB_ENABLE_EXAMPLES)
121113
endif()
122114

123115
if (CUB_ENABLE_TESTING)
124-
include(cmake/CPM.cmake)
125-
CPMAddPackage("gh:catchorg/[email protected]")
126-
127-
option(METAL_BUILD_DOC OFF)
128-
option(METAL_BUILD_EXAMPLES OFF)
129-
option(METAL_BUILD_TESTS OFF)
130-
CPMAddPackage("gh:brunocodutra/[email protected]")
131-
132116
add_subdirectory(test)
133117
endif()
134118

cmake/CubBuildCompilerTargets.cmake

+1
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ function(cub_build_compiler_targets)
7777
endif()
7878

7979
if ("Clang" STREQUAL "${CMAKE_CXX_COMPILER_ID}")
80+
option(CUB_ENABLE_CT_PROFILING "Enable compilation time profiling" OFF)
8081
if (CUB_ENABLE_CT_PROFILING)
8182
append_option_if_available("-ftime-trace" cxx_compile_options)
8283
endif()

0 commit comments

Comments
 (0)