This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake".
The branch, master has been updated via a6f7a01f3acb97f9e7fd48705aca33a19564671f (commit) via 6b17d85873faf0c094c4287e1dd690fcdcbbb2c7 (commit) via 9561d42f95b519386c5f8f84d8ae59a6b8deb429 (commit) from ca2e781703dab42f309bf31189011d69e37b954f (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a6f7a01f3acb97f9e7fd48705aca33a19564671f commit a6f7a01f3acb97f9e7fd48705aca33a19564671f Merge: ca2e781 6b17d85 Author: Craig Scott <craig.sc...@crascit.com> AuthorDate: Wed Aug 15 11:58:26 2018 +0000 Commit: Kitware Robot <kwro...@kitware.com> CommitDate: Wed Aug 15 07:58:39 2018 -0400 Merge topic 'better_static_link_flags_docs' 6b17d85873 Help: Document when LINK_FLAGS and STATIC_LIBRARY_FLAGS are used 9561d42f95 target_link_options: Add test to verify static library behavior Acked-by: Kitware Robot <kwro...@kitware.com> Acked-by: Robert Maynard <robert.mayn...@kitware.com> Merge-request: !2274 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6b17d85873faf0c094c4287e1dd690fcdcbbb2c7 commit 6b17d85873faf0c094c4287e1dd690fcdcbbb2c7 Author: Robert Maynard <robert.mayn...@kitware.com> AuthorDate: Thu Aug 9 10:29:38 2018 -0400 Commit: Brad King <brad.k...@kitware.com> CommitDate: Thu Aug 9 12:54:16 2018 -0400 Help: Document when LINK_FLAGS and STATIC_LIBRARY_FLAGS are used diff --git a/Help/command/add_link_options.rst b/Help/command/add_link_options.rst index 821198d..551d440 100644 --- a/Help/command/add_link_options.rst +++ b/Help/command/add_link_options.rst @@ -1,7 +1,7 @@ add_link_options ---------------- -Adds options to the link of targets. +Adds options to the link of shared library, module and executable targets. :: diff --git a/Help/prop_dir/LINK_OPTIONS.rst b/Help/prop_dir/LINK_OPTIONS.rst index 04b9e08..15c555f 100644 --- a/Help/prop_dir/LINK_OPTIONS.rst +++ b/Help/prop_dir/LINK_OPTIONS.rst @@ -1,7 +1,8 @@ LINK_OPTIONS ------------ -List of options to use for the link step. +List of options to use for the link step of shared library, module +and executable targets. This property holds a :ref:`;-list <CMake Language Lists>` of options given so far to the :command:`add_link_options` command. diff --git a/Help/prop_tgt/LINK_FLAGS.rst b/Help/prop_tgt/LINK_FLAGS.rst index e0b72b5..3a344e6 100644 --- a/Help/prop_tgt/LINK_FLAGS.rst +++ b/Help/prop_tgt/LINK_FLAGS.rst @@ -1,7 +1,9 @@ LINK_FLAGS ---------- -Additional flags to use when linking this target. +Additional flags to use when linking this target if it is a shared library, +module library, or an executable. Static libraries need to use +:prop_tgt:`STATIC_LIBRARY_FLAGS`. The LINK_FLAGS property, managed as a string, can be used to add extra flags to the link step of a target. :prop_tgt:`LINK_FLAGS_<CONFIG>` will add to the diff --git a/Help/prop_tgt/LINK_FLAGS_CONFIG.rst b/Help/prop_tgt/LINK_FLAGS_CONFIG.rst index 1f2910b..c30ecf1 100644 --- a/Help/prop_tgt/LINK_FLAGS_CONFIG.rst +++ b/Help/prop_tgt/LINK_FLAGS_CONFIG.rst @@ -1,9 +1,9 @@ LINK_FLAGS_<CONFIG> ------------------- -Per-configuration linker flags for a target. +Per-configuration linker flags for a shared library, module or executable target. -This is the configuration-specific version of LINK_FLAGS. +This is the configuration-specific version of :prop_tgt:`LINK_FLAGS`. .. note:: diff --git a/Help/prop_tgt/STATIC_LIBRARY_FLAGS.rst b/Help/prop_tgt/STATIC_LIBRARY_FLAGS.rst index d3b2cd4..c91b1ae 100644 --- a/Help/prop_tgt/STATIC_LIBRARY_FLAGS.rst +++ b/Help/prop_tgt/STATIC_LIBRARY_FLAGS.rst @@ -1,6 +1,12 @@ STATIC_LIBRARY_FLAGS -------------------- -Extra flags to use when linking static libraries. +Archiver (or MSVC librarian) flags for a static library target. +Targets that are shared libraries, modules, or executables can use +the :prop_tgt:`LINK_OPTIONS` or :prop_tgt:`LINK_FLAGS` target property. -Extra flags to use when linking a static library. +The STATIC_LIBRARY_FLAGS property, managed as a string, can be used to add +extra flags to the link step of a static library target. +:prop_tgt:`STATIC_LIBRARY_FLAGS_<CONFIG>` will add to the configuration +``<CONFIG>``, for example, ``DEBUG``, ``RELEASE``, ``MINSIZEREL``, +``RELWITHDEBINFO``, ... diff --git a/Help/prop_tgt/STATIC_LIBRARY_FLAGS_CONFIG.rst b/Help/prop_tgt/STATIC_LIBRARY_FLAGS_CONFIG.rst index cca353d..b867ac4 100644 --- a/Help/prop_tgt/STATIC_LIBRARY_FLAGS_CONFIG.rst +++ b/Help/prop_tgt/STATIC_LIBRARY_FLAGS_CONFIG.rst @@ -1,6 +1,6 @@ STATIC_LIBRARY_FLAGS_<CONFIG> ----------------------------- -Per-configuration flags for creating a static library. +Per-configuration archiver (or MSVC librarian) flags for a static library target. -This is the configuration-specific version of STATIC_LIBRARY_FLAGS. +This is the configuration-specific version of :prop_tgt:`STATIC_LIBRARY_FLAGS`. https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9561d42f95b519386c5f8f84d8ae59a6b8deb429 commit 9561d42f95b519386c5f8f84d8ae59a6b8deb429 Author: Robert Maynard <robert.mayn...@kitware.com> AuthorDate: Thu Aug 9 10:28:13 2018 -0400 Commit: Brad King <brad.k...@kitware.com> CommitDate: Thu Aug 9 12:52:44 2018 -0400 target_link_options: Add test to verify static library behavior Issue: #18251 diff --git a/Tests/RunCMake/target_link_options/LINK_OPTIONS-static-check.cmake b/Tests/RunCMake/target_link_options/LINK_OPTIONS-static-check.cmake new file mode 100644 index 0000000..b68e451 --- /dev/null +++ b/Tests/RunCMake/target_link_options/LINK_OPTIONS-static-check.cmake @@ -0,0 +1,7 @@ + +if (actual_stdout MATCHES "BADFLAG_RELEASE") + set (RunCMake_TEST_FAILED "Found 'BADFLAG_RELEASE' which was not expected.") +endif() +if (actual_stdout MATCHES "SHELL:") + string (APPEND RunCMake_TEST_FAILED "\nFound unexpected prefix 'SHELL:'.") +endif() diff --git a/Tests/RunCMake/target_link_options/LINK_OPTIONS-static-result.txt b/Tests/RunCMake/target_link_options/LINK_OPTIONS-static-result.txt new file mode 100644 index 0000000..573541a --- /dev/null +++ b/Tests/RunCMake/target_link_options/LINK_OPTIONS-static-result.txt @@ -0,0 +1 @@ +0 diff --git a/Tests/RunCMake/target_link_options/LINK_OPTIONS.cmake b/Tests/RunCMake/target_link_options/LINK_OPTIONS.cmake index f17195d..84cf129 100644 --- a/Tests/RunCMake/target_link_options/LINK_OPTIONS.cmake +++ b/Tests/RunCMake/target_link_options/LINK_OPTIONS.cmake @@ -22,6 +22,13 @@ add_executable(LinkOptions_consumer LinkOptionsExe.c) target_link_libraries(LinkOptions_consumer PRIVATE LinkOptions_producer) +# static library with generator expression +add_library(LinkOptions_static STATIC LinkOptionsLib.c) +target_link_options(LinkOptions_static PRIVATE $<$<CONFIG:Release>:${pre}BADFLAG_RELEASE${obj}> + "SHELL:" # produces no options + ) + + # shared library with generator expression add_library(LinkOptions_shared SHARED LinkOptionsLib.c) target_link_options(LinkOptions_shared PRIVATE $<$<CONFIG:Release>:${pre}BADFLAG_RELEASE${obj}> diff --git a/Tests/RunCMake/target_link_options/RunCMakeTest.cmake b/Tests/RunCMake/target_link_options/RunCMakeTest.cmake index 121a0ce..39f580f 100644 --- a/Tests/RunCMake/target_link_options/RunCMakeTest.cmake +++ b/Tests/RunCMake/target_link_options/RunCMakeTest.cmake @@ -21,6 +21,7 @@ if (NOT CMAKE_C_COMPILER_ID STREQUAL "Intel") run_cmake_target(LINK_OPTIONS basic LinkOptions) run_cmake_target(LINK_OPTIONS interface LinkOptions_consumer) + run_cmake_target(LINK_OPTIONS static LinkOptions_static --config Release) run_cmake_target(LINK_OPTIONS shared LinkOptions_shared --config Release) run_cmake_target(LINK_OPTIONS mod LinkOptions_mod --config Release) run_cmake_target(LINK_OPTIONS exe LinkOptions_exe --config Release) ----------------------------------------------------------------------- Summary of changes: Help/command/add_link_options.rst | 2 +- Help/prop_dir/LINK_OPTIONS.rst | 3 ++- Help/prop_tgt/LINK_FLAGS.rst | 4 +++- Help/prop_tgt/LINK_FLAGS_CONFIG.rst | 4 ++-- Help/prop_tgt/STATIC_LIBRARY_FLAGS.rst | 10 ++++++++-- Help/prop_tgt/STATIC_LIBRARY_FLAGS_CONFIG.rst | 4 ++-- ...OPTIONS-exe-check.cmake => LINK_OPTIONS-static-check.cmake} | 4 ++-- .../LINK_OPTIONS-static-result.txt} | 0 Tests/RunCMake/target_link_options/LINK_OPTIONS.cmake | 7 +++++++ Tests/RunCMake/target_link_options/RunCMakeTest.cmake | 1 + 10 files changed, 28 insertions(+), 11 deletions(-) copy Tests/RunCMake/target_link_options/{LINK_OPTIONS-exe-check.cmake => LINK_OPTIONS-static-check.cmake} (51%) copy Tests/RunCMake/{target_link_libraries/Separate-PRIVATE-LINK_PRIVATE-uses-result.txt => target_link_options/LINK_OPTIONS-static-result.txt} (100%) hooks/post-receive -- CMake _______________________________________________ Cmake-commits mailing list Cmake-commits@cmake.org https://cmake.org/mailman/listinfo/cmake-commits