ROCMClang.cmake 1.2 KB

1234567891011121314151617181920212223242526272829303132333435
  1. # Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  2. # file Copyright.txt or https://cmake.org/licensing for details.
  3. # This module is shared by multiple languages; use include blocker.
  4. include_guard()
  5. include(Compiler/CMakeCommonCompilerMacros)
  6. macro(__compiler_rocmclang lang)
  7. set(CMAKE_${lang}_VERBOSE_FLAG "-v")
  8. if(NOT "x${CMAKE_${lang}_SIMULATE_ID}" STREQUAL "xMSVC")
  9. # Feature flags.
  10. set(CMAKE_${lang}_COMPILE_OPTIONS_PIC "-fPIC")
  11. set(CMAKE_${lang}_COMPILE_OPTIONS_PIE "-fPIE")
  12. set(CMAKE_HIP_COMPILE_OPTIONS_VISIBILITY -fvisibility=)
  13. string(APPEND CMAKE_HIP_FLAGS_INIT " ")
  14. string(APPEND CMAKE_HIP_FLAGS_DEBUG_INIT " -g")
  15. string(APPEND CMAKE_HIP_FLAGS_RELEASE_INIT " -O3 -DNDEBUG")
  16. string(APPEND CMAKE_HIP_FLAGS_MINSIZEREL_INIT " -Os -DNDEBUG")
  17. string(APPEND CMAKE_HIP_FLAGS_RELWITHDEBINFO_INIT " -O2 -g -DNDEBUG")
  18. endif()
  19. set(CMAKE_SHARED_LIBRARY_CREATE_HIP_FLAGS -shared)
  20. set(CMAKE_INCLUDE_SYSTEM_FLAG_HIP "-isystem ")
  21. set(CMAKE_${lang}_USE_RESPONSE_FILE_FOR_INCLUDES 1)
  22. set(CMAKE_${lang}_USE_RESPONSE_FILE_FOR_LIBRARIES 1)
  23. set(CMAKE_${lang}_USE_RESPONSE_FILE_FOR_OBJECTS 1)
  24. set(CMAKE_${lang}_RESPONSE_FILE_FLAG "@")
  25. set(CMAKE_${lang}_RESPONSE_FILE_LINK_FLAG "@")
  26. endmacro()