You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

CMakeLists.txt 834 B

123456789101112131415161718192021222324252627
  1. file(GLOB_RECURSE CUDA_STUB src/libcuda.cpp)
  2. file(GLOB_RECURSE NVRTC_STUB src/libnvrtc.cpp)
  3. if(MGE_WITH_CUDA_STUB)
  4. list(APPEND STUB_SRC ${CUDA_STUB})
  5. endif()
  6. if(MGE_WITH_NVRTC_STUB)
  7. list(APPEND STUB_SRC ${NVRTC_STUB})
  8. endif()
  9. if(MSVC OR WIN32)
  10. add_library(cuda-stub STATIC ${STUB_SRC})
  11. else()
  12. add_library(cuda-stub SHARED ${STUB_SRC})
  13. endif()
  14. set_target_properties(cuda-stub PROPERTIES OUTPUT_NAME cuda_stub)
  15. target_compile_definitions(cuda-stub PRIVATE __CUDA_API_VERSION_INTERNAL)
  16. if(MSVC OR WIN32)
  17. target_link_libraries(cuda-stub PRIVATE -Wl,--no-undefined)
  18. else()
  19. target_link_libraries(cuda-stub PRIVATE dl -Wl,--no-undefined)
  20. endif()
  21. target_include_directories(cuda-stub
  22. PRIVATE $<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/genfiles>)
  23. install(TARGETS cuda-stub EXPORT ${MGE_EXPORT_TARGETS})