summaryrefslogtreecommitdiffstats
path: root/Help
diff options
context:
space:
mode:
authorCraig Scott <craig.scott@crascit.com>2018-11-12 20:42:42 (GMT)
committerKitware Robot <kwrobot@kitware.com>2018-11-12 20:43:07 (GMT)
commitddb967cca1a37501dcf3fbd6f64c2d3be1c0c82b (patch)
treea94fe4644c936080d409225dd8cbd3bc56925f03 /Help
parentc310480c5dc76ad0c1eb4e842869f92121d5b507 (diff)
parentc4b4d8b3a67718e29edb5676273e528dab566672 (diff)
downloadCMake-ddb967cca1a37501dcf3fbd6f64c2d3be1c0c82b.zip
CMake-ddb967cca1a37501dcf3fbd6f64c2d3be1c0c82b.tar.gz
CMake-ddb967cca1a37501dcf3fbd6f64c2d3be1c0c82b.tar.bz2
Merge topic 'pie-link-options'
c4b4d8b3a6 POSITION_INDEPENDENT_CODE: Manage link flags for executables 724a0346f7 POSITION_INDEPENDENT_CODE: Fix erroneous '-fPIE' flag for Sun Studio 023188ffb4 INTERFACE_POSITION_INDEPENDENT_CODE: add generator expressions support Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2465
Diffstat (limited to 'Help')
-rw-r--r--Help/manual/cmake-policies.7.rst1
-rw-r--r--Help/policy/CMP0083.rst24
-rw-r--r--Help/prop_tgt/INTERFACE_POSITION_INDEPENDENT_CODE.rst6
-rw-r--r--Help/release/dev/INTERFACE_POSITION_INDEPENDENT_CODE.rst5
-rw-r--r--Help/release/dev/link-option-PIE.rst6
5 files changed, 42 insertions, 0 deletions
diff --git a/Help/manual/cmake-policies.7.rst b/Help/manual/cmake-policies.7.rst
index 0587429..98279ef 100644
--- a/Help/manual/cmake-policies.7.rst
+++ b/Help/manual/cmake-policies.7.rst
@@ -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
diff --git a/Help/policy/CMP0083.rst b/Help/policy/CMP0083.rst
new file mode 100644
index 0000000..7b467b0
--- /dev/null
+++ b/Help/policy/CMP0083.rst
@@ -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
diff --git a/Help/prop_tgt/INTERFACE_POSITION_INDEPENDENT_CODE.rst b/Help/prop_tgt/INTERFACE_POSITION_INDEPENDENT_CODE.rst
index ea700df..4336d71 100644
--- a/Help/prop_tgt/INTERFACE_POSITION_INDEPENDENT_CODE.rst
+++ b/Help/prop_tgt/INTERFACE_POSITION_INDEPENDENT_CODE.rst
@@ -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.
diff --git a/Help/release/dev/INTERFACE_POSITION_INDEPENDENT_CODE.rst b/Help/release/dev/INTERFACE_POSITION_INDEPENDENT_CODE.rst
new file mode 100644
index 0000000..7732ff6
--- /dev/null
+++ b/Help/release/dev/INTERFACE_POSITION_INDEPENDENT_CODE.rst
@@ -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)>`.
diff --git a/Help/release/dev/link-option-PIE.rst b/Help/release/dev/link-option-PIE.rst
new file mode 100644
index 0000000..824ab2c
--- /dev/null
+++ b/Help/release/dev/link-option-PIE.rst
@@ -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`.