Fix: Consistent Usage of target_link_libraries
for CUDA Targets
#646
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request addresses a build configuration issue that arises (introduced in #643) when mixing plain and keyword signatures of
target_link_libraries
in CMake for theqsim_cuda
,qsim_custatevec
,qsim_decide
targets. The existing setup led to a CMake error, as documented:Changes Made:
target_link_libraries
command for theqsim_cuda
,qsim_custatevec
,qsim_decide
targets to use the plain form. This change aligns with the internal usage oftarget_link_libraries
within thecuda_add_library
macro, ensuring consistency across the build configuration.Rationale:
CMake requires that all invocations of
target_link_libraries
for a specific target maintain a consistent usage pattern - either all using the plain form or all using the keyword form (such asPUBLIC
orPRIVATE
). Thecuda_add_library
macro used in this project employs the plain form oftarget_link_libraries
, which necessitates a similar approach for additional invocations oftarget_link_libraries
for theqsim_cuda
,qsim_custatevec
,qsim_decide
targets.By aligning the usage pattern, this pull request resolves the build configuration error and maintains consistency in the CMake setup, ensuring a smoother build process.