diff options
author | Stephen Kelly <steveire@gmail.com> | 2013-10-20 18:39:16 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2013-10-26 14:10:20 (GMT) |
commit | 239b0c6b0ed821fd012a2a980961b9a9d43793e5 (patch) | |
tree | 7b571325a3cb0112bf4965b5edd900dd0c7525c6 /Tests/RunCMake/CMP0022 | |
parent | c515dc574879448d66e2c5a27b9807d95a27fefd (diff) | |
download | CMake-239b0c6b0ed821fd012a2a980961b9a9d43793e5.zip CMake-239b0c6b0ed821fd012a2a980961b9a9d43793e5.tar.gz CMake-239b0c6b0ed821fd012a2a980961b9a9d43793e5.tar.bz2 |
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/RunCMake/CMP0022')
-rw-r--r-- | Tests/RunCMake/CMP0022/CMP0022-NOWARN-static.cmake | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Tests/RunCMake/CMP0022/CMP0022-NOWARN-static.cmake b/Tests/RunCMake/CMP0022/CMP0022-NOWARN-static.cmake index 3e4144f..ad3b8df 100644 --- a/Tests/RunCMake/CMP0022/CMP0022-NOWARN-static.cmake +++ b/Tests/RunCMake/CMP0022/CMP0022-NOWARN-static.cmake @@ -5,4 +5,8 @@ add_library(foo STATIC empty_vs6_1.cpp) add_library(bar STATIC empty_vs6_2.cpp) add_library(bat STATIC empty_vs6_3.cpp) target_link_libraries(foo bar) -target_link_libraries(bar bat) +# The last element here needs to contain a space so that it is a single +# element which is not a valid target name. As bar is a STATIC library, +# this tests that the LINK_ONLY generator expression is not used for +# that element, creating an error. +target_link_libraries(bar bat "-lz -lm") |