diff options
author | Brad King <brad.king@kitware.com> | 2022-03-16 13:15:37 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2022-03-16 14:47:32 (GMT) |
commit | add64399c54859d26f9954fb06d616dbd00bffe7 (patch) | |
tree | 8d1008e2cec9417057c7371738d93fccc830b489 /Tests/CMakeCommands/target_link_libraries/cmp0022/staticlib2.cpp | |
parent | 790c225208d389b332828014b55894e9f9c5d0e8 (diff) | |
download | CMake-add64399c54859d26f9954fb06d616dbd00bffe7.zip CMake-add64399c54859d26f9954fb06d616dbd00bffe7.tar.gz CMake-add64399c54859d26f9954fb06d616dbd00bffe7.tar.bz2 |
target_link_libraries: Restore LINK_ONLY for multiple static lib dependencies
Since commit c1e812ad4f (target_link_libraries: Improve tolerance of
unquoted generator expressions, 2022-02-15, v3.23.0-rc2~11^2) we
accumulate consecutive non-keyword arguments to recover an unquoted
generator expression as a single entry. When given multiple consecutive
non-genex library names, the grouping breaks our logic that expects each
entry is either a raw target name or a genex. Revise the logic to only
accumulate multiple arguments when they end inside a partial genex.
This bug caused `target_link_libraries` to stop wrapping static library
private dependencies in `$<LINK_ONLY:...>` for `INTERFACE_LINK_LIBRARIES`
when multiple consecutive library names are given. Add a test case
covering that behavior.
Fixes: #23302
Diffstat (limited to 'Tests/CMakeCommands/target_link_libraries/cmp0022/staticlib2.cpp')
-rw-r--r-- | Tests/CMakeCommands/target_link_libraries/cmp0022/staticlib2.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Tests/CMakeCommands/target_link_libraries/cmp0022/staticlib2.cpp b/Tests/CMakeCommands/target_link_libraries/cmp0022/staticlib2.cpp index bd1a901..caa4143 100644 --- a/Tests/CMakeCommands/target_link_libraries/cmp0022/staticlib2.cpp +++ b/Tests/CMakeCommands/target_link_libraries/cmp0022/staticlib2.cpp @@ -1,3 +1,9 @@ +#ifndef STATICLIB2_IFACE_1 +# error "STATICLIB2_IFACE_1 incorrectly not defined" +#endif +#ifndef STATICLIB2_IFACE_2 +# error "STATICLIB2_IFACE_2 incorrectly not defined" +#endif int staticlib2() { |