1 IF(EXISTS /usr/include/dlfcn.h)
3 SET(CMAKE_SHARED_LIBRARY_C_FLAGS "-fPIC") # -pic
4 SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-shared") # -shared
5 SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "") # +s, flag for exe link to use shared lib
6 SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "-Wl,-rpath,") # -rpath
7 SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP ":") # : or empty
8 SET(CMAKE_SHARED_LIBRARY_RPATH_LINK_C_FLAG "-Wl,-rpath-link,")
9 SET(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "-Wl,-soname,")
10 SET(CMAKE_SHARED_LIBRARY_SONAME_CXX_FLAG "-Wl,-soname,")
11 SET(CMAKE_EXE_EXPORTS_C_FLAG "-Wl,--export-dynamic")
12 SET(CMAKE_EXE_EXPORTS_CXX_FLAG "-Wl,--export-dynamic")
13 ENDIF(EXISTS /usr/include/dlfcn.h)
15 # Shared libraries with no builtin soname may not be linked safely by
16 # specifying the file path.
17 SET(CMAKE_PLATFORM_USES_PATH_WHEN_NO_SONAME 1)
19 # Initialize C link type selection flags. These flags are used when
20 # building a shared library, shared module, or executable that links
21 # to other libraries to select whether to use the static or shared
22 # versions of the libraries.
23 FOREACH(type SHARED_LIBRARY SHARED_MODULE EXE)
24 SET(CMAKE_${type}_LINK_STATIC_C_FLAGS "-Wl,-Bstatic")
25 SET(CMAKE_${type}_LINK_DYNAMIC_C_FLAGS "-Wl,-Bdynamic")
28 INCLUDE(Platform/UnixPaths)