summaryrefslogtreecommitdiffstats
path: root/Source/cmExportFileGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2024-05-09 17:38:35 (GMT)
committerBrad King <brad.king@kitware.com>2024-05-21 13:22:51 (GMT)
commitb9ee79b8a13abb957a176ff0b5eab1e5d33efc50 (patch)
treeb3cb6301b38f03f953dcea719fa1dec800022ada /Source/cmExportFileGenerator.cxx
parent633afa0b2e27a6eca3a4b1e123a80cf4338fe509 (diff)
downloadCMake-b9ee79b8a13abb957a176ff0b5eab1e5d33efc50.zip
CMake-b9ee79b8a13abb957a176ff0b5eab1e5d33efc50.tar.gz
CMake-b9ee79b8a13abb957a176ff0b5eab1e5d33efc50.tar.bz2
GenEx: Add support for custom transitive compile properties
Teach the `$<TARGET_PROPERTY:...>` generator expression to check for a new `TRANSITIVE_COMPILE_PROPERTIES` property in the target's link closure to enable transitive evaluation of named properties through the link closure, excluding entries guarded by `$<LINK_ONLY:...>`. Issue: #20416
Diffstat (limited to 'Source/cmExportFileGenerator.cxx')
-rw-r--r--Source/cmExportFileGenerator.cxx19
1 files changed, 19 insertions, 0 deletions
diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx
index 9bd7f49..a7d0d7e 100644
--- a/Source/cmExportFileGenerator.cxx
+++ b/Source/cmExportFileGenerator.cxx
@@ -604,6 +604,25 @@ void cmExportFileGenerator::PopulateCompatibleInterfaceProperties(
}
}
+void cmExportFileGenerator::PopulateCustomTransitiveInterfaceProperties(
+ cmGeneratorTarget const* target,
+ cmGeneratorExpression::PreprocessContext preprocessRule,
+ ImportPropertyMap& properties)
+{
+ this->PopulateInterfaceProperty("TRANSITIVE_COMPILE_PROPERTIES", target,
+ properties);
+ std::set<std::string> ifaceProperties;
+ for (std::string const& config : this->Configurations) {
+ for (auto const& i : target->GetCustomTransitiveProperties(
+ config, cmGeneratorTarget::PropertyFor::Interface)) {
+ ifaceProperties.emplace(i.second.InterfaceName);
+ }
+ }
+ for (std::string const& ip : ifaceProperties) {
+ this->PopulateInterfaceProperty(ip, target, preprocessRule, properties);
+ }
+}
+
void cmExportFileGenerator::GenerateInterfaceProperties(
const cmGeneratorTarget* target, std::ostream& os,
const ImportPropertyMap& properties)