diff --git a/CMakeLists.txt b/CMakeLists.txt index 6941ccbea..171243743 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -162,9 +162,6 @@ option(ENABLE_CUDA_TEST_CASES "" OFF) if(ENABLE_CUDA_TEST_CASES) include(CheckLanguage) check_language(CUDA) - if(DEFINED CMAKE_CUDA_COMPILER) - set(ENABLE_CUDA_TEST_CASES ON) - endif(DEFINED CMAKE_CUDA_COMPILER) endif(ENABLE_CUDA_TEST_CASES) if(BUILD_TESTS) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index f2c94d8e5..3ce15f5fb 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -32,7 +32,7 @@ else() endif(ENABLE_CXX_MODULES_TEST_CASES) if(NOT ENABLE_CUDA_TEST_CASES) - message(STATUS "Enabling CUDA test cases") + message(STATUS "Disabling CUDA test cases") foreach(CUDA_TC ${TEST_CASES_REQUIRING_CUDA}) list(FILTER TEST_CASE_SOURCES EXCLUDE @@ -112,7 +112,8 @@ foreach(TEST_NAME ${TEST_NAMES}) $) target_compile_definitions(${TEST_NAME} PRIVATE $<$:ENABLE_CXX_STD_20_TEST_CASES> - $<$:ENABLE_CXX_MODULES_TEST_CASES>) + $<$:ENABLE_CXX_MODULES_TEST_CASES> + $<$:ENABLE_CUDA_TEST_CASES>) target_compile_options(${TEST_NAME} PRIVATE $<$: $<$,$>: diff --git a/tests/test_cases.cc b/tests/test_cases.cc index 080737f34..5797bf671 100644 --- a/tests/test_cases.cc +++ b/tests/test_cases.cc @@ -475,9 +475,11 @@ using namespace clanguml::test::matchers; #include "t20046/test_case.h" #include "t20047/test_case.h" #include "t20048/test_case.h" +#if defined(ENABLE_CUDA_TEST_CASES) #include "t20049/test_case.h" #include "t20050/test_case.h" #include "t20051/test_case.h" +#endif /// /// Package diagram tests