Skip to content

Commit

Permalink
Merge pull request #646 from basnijholt/no-public-link-targets
Browse files Browse the repository at this point in the history
Fix: Consistent Usage of `target_link_libraries` for CUDA Targets
  • Loading branch information
NoureldinYosri authored Jan 26, 2024
2 parents 3bdec77 + 94f5ca9 commit 83839cc
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pybind_interface/cuda/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ set_target_properties(qsim_cuda PROPERTIES
)
set_source_files_properties(pybind_main_cuda.cpp PROPERTIES LANGUAGE CUDA)

target_link_libraries(qsim_cuda PUBLIC OpenMP::OpenMP_CXX)
target_link_libraries(qsim_cuda OpenMP::OpenMP_CXX)
2 changes: 1 addition & 1 deletion pybind_interface/custatevec/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,4 @@ set_target_properties(qsim_custatevec PROPERTIES
)
set_source_files_properties(pybind_main_custatevec.cpp PROPERTIES LANGUAGE CUDA)

target_link_libraries(qsim_custatevec PUBLIC OpenMP::OpenMP_CXX)
target_link_libraries(qsim_custatevec OpenMP::OpenMP_CXX)
4 changes: 3 additions & 1 deletion pybind_interface/decide/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ if(has_nvcc)
SUFFIX "${PYTHON_MODULE_EXTENSION}"
)
set_source_files_properties(decide.cpp PROPERTIES LANGUAGE CUDA)
target_link_libraries(qsim_decide OpenMP::OpenMP_CXX)
elseif(has_hipcc)
list(APPEND CMAKE_MODULE_PATH "/opt/rocm/lib/cmake/hip")
find_package(HIP REQUIRED)
Expand All @@ -41,8 +42,9 @@ elseif(has_hipcc)
PREFIX "${PYTHON_MODULE_PREFIX}"
SUFFIX "${PYTHON_MODULE_EXTENSION}"
)
target_link_libraries(qsim_decide PUBLIC OpenMP::OpenMP_CXX)
else()
pybind11_add_module(qsim_decide decide.cpp)
target_link_libraries(qsim_decide PUBLIC OpenMP::OpenMP_CXX)
endif()

target_link_libraries(qsim_decide PUBLIC OpenMP::OpenMP_CXX)

0 comments on commit 83839cc

Please sign in to comment.