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