Skip to content

Commit

Permalink
Fixed cmake CUDA target defines
Browse files Browse the repository at this point in the history
  • Loading branch information
bkryza committed May 1, 2024
1 parent 35b66be commit 1a3d1c1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
3 changes: 0 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 3 additions & 2 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -112,7 +112,8 @@ foreach(TEST_NAME ${TEST_NAMES})
$<IF:${ENABLE_CXX_STD_20_TEST_CASES},cxx_std_20,cxx_std_17>)
target_compile_definitions(${TEST_NAME} PRIVATE
$<$<EQUAL:${ENABLE_CXX_STD_20_TEST_CASES},1>:ENABLE_CXX_STD_20_TEST_CASES>
$<$<BOOL:${ENABLE_CXX_MODULES_TEST_CASES}>:ENABLE_CXX_MODULES_TEST_CASES>)
$<$<BOOL:${ENABLE_CXX_MODULES_TEST_CASES}>:ENABLE_CXX_MODULES_TEST_CASES>
$<$<BOOL:${ENABLE_CUDA_TEST_CASES}>:ENABLE_CUDA_TEST_CASES>)
target_compile_options(${TEST_NAME} PRIVATE
$<$<COMPILE_LANGUAGE:CXX>:
$<$<OR:$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:GNU>>:
Expand Down
2 changes: 2 additions & 0 deletions tests/test_cases.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1a3d1c1

Please sign in to comment.