Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Work around CMake restriction since 3.25 on setting properties of targets built outside of project #558

Closed
eyalroz opened this issue Dec 21, 2023 · 0 comments

Comments

@eyalroz
Copy link
Owner

eyalroz commented Dec 21, 2023

When using cuda-api-wrappers through FetchContent, with recent CMake versions (3.25.3 and later, perhaps any 3.25), we get a complaint about this line:

target_link_libraries(CUDA::nvptxcompiler_static INTERFACE Threads::Threads) 

apparently, CMake doesn't like us doing that:

CMake Error at build/_deps/foo-src/CMakeLists.txt:80 (target_link_libraries):
  Cannot specify link libraries for target "CUDA::nvptxcompiler_static" which
  is not built by this project.

I think it's fine, and so did CMake up to v3.24, but - let's be courteous and make it a dependency of the wrappers, not the PTX compiler.

@eyalroz eyalroz self-assigned this Dec 21, 2023
eyalroz pushed a commit that referenced this issue Dec 21, 2023
…hreads library, let's have _us_ depend on it - so as not to anger certain versions of CMake.
eyalroz added a commit that referenced this issue Dec 22, 2023
* Not trying to create the `nvptxcompiler` and `nvptxcompiler_static targets if they already exist
* Some code duplication avoidance
eyalroz added a commit that referenced this issue Dec 31, 2023
* Not trying to create the `nvptxcompiler` and `nvptxcompiler_static targets if they already exist
* Some code duplication avoidance
@eyalroz eyalroz closed this as completed in 4607729 Jan 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant