Skip to content

Commit

Permalink
[cmake] do not use FindCUDA, use CUDA language support
Browse files Browse the repository at this point in the history
  • Loading branch information
evaleev authored Jul 17, 2023
1 parent 5ef42cf commit feebbf1
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions src/madness/world/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,17 @@ if(BUILD_TESTING)
add_unittests(world "${WORLD_TEST_SOURCES}" "MADworld;MADgtest" "unittests;short")

if (TARGET PaRSEC::parsec AND PARSEC_HAVE_CUDA)
CMAKE_PUSH_CHECK_STATE()
STRING(REPLACE "-std=c++1z" "" _tmp "${CMAKE_CXX_FLAGS}")
SET(CMAKE_CXX_FLAGS "${_tmp}")
cuda_add_library(MADtest_cuda hello_world.cu EXCLUDE_FROM_ALL)
CMAKE_POP_CHECK_STATE()
target_link_libraries(test_world PRIVATE MADtest_cuda)
include(CheckLanguage)
check_language(CUDA)
if(CMAKE_CUDA_COMPILER)
enable_language(CUDA)
CMAKE_PUSH_CHECK_STATE()
STRING(REPLACE "-std=c++1z" "" _tmp "${CMAKE_CXX_FLAGS}")
SET(CMAKE_CXX_FLAGS "${_tmp}")
add_library(MADtest_cuda hello_world.cu EXCLUDE_FROM_ALL)
CMAKE_POP_CHECK_STATE()
target_link_libraries(test_world PRIVATE MADtest_cuda)
endif(CMAKE_CUDA_COMPILER)
endif ()

set_tests_properties(madness/test/world/test_googletest/run PROPERTIES WILL_FAIL TRUE)
Expand Down

0 comments on commit feebbf1

Please sign in to comment.