CMP0018.rst 1.5 KB

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