AIX-GNU.cmake 1.2 KB

123456789101112131415161718192021222324252627282930
  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(__AIX_COMPILER_GNU)
  5. return()
  6. endif()
  7. set(__AIX_COMPILER_GNU 1)
  8. #
  9. # By default, runtime linking is enabled. All shared objects specified on the command line
  10. # will be listed, even if there are no symbols referenced, in the output file.
  11. string(APPEND CMAKE_SHARED_LINKER_FLAGS_INIT " -Wl,-brtl")
  12. string(APPEND CMAKE_MODULE_LINKER_FLAGS_INIT " -Wl,-brtl")
  13. string(APPEND CMAKE_EXE_LINKER_FLAGS_INIT " -Wl,-brtl")
  14. macro(__aix_compiler_gnu lang)
  15. set(CMAKE_SHARED_LIBRARY_RUNTIME_${lang}_FLAG "-Wl,-blibpath:")
  16. set(CMAKE_SHARED_LIBRARY_RUNTIME_${lang}_FLAG_SEP ":")
  17. string(APPEND CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS " -Wl,-G,-bnoipath")
  18. set(CMAKE_SHARED_LIBRARY_LINK_${lang}_FLAGS "-Wl,-bexpall")
  19. set(CMAKE_${lang}_USE_IMPLICIT_LINK_DIRECTORIES_IN_RUNTIME_PATH 1)
  20. set(CMAKE_${lang}_LINK_FLAGS "-Wl,-bnoipath")
  21. if(CMAKE_${lang}_COMPILER_VERSION VERSION_LESS 7 OR CMAKE_SYSTEM_VERSION VERSION_LESS 7.1)
  22. unset(CMAKE_${lang}_COMPILE_OPTIONS_VISIBILITY)
  23. endif()
  24. endmacro()