CMakeLists.txt 708 B

1234567891011121314151617181920
  1. cmake_minimum_required(VERSION 3.7)
  2. project (ProperLinkFlags CUDA CXX)
  3. #Goal for this example:
  4. #Verify that when we have CXX and CUDA enabled and we link an executable that
  5. #has CUDA and CXX we use the CUDA link flags when doing the device link
  6. #step
  7. #Specify a set of valid CUDA flags and an invalid set of CXX flags ( for CUDA )
  8. #to make sure we don't use the CXX flags when linking CUDA executables
  9. string(APPEND CMAKE_CUDA_FLAGS " -arch=sm_35 --use_fast_math")
  10. set(CMAKE_CXX_FLAGS "-Wall")
  11. set(CMAKE_CXX_STANDARD 11)
  12. set(CMAKE_CUDA_STANDARD 11)
  13. add_executable(ProperLinkFlags file1.cu main.cxx)
  14. set_target_properties( ProperLinkFlags
  15. PROPERTIES CUDA_SEPARABLE_COMPILATION ON)