mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-06 05:40:54 -06:00
Merge topic 'pie-link-options'
c4b4d8b3a6POSITION_INDEPENDENT_CODE: Manage link flags for executables724a0346f7POSITION_INDEPENDENT_CODE: Fix erroneous '-fPIE' flag for Sun Studio023188ffb4INTERFACE_POSITION_INDEPENDENT_CODE: add generator expressions support Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2465
This commit is contained in:
@@ -57,6 +57,7 @@ Policies Introduced by CMake 3.14
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
|
||||
CMP0083: Add PIE options when linking executable. </policy/CMP0083>
|
||||
CMP0082: Install rules from add_subdirectory() are interleaved with those in caller. </policy/CMP0082>
|
||||
|
||||
Policies Introduced by CMake 3.13
|
||||
|
||||
24
Help/policy/CMP0083.rst
Normal file
24
Help/policy/CMP0083.rst
Normal file
@@ -0,0 +1,24 @@
|
||||
CMP0083
|
||||
-------
|
||||
|
||||
To control generation of Position Independent Executable (``PIE``) or not, some
|
||||
flags are required at link time.
|
||||
|
||||
CMake 3.13 and lower did not add these link flags when
|
||||
:prop_tgt:`POSITION_INDEPENDENT_CODE` is set.
|
||||
|
||||
The ``OLD`` behavior for this policy is to not manage ``PIE`` link flags. The
|
||||
``NEW`` behavior is to add link flags if :prop_tgt:`POSITION_INDEPENDENT_CODE`
|
||||
is set:
|
||||
|
||||
* Set to ``TRUE``: flags to produce a position independent executable are
|
||||
passed to the linker step. For example ``-pie`` for ``GCC``.
|
||||
* Set to ``FALSE``: flags not to produce a position independent executable are
|
||||
passed to the linker step. For example ``-no-pie`` for ``GCC``.
|
||||
* Not set: no flags are passed to the linker step.
|
||||
|
||||
This policy was introduced in CMake version 3.14. CMake version
|
||||
|release| warns when the policy is not set and uses ``OLD`` behavior. Use
|
||||
the :command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly.
|
||||
|
||||
.. include:: DEPRECATED.txt
|
||||
@@ -14,3 +14,9 @@ undefined, then consumers will determine their
|
||||
:prop_tgt:`POSITION_INDEPENDENT_CODE` property by other means. Consumers
|
||||
must ensure that the targets that they link to have a consistent
|
||||
requirement for their ``INTERFACE_POSITION_INDEPENDENT_CODE`` property.
|
||||
|
||||
Contents of ``INTERFACE_POSITION_INDEPENDENT_CODE`` may use
|
||||
"generator expressions" with the syntax ``$<...>``. See the
|
||||
:manual:`cmake-generator-expressions(7)` manual for available expressions.
|
||||
See the :manual:`cmake-buildsystem(7)` manual for more on defining buildsystem
|
||||
properties.
|
||||
|
||||
5
Help/release/dev/INTERFACE_POSITION_INDEPENDENT_CODE.rst
Normal file
5
Help/release/dev/INTERFACE_POSITION_INDEPENDENT_CODE.rst
Normal file
@@ -0,0 +1,5 @@
|
||||
INTERFACE_POSITION_INDEPENDENT_CODE
|
||||
-----------------------------------
|
||||
|
||||
* :prop_tgt:`INTERFACE_POSITION_INDEPENDENT_CODE` target property gains the
|
||||
support of :manual:`generator expressions <cmake-generator-expressions(7)>`.
|
||||
6
Help/release/dev/link-option-PIE.rst
Normal file
6
Help/release/dev/link-option-PIE.rst
Normal file
@@ -0,0 +1,6 @@
|
||||
link-option-PIE
|
||||
---------------
|
||||
|
||||
* Required link options to manage Position Independent Executable are now
|
||||
added when :prop_tgt:`POSITION_INDEPENDENT_CODE` is set. These flags are
|
||||
controlled by policy :policy:`CMP0083`.
|
||||
Reference in New Issue
Block a user