diff options
author | Stephen Kelly <steveire@gmail.com> | 2013-10-20 20:39:16 +0200 |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2013-10-26 10:10:20 -0400 |
commit | 239b0c6b0ed821fd012a2a980961b9a9d43793e5 (patch) | |
tree | 7b571325a3cb0112bf4965b5edd900dd0c7525c6 /Tests/CMakeCommands | |
parent | c515dc574879448d66e2c5a27b9807d95a27fefd (diff) | |
download | cmake-239b0c6b0ed821fd012a2a980961b9a9d43793e5.tar.gz |
Don't add invalid content to static lib INTERFACE_LINK_LIBRARIES.
Only valid target names or generator expressions may appear in
the target field of a LINK_ONLY expression.
Other content like link flags should still be added to that property
(wrapped in config-specific generator expressions), but not wrapped
in LINK_ONLY. Otherwise undue warnings would be issued for the
policy CMP0022.
The LINK_ONLY expression only has an effect for actual target
names anyway, so there is no logical deficit.
Diffstat (limited to 'Tests/CMakeCommands')
-rw-r--r-- | Tests/CMakeCommands/target_link_libraries/cmp0022/CMakeLists.txt | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Tests/CMakeCommands/target_link_libraries/cmp0022/CMakeLists.txt b/Tests/CMakeCommands/target_link_libraries/cmp0022/CMakeLists.txt index 07d7c4392a..33757b66ea 100644 --- a/Tests/CMakeCommands/target_link_libraries/cmp0022/CMakeLists.txt +++ b/Tests/CMakeCommands/target_link_libraries/cmp0022/CMakeLists.txt @@ -22,6 +22,9 @@ generate_export_header(staticlib1) add_library(staticlib2 STATIC staticlib2.cpp) generate_export_header(staticlib2) target_link_libraries(staticlib1 LINK_PUBLIC staticlib2) +if (CMAKE_CXX_COMPILER_ID MATCHES GNU OR CMAKE_CXX_COMPILER_ID MATCHES Clang) + target_link_libraries(staticlib1 LINK_PRIVATE "-Wl,-v") +endif() add_executable(staticlib_exe staticlib_exe.cpp) target_link_libraries(staticlib_exe staticlib1) |