CMakeCommonLinkerInformation.cmake 652 B

123456789101112131415161718
  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 file contains common code blocks used by all the linker information
  4. # files
  5. macro(_cmake_common_linker_platform_flags lang)
  6. # Define configuration for LINK_WHAT_YOU_USE feature
  7. if(CMAKE_EXECUTABLE_FORMAT STREQUAL "ELF")
  8. if(NOT DEFINED CMAKE_${lang}_LINK_WHAT_YOU_USE_FLAG)
  9. set(CMAKE_${lang}_LINK_WHAT_YOU_USE_FLAG "LINKER:--no-as-needed")
  10. endif()
  11. if(NOT DEFINED CMAKE_LINK_WHAT_YOU_USE_CHECK)
  12. set(CMAKE_LINK_WHAT_YOU_USE_CHECK ldd -u -r)
  13. endif()
  14. endif()
  15. endmacro ()