HP-UX.cmake 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. set(CMAKE_PLATFORM_REQUIRED_RUNTIME_PATH /usr/lib)
  2. set(CMAKE_SHARED_LIBRARY_SUFFIX ".sl") # .so
  3. set(CMAKE_DL_LIBS "dld")
  4. set(CMAKE_FIND_LIBRARY_SUFFIXES ".sl" ".so" ".a")
  5. set(CMAKE_EXTRA_SHARED_LIBRARY_SUFFIXES ".so")
  6. # The HP linker needs to find transitive shared library dependencies
  7. # in the -L path. Therefore the runtime path must be added to the
  8. # link line with -L flags.
  9. set(CMAKE_SHARED_LIBRARY_LINK_C_WITH_RUNTIME_PATH 1)
  10. set(CMAKE_LINK_DEPENDENT_LIBRARY_DIRS 1)
  11. # Shared libraries with no builtin soname may not be linked safely by
  12. # specifying the file path.
  13. set(CMAKE_PLATFORM_USES_PATH_WHEN_NO_SONAME 1)
  14. # set flags for gcc support
  15. include(Platform/UnixPaths)
  16. # Look in both 32-bit and 64-bit implict link directories, but tell
  17. # CMake not to pass the paths to the linker. The linker will find the
  18. # library for the proper architecture. In the future we should detect
  19. # which path will be used by the linker. Since the pointer type size
  20. # CMAKE_SIZEOF_VOID_P is not set until after this file executes, we
  21. # would need to append to CMAKE_SYSTEM_LIBRARY_PATH at a later point
  22. # (after CMakeTest(LANG)Compiler.cmake runs for at least one language).
  23. list(APPEND CMAKE_SYSTEM_LIBRARY_PATH /usr/lib/hpux32)
  24. list(APPEND CMAKE_SYSTEM_LIBRARY_PATH /usr/lib/hpux64)
  25. list(APPEND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES
  26. /usr/lib/hpux32 /usr/lib/hpux64)
  27. # Initialize C and CXX link type selection flags. These flags are
  28. # used when building a shared library, shared module, or executable
  29. # that links to other libraries to select whether to use the static or
  30. # shared versions of the libraries.
  31. foreach(type SHARED_LIBRARY SHARED_MODULE EXE)
  32. foreach(lang C CXX)
  33. set(CMAKE_${type}_LINK_STATIC_${lang}_FLAGS "-Wl,-a,archive")
  34. set(CMAKE_${type}_LINK_DYNAMIC_${lang}_FLAGS "-Wl,-a,default")
  35. endforeach()
  36. endforeach()