AIX.cmake 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. SET(CMAKE_SHARED_LIBRARY_PREFIX "lib") # lib
  2. SET(CMAKE_SHARED_LIBRARY_SUFFIX ".so") # .so
  3. SET(CMAKE_DL_LIBS "-lld")
  4. # RPATH support on AIX is called libpath. By default the runtime
  5. # libpath is paths specified by -L followed by /usr/lib and /lib. In
  6. # order to prevent the -L paths from being used we must force use of
  7. # -Wl,-blibpath:/usr/lib:/lib whether RPATH support is on or not.
  8. # When our own RPATH is to be added it may be inserted before the
  9. # "always" paths.
  10. SET(CMAKE_PLATFORM_REQUIRED_RUNTIME_PATH /usr/lib /lib)
  11. SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "-Wl,-blibpath:")
  12. SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP ":")
  13. # Files named "libfoo.a" may actually be shared libraries.
  14. SET_PROPERTY(GLOBAL PROPERTY TARGET_ARCHIVES_MAY_BE_SHARED_LIBS 1)
  15. # CXX Compiler
  16. IF(CMAKE_COMPILER_IS_GNUCXX)
  17. SET(CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS "-shared -Wl,-G") # -shared
  18. ENDIF(CMAKE_COMPILER_IS_GNUCXX)
  19. # C Compiler
  20. IF(CMAKE_COMPILER_IS_GNUCC)
  21. SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-shared -Wl,-G") # -shared
  22. ENDIF(CMAKE_COMPILER_IS_GNUCC)
  23. # since .a can be a static or shared library on AIX, we can not do this.
  24. # at some point if we wanted it, we would have to figure out if a .a is
  25. # static or shared, then we could add this back:
  26. # Initialize C link type selection flags. These flags are used when
  27. # building a shared library, shared module, or executable that links
  28. # to other libraries to select whether to use the static or shared
  29. # versions of the libraries.
  30. #FOREACH(type SHARED_LIBRARY SHARED_MODULE EXE)
  31. # SET(CMAKE_${type}_LINK_STATIC_C_FLAGS "-bstatic")
  32. # SET(CMAKE_${type}_LINK_DYNAMIC_C_FLAGS "-bdynamic")
  33. #ENDFOREACH(type)
  34. INCLUDE(Platform/UnixPaths)