|
|
@@ -16,11 +16,11 @@ else()
|
|
|
endif()
|
|
|
|
|
|
#Goal for this example:
|
|
|
-#Build a static library that defines multiple methods and kernels that
|
|
|
-#use each other.
|
|
|
-#Use a custom command to build an executable that uses this static library
|
|
|
-#We do these together to verify that we can get a static library to do
|
|
|
-#device symbol linking, and not have it done when the executable is made
|
|
|
+# Build a static library that defines multiple methods and kernels that
|
|
|
+# use each other.
|
|
|
+# Resolve the device symbols into that static library
|
|
|
+# Verify that we can't use those device symbols from anything that links
|
|
|
+# to the static library
|
|
|
string(APPEND CMAKE_CUDA_FLAGS " -gencode arch=compute_30,code=compute_30")
|
|
|
set(CMAKE_CXX_STANDARD 11)
|
|
|
set(CMAKE_CUDA_STANDARD 11)
|
|
|
@@ -43,6 +43,10 @@ add_custom_command(TARGET CUDAResolveDeviceLib POST_BUILD
|
|
|
endif()
|
|
|
|
|
|
add_executable(CudaOnlyResolveDeviceSymbols main.cu)
|
|
|
+set_target_properties(CudaOnlyResolveDeviceSymbols
|
|
|
+ PROPERTIES
|
|
|
+ CUDA_SEPARABLE_COMPILATION ON)
|
|
|
+
|
|
|
target_link_libraries(CudaOnlyResolveDeviceSymbols PRIVATE CUDAResolveDeviceLib)
|
|
|
|
|
|
if(APPLE)
|