diff options
author | Brad King <brad.king@kitware.com> | 2015-09-22 14:46:59 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2015-09-22 14:46:59 (GMT) |
commit | da7c8a8dae10a4fd2f33798bc8aec8a3c238b2af (patch) | |
tree | f78089634b5873d3d8b4d7d7d2e0f21598fbaf1f /Help | |
parent | 4be709a6b715acb4100fceb4394ad5215d8b555b (diff) | |
parent | b15f4e9b86bc3dc31b6a01c0ffc30747f467ec1f (diff) | |
download | CMake-da7c8a8dae10a4fd2f33798bc8aec8a3c238b2af.zip CMake-da7c8a8dae10a4fd2f33798bc8aec8a3c238b2af.tar.gz CMake-da7c8a8dae10a4fd2f33798bc8aec8a3c238b2af.tar.bz2 |
Merge topic 'restrict-shlib-link-flags-to-enable-exports'
b15f4e9b try_compile: Propogate CMP0065 to the generated project.
9784af1b CMP0065: Restrict the use of CMAKE_SHARED_LIBRARY_LINK_<LANG>_FLAGS
Diffstat (limited to 'Help')
-rw-r--r-- | Help/command/try_compile.rst | 3 | ||||
-rw-r--r-- | Help/manual/cmake-policies.7.rst | 1 | ||||
-rw-r--r-- | Help/manual/cmake-variables.7.rst | 1 | ||||
-rw-r--r-- | Help/policy/CMP0065.rst | 27 | ||||
-rw-r--r-- | Help/prop_tgt/ENABLE_EXPORTS.rst | 5 | ||||
-rw-r--r-- | Help/release/dev/restrict-shlib-link-flags-to-enable-exports.rst | 6 | ||||
-rw-r--r-- | Help/variable/CMAKE_ENABLE_EXPORTS.rst | 22 | ||||
-rw-r--r-- | Help/variable/CMAKE_POLICY_WARNING_CMPNNNN.rst | 2 |
8 files changed, 66 insertions, 1 deletions
diff --git a/Help/command/try_compile.rst b/Help/command/try_compile.rst index 1ed24df..28dae80 100644 --- a/Help/command/try_compile.rst +++ b/Help/command/try_compile.rst @@ -100,6 +100,7 @@ If set, the following variables are passed in to the generated try_compile CMakeLists.txt to initialize compile target properties with default values: +* :variable:`CMAKE_ENABLE_EXPORTS` * :variable:`CMAKE_LINK_SEARCH_START_STATIC` * :variable:`CMAKE_LINK_SEARCH_END_STATIC` * :variable:`CMAKE_POSITION_INDEPENDENT_CODE` @@ -107,5 +108,7 @@ default values: If :policy:`CMP0056` is set to ``NEW``, then :variable:`CMAKE_EXE_LINKER_FLAGS` is passed in as well. +The current setting of :policy:`CMP0065` is set in the generated project. + Set the :variable:`CMAKE_TRY_COMPILE_CONFIGURATION` variable to choose a build configuration. diff --git a/Help/manual/cmake-policies.7.rst b/Help/manual/cmake-policies.7.rst index 590f10d..ae5354f 100644 --- a/Help/manual/cmake-policies.7.rst +++ b/Help/manual/cmake-policies.7.rst @@ -122,3 +122,4 @@ All Policies /policy/CMP0062 /policy/CMP0063 /policy/CMP0064 + /policy/CMP0065 diff --git a/Help/manual/cmake-variables.7.rst b/Help/manual/cmake-variables.7.rst index 660d544..e679962 100644 --- a/Help/manual/cmake-variables.7.rst +++ b/Help/manual/cmake-variables.7.rst @@ -245,6 +245,7 @@ Variables that Control the Build /variable/CMAKE_COMPILE_PDB_OUTPUT_DIRECTORY_CONFIG /variable/CMAKE_CONFIG_POSTFIX /variable/CMAKE_DEBUG_POSTFIX + /variable/CMAKE_ENABLE_EXPORTS /variable/CMAKE_EXE_LINKER_FLAGS_CONFIG /variable/CMAKE_EXE_LINKER_FLAGS /variable/CMAKE_Fortran_FORMAT diff --git a/Help/policy/CMP0065.rst b/Help/policy/CMP0065.rst new file mode 100644 index 0000000..2ed775d --- /dev/null +++ b/Help/policy/CMP0065.rst @@ -0,0 +1,27 @@ +CMP0065 +------- + +Do not add flags to export symbols from executables without +the :prop_tgt:`ENABLE_EXPORTS` target property. + +CMake 3.3 and below, for historical reasons, always linked executables +on some platforms with flags like ``-rdynamic`` to export symbols from +the executables for use by any plugins they may load via ``dlopen``. +CMake 3.4 and above prefer to do this only for executables that are +explicitly marked with the :prop_tgt:`ENABLE_EXPORTS` target property. + +The ``OLD`` behavior of this policy is to always use the additional link +flags when linking executables regardless of the value of the +:prop_tgt:`ENABLE_EXPORTS` target property. + +The ``NEW`` behavior of this policy is to only use the additional link +flags when linking executables if the :prop_tgt:`ENABLE_EXPORTS` target +property is set to ``True``. + +This policy was introduced in CMake version 3.4. Unlike most policies, +CMake version |release| does *not* warn by default when this policy +is not set and simply uses OLD behavior. See documentation of the +:variable:`CMAKE_POLICY_WARNING_CMP0065 <CMAKE_POLICY_WARNING_CMP<NNNN>>` +variable to control the warning. + +.. include:: DEPRECATED.txt diff --git a/Help/prop_tgt/ENABLE_EXPORTS.rst b/Help/prop_tgt/ENABLE_EXPORTS.rst index 283f5a8..dfd4af7 100644 --- a/Help/prop_tgt/ENABLE_EXPORTS.rst +++ b/Help/prop_tgt/ENABLE_EXPORTS.rst @@ -7,7 +7,7 @@ Normally an executable does not export any symbols because it is the final program. It is possible for an executable to export symbols to be used by loadable modules. When this property is set to true CMake will allow other targets to "link" to the executable with the -TARGET_LINK_LIBRARIES command. On all platforms a target-level +:command:`TARGET_LINK_LIBRARIES` command. On all platforms a target-level dependency on the executable is created for targets that link to it. For DLL platforms an import library will be created for the exported symbols and then used for linking. All Windows-based systems @@ -17,3 +17,6 @@ module will "link" to the executable using a flag like "-bundle_loader". For other non-DLL platforms the link rule is simply ignored since the dynamic loader will automatically bind symbols when the module is loaded. + +This property is initialized by the value of the variable +:variable:`CMAKE_ENABLE_EXPORTS` if it is set when a target is created. diff --git a/Help/release/dev/restrict-shlib-link-flags-to-enable-exports.rst b/Help/release/dev/restrict-shlib-link-flags-to-enable-exports.rst new file mode 100644 index 0000000..f8ce044 --- /dev/null +++ b/Help/release/dev/restrict-shlib-link-flags-to-enable-exports.rst @@ -0,0 +1,6 @@ +restrict-shlib-link-flags-to-enable-exports +------------------------------------------- + +* CMake no longer links executables with flags to export symbols + unless the :prop_tgt:`ENABLE_EXPORTS` target property is set. + See policy :policy:`CMP0065`. diff --git a/Help/variable/CMAKE_ENABLE_EXPORTS.rst b/Help/variable/CMAKE_ENABLE_EXPORTS.rst new file mode 100644 index 0000000..1f9ba6f --- /dev/null +++ b/Help/variable/CMAKE_ENABLE_EXPORTS.rst @@ -0,0 +1,22 @@ +CMAKE_ENABLE_EXPORTS +-------------------- + +Specify whether an executable exports symbols for loadable modules. + +Normally an executable does not export any symbols because it is the +final program. It is possible for an executable to export symbols to +be used by loadable modules. When this property is set to true CMake +will allow other targets to "link" to the executable with the +:command:`TARGET_LINK_LIBRARIES` command. On all platforms a target-level +dependency on the executable is created for targets that link to it. +For DLL platforms an import library will be created for the exported +symbols and then used for linking. All Windows-based systems +including Cygwin are DLL platforms. For non-DLL platforms that +require all symbols to be resolved at link time, such as Mac OS X, the +module will "link" to the executable using a flag like +"-bundle_loader". For other non-DLL platforms the link rule is simply +ignored since the dynamic loader will automatically bind symbols when +the module is loaded. + +This variable is used to initialize the target property +:prop_tgt:`ENABLE_EXPORTS` for executable targets. diff --git a/Help/variable/CMAKE_POLICY_WARNING_CMPNNNN.rst b/Help/variable/CMAKE_POLICY_WARNING_CMPNNNN.rst index 8de0d56..582f9e4 100644 --- a/Help/variable/CMAKE_POLICY_WARNING_CMPNNNN.rst +++ b/Help/variable/CMAKE_POLICY_WARNING_CMPNNNN.rst @@ -13,6 +13,8 @@ warn by default: policy :policy:`CMP0056`. * ``CMAKE_POLICY_WARNING_CMP0060`` controls the warning for policy :policy:`CMP0060`. +* ``CMAKE_POLICY_WARNING_CMP0065`` controls the warning for + policy :policy:`CMP0065`. This variable should not be set by a project in CMake code. Project developers running CMake may set this variable in their cache to |