summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2024-11-21 23:18:33 (GMT)
committerBrad King <brad.king@kitware.com>2024-11-22 00:02:00 (GMT)
commitcd6fb6309328a9c113f1fe3c2b842d4650c81980 (patch)
tree73ec7385b4a4729972995bd39250a7c5c16e0dc4 /Source
parenteb281d34548f4234e68ff31d1050aca7e8441d86 (diff)
downloadCMake-cd6fb6309328a9c113f1fe3c2b842d4650c81980.zip
CMake-cd6fb6309328a9c113f1fe3c2b842d4650c81980.tar.gz
CMake-cd6fb6309328a9c113f1fe3c2b842d4650c81980.tar.bz2
AIX: Propagate AIX_SHARED_LIBRARY_ARCHIVE through exports
Teach `export()` and `install(EXPORT)` to record this setting on the imported targets they generate. Make this property's non-presence authoritative on imported targets since they represent what was built elsewhere.
Diffstat (limited to 'Source')
-rw-r--r--Source/cmExportCMakeConfigGenerator.cxx6
-rw-r--r--Source/cmInstallImportedRuntimeArtifactsGenerator.cxx12
-rw-r--r--Source/cmTarget.cxx5
3 files changed, 18 insertions, 5 deletions
diff --git a/Source/cmExportCMakeConfigGenerator.cxx b/Source/cmExportCMakeConfigGenerator.cxx
index 4f4765c..e85d949 100644
--- a/Source/cmExportCMakeConfigGenerator.cxx
+++ b/Source/cmExportCMakeConfigGenerator.cxx
@@ -334,6 +334,12 @@ void cmExportCMakeConfigGenerator::GenerateImportTargetCode(
os << "set_property(TARGET " << targetName << " PROPERTY BUNDLE 1)\n";
}
+ // Mark the imported library if it is an AIX shared library archive.
+ if (target->IsArchivedAIXSharedLibrary()) {
+ os << "set_property(TARGET " << targetName
+ << " PROPERTY AIX_SHARED_LIBRARY_ARCHIVE 1)\n";
+ }
+
// generate DEPRECATION
if (target->IsDeprecated()) {
os << "set_property(TARGET " << targetName << " PROPERTY DEPRECATION "
diff --git a/Source/cmInstallImportedRuntimeArtifactsGenerator.cxx b/Source/cmInstallImportedRuntimeArtifactsGenerator.cxx
index 01980ac..79b18e5 100644
--- a/Source/cmInstallImportedRuntimeArtifactsGenerator.cxx
+++ b/Source/cmInstallImportedRuntimeArtifactsGenerator.cxx
@@ -107,11 +107,13 @@ void cmInstallImportedRuntimeArtifactsGenerator::GenerateScriptForConfig(
}
} else {
std::vector<std::string> files{ location };
- auto soName = this->Target->GetSOName(config);
- auto soNameFile =
- cmStrCat(this->Target->GetDirectory(config), '/', soName);
- if (!soName.empty() && soNameFile != location) {
- files.push_back(soNameFile);
+ if (!this->Target->IsArchivedAIXSharedLibrary()) {
+ auto soName = this->Target->GetSOName(config);
+ auto soNameFile =
+ cmStrCat(this->Target->GetDirectory(config), '/', soName);
+ if (!soName.empty() && soNameFile != location) {
+ files.push_back(soNameFile);
+ }
}
this->AddInstallRule(os, this->GetDestination(config),
cmInstallType_SHARED_LIBRARY, files,
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index f220837..f1dcc76 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -1087,6 +1087,11 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type,
}
}
+ // Imported targets must set AIX_SHARED_LIBRARY_ARCHIVE explicitly.
+ if (this->IsImported() && property == "AIX_SHARED_LIBRARY_ARCHIVE"_s) {
+ return;
+ }
+
// Replace everything after "CMAKE_"
defKey.replace(defKey.begin() + 6, defKey.end(), property);
if (cmValue value = mf->GetDefinition(defKey)) {