Skip to content

Commit

Permalink
Fix clang / nvcc CI build
Browse files Browse the repository at this point in the history
  • Loading branch information
gevtushenko committed Feb 28, 2023
1 parent 5d12837 commit e2dd233
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cmake/CubHeaderTesting.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ function(cub_add_header_test label definitions)
target_compile_definitions(${headertest_target} PRIVATE ${definitions})
cub_clone_target_properties(${headertest_target} ${cub_target})

if (CUB_IN_THRUST)
thrust_fix_clang_nvcc_build_for(${headertest_target})
endif()

add_dependencies(cub.all.headers ${headertest_target})
add_dependencies(${config_prefix}.all ${headertest_target})
endforeach()
Expand Down
4 changes: 4 additions & 0 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ function(cub_add_example target_name_var example_name example_src cub_target)
cub_clone_target_properties(${example_target} ${cub_target})
target_include_directories(${example_target} PRIVATE "${CUB_SOURCE_DIR}/examples")

if (CUB_IN_THRUST)
thrust_fix_clang_nvcc_build_for(${example_target})
endif()

# Add to the active configuration's meta target
add_dependencies(${config_meta_target} ${example_target})

Expand Down
16 changes: 16 additions & 0 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,10 @@ function(cub_add_test target_name_var test_name test_src cub_target)

cub_clone_target_properties(${config_c2h_target} ${cub_target})
target_link_libraries(${config_c2h_target} PRIVATE CUDA::curand ${cub_target})

if (CUB_IN_THRUST)
thrust_fix_clang_nvcc_build_for(${config_c2h_target})
endif()
endif() # config_c2h_target

if (CUB_SEPARATE_CATCH2)
Expand Down Expand Up @@ -191,6 +195,10 @@ function(cub_add_test target_name_var test_name test_src cub_target)
target_link_options(${config_c2run_target} PRIVATE "-cuda")
endif()

if (CUB_IN_THRUST)
thrust_fix_clang_nvcc_build_for(${config_c2run_target})
endif()

add_test(NAME ${config_c2run_target}
COMMAND "$<TARGET_FILE:${config_c2run_target}>"
)
Expand All @@ -200,6 +208,10 @@ function(cub_add_test target_name_var test_name test_src cub_target)
target_link_libraries(${config_c2run_target} PRIVATE ${test_target})
endif() # CUB_SEPARATE_CATCH2

if (CUB_IN_THRUST)
thrust_fix_clang_nvcc_build_for(${test_target})
endif()

target_link_libraries(${test_target} PRIVATE
${cub_target}
${config_c2h_target}
Expand All @@ -220,6 +232,10 @@ function(cub_add_test target_name_var test_name test_src cub_target)
target_include_directories(${test_target} PRIVATE "${CUB_SOURCE_DIR}/test")
target_compile_definitions(${test_target} PRIVATE CUB_DEBUG_HOST_ASSERTIONS)

if (CUB_IN_THRUST)
thrust_fix_clang_nvcc_build_for(${test_target})
endif()

# Add to the active configuration's meta target
add_dependencies(${config_meta_target} ${test_target})

Expand Down

0 comments on commit e2dd233

Please sign in to comment.