ROCMClang-HIP.cmake 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. include(Compiler/ROCMClang)
  2. __compiler_rocmclang(HIP)
  3. set(_CMAKE_COMPILE_AS_HIP_FLAG "-x hip")
  4. set(_CMAKE_HIP_RDC_FLAG "-fgpu-rdc")
  5. if(NOT "x${CMAKE_${lang}_SIMULATE_ID}" STREQUAL "xMSVC")
  6. set(CMAKE_HIP_COMPILE_OPTIONS_VISIBILITY_INLINES_HIDDEN "-fvisibility-inlines-hidden")
  7. string(APPEND CMAKE_HIP_FLAGS_DEBUG_INIT " -O")
  8. endif()
  9. if(CMAKE_HIP_SIMULATE_ID STREQUAL "GNU")
  10. set(CMAKE_HIP_LINKER_WRAPPER_FLAG "-Wl,")
  11. set(CMAKE_HIP_LINKER_WRAPPER_FLAG_SEP ",")
  12. elseif(CMAKE_HIP_SIMULATE_ID STREQUAL "Clang")
  13. set(CMAKE_HIP_LINKER_WRAPPER_FLAG "-Xlinker" " ")
  14. set(CMAKE_HIP_LINKER_WRAPPER_FLAG_SEP)
  15. endif()
  16. if(NOT CMAKE_HIP_COMPILER_VERSION VERSION_LESS 1.0)
  17. set(CMAKE_HIP98_STANDARD_COMPILE_OPTION "-std=c++98")
  18. set(CMAKE_HIP98_EXTENSION_COMPILE_OPTION "-std=gnu++98")
  19. set(CMAKE_HIP98_STANDARD__HAS_FULL_SUPPORT ON)
  20. set(CMAKE_HIP11_STANDARD_COMPILE_OPTION "-std=c++11")
  21. set(CMAKE_HIP11_EXTENSION_COMPILE_OPTION "-std=gnu++11")
  22. set(CMAKE_HIP11_STANDARD__HAS_FULL_SUPPORT ON)
  23. set(CMAKE_HIP14_STANDARD_COMPILE_OPTION "-std=c++14")
  24. set(CMAKE_HIP14_EXTENSION_COMPILE_OPTION "-std=gnu++14")
  25. set(CMAKE_HIP14_STANDARD__HAS_FULL_SUPPORT ON)
  26. set(CMAKE_HIP17_STANDARD_COMPILE_OPTION "-std=c++17")
  27. set(CMAKE_HIP17_EXTENSION_COMPILE_OPTION "-std=gnu++17")
  28. set(CMAKE_HIP17_STANDARD__HAS_FULL_SUPPORT ON)
  29. set(CMAKE_HIP20_STANDARD_COMPILE_OPTION "-std=c++20")
  30. set(CMAKE_HIP20_EXTENSION_COMPILE_OPTION "-std=gnu++20")
  31. endif()
  32. set(CMAKE_HIP_RUNTIME_LIBRARY_DEFAULT "SHARED")
  33. set(CMAKE_HIP_RUNTIME_LIBRARY_LINK_OPTIONS_STATIC "")
  34. set(CMAKE_HIP_RUNTIME_LIBRARY_LINK_OPTIONS_SHARED "")
  35. # Populated by CMakeHIPRuntime.cmake
  36. set(CMAKE_HIP_RUNTIME_LIBRARIES_STATIC "")
  37. set(CMAKE_HIP_RUNTIME_LIBRARIES_SHARED "")
  38. __compiler_check_default_language_standard(HIP 3.5 11)