CMP0018.rst 1.6 KB

1234567891011121314151617181920212223242526272829303132333435
  1. CMP0018
  2. -------
  3. .. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
  4. .. include:: include/REMOVED_PROLOGUE.rst
  5. Ignore ``CMAKE_SHARED_LIBRARY_<Lang>_FLAGS`` variable.
  6. CMake 2.8.8 and lower compiled sources in ``SHARED`` and ``MODULE`` libraries
  7. using the value of the undocumented ``CMAKE_SHARED_LIBRARY_<Lang>_FLAGS``
  8. platform variable. The variable contained platform-specific flags
  9. needed to compile objects for shared libraries. Typically it included
  10. a flag such as ``-fPIC`` for position independent code but also included
  11. other flags needed on certain platforms. CMake 2.8.9 and higher
  12. prefer instead to use the :prop_tgt:`POSITION_INDEPENDENT_CODE` target
  13. property to determine what targets should be position independent, and new
  14. undocumented platform variables to select flags while ignoring
  15. ``CMAKE_SHARED_LIBRARY_<Lang>_FLAGS`` completely.
  16. The default for either approach produces identical compilation flags,
  17. but if a project modifies ``CMAKE_SHARED_LIBRARY_<Lang>_FLAGS`` from its
  18. original value this policy determines which approach to use.
  19. The ``OLD`` behavior for this policy is to ignore the
  20. :prop_tgt:`POSITION_INDEPENDENT_CODE` property for all targets and use the
  21. modified value of ``CMAKE_SHARED_LIBRARY_<Lang>_FLAGS`` for ``SHARED`` and
  22. ``MODULE`` libraries.
  23. The ``NEW`` behavior for this policy is to ignore
  24. ``CMAKE_SHARED_LIBRARY_<Lang>_FLAGS`` whether it is modified or not and
  25. honor the :prop_tgt:`POSITION_INDEPENDENT_CODE` target property.
  26. .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 2.8.9
  27. .. |WARNED_OR_DID_NOT_WARN| replace:: warned
  28. .. include:: include/REMOVED_EPILOGUE.rst