Skip to content

Commit

Permalink
Fixes #699: static targets
Browse files Browse the repository at this point in the history
* Now exporting `_static` versions of our targets - which indicate the eventual executable should link ingainst the `_static` versions of `CUDA::` targets.
* Added an configuration option for building the example programs statically
  • Loading branch information
Eyal Rozenberg authored and Eyal Rozenberg committed Dec 5, 2024
1 parent 3a63d70 commit 265f469
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ foreach(wrapper_lib ${targets})
WINDOWS_EXPORT_ALL_SYMBOLS ON
)
endforeach()

foreach(static_suffix "" "_static")
add_library(${caw_namespace}::driver-and-runtime${static_suffix} ALIAS caw_runtime-and-driver${static_suffix})
target_link_libraries(caw_rtc${static_suffix} INTERFACE cuda-api-wrappers::runtime-and-driver${static_suffix} CUDA::nvrtc${static_suffix})
Expand Down Expand Up @@ -125,7 +126,7 @@ if(CUDAToolkit_VERSION VERSION_GREATER_EQUAL 12.4)

if (TARGET CUDA::nvfatbin_static)
target_link_libraries(caw_fatbin_static INTERFACE CUDA::nvfatbin_static)
elseif(EXISTS "${CUDA_nvfatbin_static_LIBRARY}")
elseif(EXISTS "${CUDA_nvfatbin_static_LIBRARY}")
target_link_libraries(caw_fatbin_static INTERFACE "${CUDA_nvfatbin_static_LIBRARY}")
else()
message(WARNING "Could not locate a valid NVIDIA non-fatbin creator target or library file")
Expand All @@ -138,7 +139,6 @@ if(CUDAToolkit_VERSION VERSION_GREATER_EQUAL 12.4)
else()
message(WARNING "Could not locate the cufilt demangling library")
endif()

endif()

foreach(tgt_base caw_fatbin caw_nvtx)
Expand Down

0 comments on commit 265f469

Please sign in to comment.