1 SET(CMAKE_SHARED_LIBRARY_PREFIX "lib") # lib
2 SET(CMAKE_SHARED_LIBRARY_SUFFIX ".so") # .so
3 SET(CMAKE_DL_LIBS "-lld")
5 # RPATH support on AIX is called libpath. By default the runtime
6 # libpath is paths specified by -L followed by /usr/lib and /lib. In
7 # order to prevent the -L paths from being used we must force use of
8 # -Wl,-blibpath:/usr/lib:/lib whether RPATH support is on or not.
9 # When our own RPATH is to be added it may be inserted before the
11 SET(CMAKE_PLATFORM_REQUIRED_RUNTIME_PATH /usr/lib /lib)
12 SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "-Wl,-blibpath:")
13 SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP ":")
15 # Files named "libfoo.a" may actually be shared libraries.
16 SET_PROPERTY(GLOBAL PROPERTY TARGET_ARCHIVES_MAY_BE_SHARED_LIBS 1)
19 IF(CMAKE_COMPILER_IS_GNUCXX)
20 SET(CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS "-shared -Wl,-G") # -shared
21 ELSE(CMAKE_COMPILER_IS_GNUCXX)
22 SET(CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS "-G -Wl,-brtl,-bnoipath") # -shared
23 SET(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "-Wl,-brtl,-bnoipath,-bexpall") # +s, flag for exe link to use shared lib
24 SET(CMAKE_SHARED_LIBRARY_CXX_FLAGS " ")
25 SET(CMAKE_SHARED_MODULE_CXX_FLAGS " ")
26 SET (CMAKE_CXX_FLAGS_DEBUG_INIT "-g")
27 SET (CMAKE_CXX_FLAGS_RELEASE_INIT "-O -DNDEBUG")
28 SET (CMAKE_CXX_FLAGS_MINSIZEREL_INIT "-O -DNDEBUG")
29 SET (CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "-g")
30 ENDIF(CMAKE_COMPILER_IS_GNUCXX)
33 IF(CMAKE_COMPILER_IS_GNUCC)
34 SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-shared -Wl,-G") # -shared
35 ELSE(CMAKE_COMPILER_IS_GNUCC)
36 SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-G -Wl,-brtl,-bnoipath") # -shared
37 SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "-Wl,-brtl,-bnoipath,-bexpall") # +s, flag for exe link to use shared lib
38 SET(CMAKE_SHARED_LIBRARY_C_FLAGS " ")
39 SET(CMAKE_SHARED_MODULE_C_FLAGS " ")
40 SET (CMAKE_C_FLAGS_DEBUG_INIT "-g")
41 SET (CMAKE_C_FLAGS_RELEASE_INIT "-O -DNDEBUG")
42 SET (CMAKE_C_FLAGS_MINSIZEREL_INIT "-O -DNDEBUG")
43 SET (CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "-g")
44 ENDIF(CMAKE_COMPILER_IS_GNUCC)
46 IF(NOT CMAKE_COMPILER_IS_GNUCC)
47 SET (CMAKE_C_CREATE_PREPROCESSED_SOURCE "<CMAKE_C_COMPILER> <DEFINES> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
48 SET (CMAKE_C_CREATE_ASSEMBLY_SOURCE "<CMAKE_C_COMPILER> <DEFINES> <FLAGS> -S <SOURCE> -o <ASSEMBLY_SOURCE>")
49 ENDIF(NOT CMAKE_COMPILER_IS_GNUCC)
51 IF(NOT CMAKE_COMPILER_IS_GNUCXX)
52 SET(CMAKE_CXX_COMPILE_OBJECT
53 "<CMAKE_CXX_COMPILER> -+ <DEFINES> <FLAGS> -o <OBJECT> -c <SOURCE>")
54 SET (CMAKE_CXX_CREATE_PREPROCESSED_SOURCE "<CMAKE_CXX_COMPILER> <DEFINES> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
55 SET (CMAKE_CXX_CREATE_ASSEMBLY_SOURCE "<CMAKE_CXX_COMPILER> <DEFINES> <FLAGS> -S <SOURCE> -o <ASSEMBLY_SOURCE>")
56 ENDIF(NOT CMAKE_COMPILER_IS_GNUCXX)
59 # since .a can be a static or shared library on AIX, we can not do this.
60 # at some point if we wanted it, we would have to figure out if a .a is
61 # static or shared, then we could add this back:
63 # Initialize C link type selection flags. These flags are used when
64 # building a shared library, shared module, or executable that links
65 # to other libraries to select whether to use the static or shared
66 # versions of the libraries.
67 #FOREACH(type SHARED_LIBRARY SHARED_MODULE EXE)
68 # SET(CMAKE_${type}_LINK_STATIC_C_FLAGS "-bstatic")
69 # SET(CMAKE_${type}_LINK_DYNAMIC_C_FLAGS "-bdynamic")
72 INCLUDE(Platform/UnixPaths)