Skip to content

Commit 625ee13

Browse files
committed
Force serial accelerator for tests
1 parent 2332d99 commit 625ee13

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

CMakeLists.txt

+11-6
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,17 @@ if(PROJECT_SOURCE_DIR STREQUAL PROJECT_BINARY_DIR)
1717
)
1818
endif()
1919

20+
# ---- Options ----
21+
22+
option(mallocMC_BUILD_TESTING "Turn on/off building the tests" OFF)
23+
option(mallocMC_BUILD_EXAMPLES "Turn on/off building the examples" OFF)
24+
if (mallocMC_BUILD_TESTING OR mallocMC_BUILD_EXAMPLES)
25+
enable_testing()
26+
endif()
27+
if (mallocMC_BUILD_TESTING)
28+
set(alpaka_ACC_CPU_B_SEQ_T_SEQ_ENABLE ON CACHE BOOL "" FORCE)
29+
endif()
30+
2031
# ---- Add dependencies via CPM ----
2132
# see https://github.com/TheLartians/CPM.cmake for more info
2233

@@ -81,18 +92,12 @@ target_include_directories(
8192
target_link_libraries(${PROJECT_NAME} INTERFACE alpaka::alpaka)
8293

8394

84-
option(mallocMC_BUILD_TESTING "Turn on/off building the tests" OFF)
8595
if(mallocMC_BUILD_TESTING)
86-
enable_testing()
8796
include(${CMAKE_CURRENT_LIST_DIR}/cmake/tools.cmake)
8897
add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/test ${CMAKE_BINARY_DIR}/test)
8998
endif()
9099

91-
option(mallocMC_BUILD_EXAMPLES "Turn on/off building the examples" OFF)
92100
if(mallocMC_BUILD_EXAMPLES)
93-
if (NOT mallocMC_BUILD_TESTING)
94-
enable_testing()
95-
endif()
96101
include(${CMAKE_CURRENT_LIST_DIR}/cmake/tools.cmake)
97102
add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/examples ${CMAKE_BINARY_DIR}/examples)
98103
endif()

0 commit comments

Comments
 (0)