SunOS-GNU.cmake 1.4 KB

12345678910111213141516171819202122232425262728293031323334
  1. #=============================================================================
  2. # Copyright 2002-2009 Kitware, Inc.
  3. #
  4. # Distributed under the OSI-approved BSD License (the "License");
  5. # see accompanying file Copyright.txt for details.
  6. #
  7. # This software is distributed WITHOUT ANY WARRANTY; without even the
  8. # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  9. # See the License for more information.
  10. #=============================================================================
  11. # (To distribute this file outside of CMake, substitute the full
  12. # License text for the above reference.)
  13. # This module is shared by multiple languages; use include blocker.
  14. if(__SUNOS_COMPILER_GNU)
  15. return()
  16. endif()
  17. set(__SUNOS_COMPILER_GNU 1)
  18. macro(__sunos_compiler_gnu lang)
  19. set(CMAKE_SHARED_LIBRARY_RUNTIME_${lang}_FLAG "-Wl,-R")
  20. set(CMAKE_SHARED_LIBRARY_RUNTIME_${lang}_FLAG_SEP ":")
  21. set(CMAKE_SHARED_LIBRARY_SONAME_${lang}_FLAG "-Wl,-h")
  22. # Initialize C link type selection flags. These flags are used when
  23. # building a shared library, shared module, or executable that links
  24. # to other libraries to select whether to use the static or shared
  25. # versions of the libraries.
  26. foreach(type SHARED_LIBRARY SHARED_MODULE EXE)
  27. set(CMAKE_${type}_LINK_STATIC_${lang}_FLAGS "-Wl,-Bstatic")
  28. set(CMAKE_${type}_LINK_DYNAMIC_${lang}_FLAGS "-Wl,-Bdynamic")
  29. endforeach()
  30. endmacro()