Linux-GNU.cmake 793 B

12345678910111213141516171819202122
  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. if(__LINUX_COMPILER_GNU)
  5. return()
  6. endif()
  7. set(__LINUX_COMPILER_GNU 1)
  8. macro(__linux_compiler_gnu lang)
  9. # We pass this for historical reasons. Projects may have
  10. # executables that use dlopen but do not set ENABLE_EXPORTS.
  11. set(CMAKE_SHARED_LIBRARY_LINK_${lang}_FLAGS "-rdynamic")
  12. # linker selection
  13. set(CMAKE_${lang}_USING_LINKER_SYSTEM "")
  14. set(CMAKE_${lang}_USING_LINKER_LLD "-fuse-ld=lld")
  15. set(CMAKE_${lang}_USING_LINKER_BFD "-fuse-ld=bfd")
  16. set(CMAKE_${lang}_USING_LINKER_GOLD "-fuse-ld=gold")
  17. set(CMAKE_${lang}_USING_LINKER_MOLD "-fuse-ld=mold")
  18. endmacro()