HP-UX.cmake 1.9 KB

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