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 ":")
16 IF(CMAKE_COMPILER_IS_GNUCXX)
17 SET(CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS "-shared -Wl,-G") # -shared
18 ELSE(CMAKE_COMPILER_IS_GNUCXX)
19 SET(CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS "-G -Wl,-brtl,-bnoipath") # -shared
20 SET(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "-Wl,-brtl,-bnoipath,-bexpall") # +s, flag for exe link to use shared lib
21 SET(CMAKE_SHARED_LIBRARY_CXX_FLAGS " ")
22 SET(CMAKE_SHARED_MODULE_CXX_FLAGS " ")
23 SET (CMAKE_CXX_FLAGS_DEBUG_INIT "-g")
24 SET (CMAKE_CXX_FLAGS_RELEASE_INIT "-O -DNDEBUG")
25 SET (CMAKE_CXX_FLAGS_MINSIZEREL_INIT "-O -DNDEBUG")
26 SET (CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "-g")
27 ENDIF(CMAKE_COMPILER_IS_GNUCXX)
30 IF(CMAKE_COMPILER_IS_GNUCC)
31 SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-shared -Wl,-G") # -shared
32 ELSE(CMAKE_COMPILER_IS_GNUCC)
33 SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-G -Wl,-brtl,-bnoipath") # -shared
34 SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "-Wl,-brtl,-bnoipath,-bexpall") # +s, flag for exe link to use shared lib
35 SET(CMAKE_SHARED_LIBRARY_C_FLAGS " ")
36 SET(CMAKE_SHARED_MODULE_C_FLAGS " ")
37 SET (CMAKE_C_FLAGS_DEBUG_INIT "-g")
38 SET (CMAKE_C_FLAGS_RELEASE_INIT "-O -DNDEBUG")
39 SET (CMAKE_C_FLAGS_MINSIZEREL_INIT "-O -DNDEBUG")
40 SET (CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "-g")
41 ENDIF(CMAKE_COMPILER_IS_GNUCC)
43 IF(NOT CMAKE_COMPILER_IS_GNUCC)
44 SET (CMAKE_C_CREATE_PREPROCESSED_SOURCE "<CMAKE_C_COMPILER> <DEFINES> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
45 SET (CMAKE_C_CREATE_ASSEMBLY_SOURCE "<CMAKE_C_COMPILER> <DEFINES> <FLAGS> -S <SOURCE> -o <ASSEMBLY_SOURCE>")
46 ENDIF(NOT CMAKE_COMPILER_IS_GNUCC)
48 IF(NOT CMAKE_COMPILER_IS_GNUCXX)
49 SET(CMAKE_CXX_COMPILE_OBJECT
50 "<CMAKE_CXX_COMPILER> -+ <DEFINES> <FLAGS> -o <OBJECT> -c <SOURCE>")
51 SET (CMAKE_CXX_CREATE_PREPROCESSED_SOURCE "<CMAKE_CXX_COMPILER> <DEFINES> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
52 SET (CMAKE_CXX_CREATE_ASSEMBLY_SOURCE "<CMAKE_CXX_COMPILER> <DEFINES> <FLAGS> -S <SOURCE> -o <ASSEMBLY_SOURCE>")
53 ENDIF(NOT CMAKE_COMPILER_IS_GNUCXX)
56 # since .a can be a static or shared library on AIX, we can not do this.
57 # at some point if we wanted it, we would have to figure out if a .a is
58 # static or shared, then we could add this back:
60 # Initialize C link type selection flags. These flags are used when
61 # building a shared library, shared module, or executable that links
62 # to other libraries to select whether to use the static or shared
63 # versions of the libraries.
64 #FOREACH(type SHARED_LIBRARY SHARED_MODULE EXE)
65 # SET(CMAKE_${type}_LINK_STATIC_C_FLAGS "-bstatic")
66 # SET(CMAKE_${type}_LINK_DYNAMIC_C_FLAGS "-bdynamic")
69 INCLUDE(Platform/UnixPaths)