1# Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
2# file Copyright.txt or https://cmake.org/licensing for details.
3
4
5# This module is shared by multiple languages; use include blocker.
6if(__SUNOS_COMPILER_GNU)
7  return()
8endif()
9set(__SUNOS_COMPILER_GNU 1)
10
11macro(__sunos_compiler_gnu lang)
12  set(CMAKE_SHARED_LIBRARY_RUNTIME_${lang}_FLAG "-Wl,-R")
13  set(CMAKE_SHARED_LIBRARY_RUNTIME_${lang}_FLAG_SEP ":")
14  set(CMAKE_SHARED_LIBRARY_RPATH_ORIGIN_TOKEN "\$ORIGIN")
15  set(CMAKE_SHARED_LIBRARY_SONAME_${lang}_FLAG "-Wl,-h")
16
17  # Initialize C link type selection flags.  These flags are used when
18  # building a shared library, shared module, or executable that links
19  # to other libraries to select whether to use the static or shared
20  # versions of the libraries.
21  foreach(type SHARED_LIBRARY SHARED_MODULE EXE)
22    set(CMAKE_${type}_LINK_STATIC_${lang}_FLAGS "-Wl,-Bstatic")
23    set(CMAKE_${type}_LINK_DYNAMIC_${lang}_FLAGS "-Wl,-Bdynamic")
24  endforeach()
25endmacro()
26