From 7e1a0739dbecc2c1d498ad4c78eba355696b7a44 Mon Sep 17 00:00:00 2001 From: Andreas Hartmetz Date: Mon, 9 Sep 2024 15:47:35 +0200 Subject: Help: POSITION_INDEPENDENT_CODE applies to *all* libraries It is sometimes useful, e.g. when linking a static library into a shared library, it needs to be PIC. --- Help/prop_tgt/POSITION_INDEPENDENT_CODE.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Help/prop_tgt/POSITION_INDEPENDENT_CODE.rst b/Help/prop_tgt/POSITION_INDEPENDENT_CODE.rst index 0aaf66b..4876150 100644 --- a/Help/prop_tgt/POSITION_INDEPENDENT_CODE.rst +++ b/Help/prop_tgt/POSITION_INDEPENDENT_CODE.rst @@ -4,7 +4,7 @@ POSITION_INDEPENDENT_CODE Whether to create a position-independent target The ``POSITION_INDEPENDENT_CODE`` property determines whether position -independent executables or shared libraries will be created. This +independent executables or libraries will be created. This property is ``True`` by default for ``SHARED`` and ``MODULE`` library targets and ``False`` otherwise. This property is initialized by the value of the :variable:`CMAKE_POSITION_INDEPENDENT_CODE` variable if it is set -- cgit v0.12 From a6315790a189496c7a9befb68e720dc4496f85df Mon Sep 17 00:00:00 2001 From: Andreas Hartmetz Date: Mon, 9 Sep 2024 16:28:29 +0200 Subject: Help: CMAKE_POSITION_INDEPENDENT_CODE is ignored for some targets SHARED and MODULE library targets have POSITION_INDEPENDENT_CODE default to TRUE regardless of CMAKE_POSITION_INDEPENDENT_CODE. --- Help/prop_tgt/POSITION_INDEPENDENT_CODE.rst | 6 +++--- Help/variable/CMAKE_POSITION_INDEPENDENT_CODE.rst | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Help/prop_tgt/POSITION_INDEPENDENT_CODE.rst b/Help/prop_tgt/POSITION_INDEPENDENT_CODE.rst index 4876150..2ba1e6f 100644 --- a/Help/prop_tgt/POSITION_INDEPENDENT_CODE.rst +++ b/Help/prop_tgt/POSITION_INDEPENDENT_CODE.rst @@ -6,9 +6,9 @@ Whether to create a position-independent target The ``POSITION_INDEPENDENT_CODE`` property determines whether position independent executables or libraries will be created. This property is ``True`` by default for ``SHARED`` and ``MODULE`` library -targets and ``False`` otherwise. This property is initialized by the value -of the :variable:`CMAKE_POSITION_INDEPENDENT_CODE` variable if it is set -when a target is created. +targets. For other targets, this property is initialized by the value +of the :variable:`CMAKE_POSITION_INDEPENDENT_CODE` variable if it is set +when the target is created, or ``False`` otherwise. .. note:: diff --git a/Help/variable/CMAKE_POSITION_INDEPENDENT_CODE.rst b/Help/variable/CMAKE_POSITION_INDEPENDENT_CODE.rst index b010317..f83246a 100644 --- a/Help/variable/CMAKE_POSITION_INDEPENDENT_CODE.rst +++ b/Help/variable/CMAKE_POSITION_INDEPENDENT_CODE.rst @@ -4,6 +4,6 @@ CMAKE_POSITION_INDEPENDENT_CODE Default value for :prop_tgt:`POSITION_INDEPENDENT_CODE` of targets. This variable is used to initialize the -:prop_tgt:`POSITION_INDEPENDENT_CODE` property on all the targets. -See that target property for additional information. If set, its -value is also used by the :command:`try_compile` command. +:prop_tgt:`POSITION_INDEPENDENT_CODE` property on targets that +are not ``SHARED`` or ``MODULE`` library targets. +If set, its value is also used by the :command:`try_compile` command. -- cgit v0.12