GNU.cmake 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. # GCC is the default compiler on GNU/Hurd.
  2. set(CMAKE_DL_LIBS "dl")
  3. set(CMAKE_SHARED_LIBRARY_C_FLAGS "-fPIC")
  4. set(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-shared")
  5. set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "-Wl,-rpath,")
  6. set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP ":")
  7. set(CMAKE_SHARED_LIBRARY_RPATH_LINK_C_FLAG "-Wl,-rpath-link,")
  8. set(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "-Wl,-soname,")
  9. set(CMAKE_EXE_EXPORTS_C_FLAG "-Wl,--export-dynamic")
  10. # Debian policy requires that shared libraries be installed without
  11. # executable permission. Fedora policy requires that shared libraries
  12. # be installed with the executable permission. Since the native tools
  13. # create shared libraries with execute permission in the first place a
  14. # reasonable policy seems to be to install with execute permission by
  15. # default. In order to support debian packages we provide an option
  16. # here. The option default is based on the current distribution, but
  17. # packagers can set it explicitly on the command line.
  18. if(DEFINED CMAKE_INSTALL_SO_NO_EXE)
  19. # Store the decision variable in the cache. This preserves any
  20. # setting the user provides on the command line.
  21. set(CMAKE_INSTALL_SO_NO_EXE "${CMAKE_INSTALL_SO_NO_EXE}" CACHE INTERNAL
  22. "Install .so files without execute permission.")
  23. else()
  24. # Store the decision variable as an internal cache entry to avoid
  25. # checking the platform every time. This option is advanced enough
  26. # that only package maintainers should need to adjust it. They are
  27. # capable of providing a setting on the command line.
  28. if(EXISTS "/etc/debian_version")
  29. set(CMAKE_INSTALL_SO_NO_EXE 1 CACHE INTERNAL
  30. "Install .so files without execute permission.")
  31. else()
  32. set(CMAKE_INSTALL_SO_NO_EXE 0 CACHE INTERNAL
  33. "Install .so files without execute permission.")
  34. endif()
  35. endif()
  36. set(CMAKE_LIBRARY_ARCHITECTURE_REGEX "[a-z0-9_]+(-[a-z0-9_]+)?-gnu[a-z0-9_]*")
  37. include(Platform/UnixPaths)