mirror of
https://gitlab.kitware.com/cmake/cmake.git
synced 2026-10-06 04:03:27 +03:00
CPS: Support importing link_libraries
Teach CPS import to read the `link_libraries` attribute. We've exported this for a long time, but apparently the code to read it back was never implemented. (To be fair, use of this attribute is discouraged.)
This commit is contained in:
1 parent
3071bc6c87
commit
9fa2b5dd99
3 files changed
+10
No files matched your search
@@ -801,6 +801,10 @@ void cmPackageInfoReader::SetTargetProperties(
|
||||
configuration, NormalizeTargetName(dep, package));
|
||||
}
|
||||
|
||||
for (std::string const& lib : ReadList(data, "link_libraries")) {
|
||||
AppendProperty(makefile, target, "LINK_LIBRARIES"_s, configuration, lib);
|
||||
}
|
||||
|
||||
// TODO: Handle non-configuration modules
|
||||
// once IMPORTED_CXX_MODULES supports it
|
||||
if (!configuration.empty()) {
|
||||
|
||||
@@ -225,6 +225,10 @@ target_link_libraries(requires-test RequiresTest::Indirect)
|
||||
add_executable(requires-test-compile_only requires-test.cxx)
|
||||
target_link_libraries(requires-test-compile_only RequiresTest::CompileOnly)
|
||||
|
||||
expect_property(
|
||||
RequiresTest::Other INTERFACE_LINK_LIBRARIES
|
||||
"link libraries" "every-config;$<$<CONFIG:test>:test-config>")
|
||||
|
||||
expect_property(
|
||||
RequiresTest::Other IMPORTED_LINK_DEPENDENT_LIBRARIES
|
||||
"dyld requirements (any config)" "RequiresTest::Private1")
|
||||
|
||||
@@ -36,9 +36,11 @@
|
||||
},
|
||||
"Other": {
|
||||
"type": "dylib",
|
||||
"link_libraries": [ "every-config" ],
|
||||
"dyld_requires": [ ":Private1" ],
|
||||
"configurations": {
|
||||
"test": {
|
||||
"link_libraries": [ "test-config" ],
|
||||
"dyld_requires": [ ":Private2" ]
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user