FreeBSD.cmake 1.3 KB

1234567891011121314151617181920212223242526272829
  1. set(CMAKE_DL_LIBS "")
  2. set(CMAKE_C_COMPILE_OPTIONS_PIC "-fPIC")
  3. set(CMAKE_C_COMPILE_OPTIONS_PIE "-fPIE")
  4. # PIE link options are managed in Compiler/<compiler>.cmake file
  5. set(CMAKE_SHARED_LIBRARY_C_FLAGS "-fPIC") # -pic
  6. set(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-shared") # -shared
  7. set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "") # +s, flag for exe link to use shared lib
  8. set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "-Wl,-rpath,") # -rpath
  9. set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP ":") # : or empty
  10. # Does not require -z origin since 10.2-RELEASE
  11. set(CMAKE_SHARED_LIBRARY_RPATH_ORIGIN_TOKEN "\$ORIGIN")
  12. set(CMAKE_SHARED_LIBRARY_RPATH_LINK_C_FLAG "-Wl,-rpath-link,")
  13. set(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "-Wl,-soname,")
  14. set(CMAKE_EXE_EXPORTS_C_FLAG "-Wl,--export-dynamic")
  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. # Initialize C link type selection flags. These flags are used when
  19. # building a shared library, shared module, or executable that links
  20. # to other libraries to select whether to use the static or shared
  21. # versions of the libraries.
  22. foreach(type SHARED_LIBRARY SHARED_MODULE EXE)
  23. set(CMAKE_${type}_LINK_STATIC_C_FLAGS "-Wl,-Bstatic")
  24. set(CMAKE_${type}_LINK_DYNAMIC_C_FLAGS "-Wl,-Bdynamic")
  25. endforeach()
  26. include(Platform/UnixPaths)