summaryrefslogtreecommitdiffstats
path: root/Source/cmGeneratorTarget.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2021-02-03 00:27:09 (GMT)
committerBrad King <brad.king@kitware.com>2021-02-03 17:26:58 (GMT)
commite017ba046ccab62fcc67e7cf8fc858e991c1d3e7 (patch)
tree134567db3c1b3b4fab193a75a06413bdf003fe8f /Source/cmGeneratorTarget.cxx
parent56fc4a325f08465b725b08b3975cd51bdd2305c8 (diff)
downloadCMake-e017ba046ccab62fcc67e7cf8fc858e991c1d3e7.zip
CMake-e017ba046ccab62fcc67e7cf8fc858e991c1d3e7.tar.gz
CMake-e017ba046ccab62fcc67e7cf8fc858e991c1d3e7.tar.bz2
AIX: Enable XCOFF editing to replace RPATH on installation
Avoid relinking before installation.
Diffstat (limited to 'Source/cmGeneratorTarget.cxx')
-rw-r--r--Source/cmGeneratorTarget.cxx27
1 files changed, 18 insertions, 9 deletions
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 0171d8a..9235faa 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -2009,10 +2009,10 @@ bool cmGeneratorTarget::NeedRelinkBeforeInstall(
std::ostringstream w;
/* clang-format off */
w <<
- "The install of the " << this->GetName() << " target requires "
- "changing an RPATH from the build tree, but this is not supported "
- "with the Ninja generator unless on an ELF-based platform. The "
- "CMAKE_BUILD_WITH_INSTALL_RPATH variable may be set to avoid this "
+ "The install of the " << this->GetName() << " target requires changing "
+ "an RPATH from the build tree, but this is not supported with the Ninja "
+ "generator unless on an ELF-based or XCOFF-based platform. "
+ "The CMAKE_BUILD_WITH_INSTALL_RPATH variable may be set to avoid this "
"relinking step."
;
/* clang-format on */
@@ -2058,20 +2058,29 @@ bool cmGeneratorTarget::IsChrpathUsed(const std::string& config) const
return true;
}
-#if defined(CMake_USE_ELF_PARSER)
- // Enable if the rpath flag uses a separator and the target uses ELF
- // binaries.
+#if defined(CMake_USE_ELF_PARSER) || defined(CMake_USE_XCOFF_PARSER)
+ // Enable if the rpath flag uses a separator and the target uses
+ // binaries we know how to edit.
std::string ll = this->GetLinkerLanguage(config);
if (!ll.empty()) {
std::string sepVar =
cmStrCat("CMAKE_SHARED_LIBRARY_RUNTIME_", ll, "_FLAG_SEP");
cmProp sep = this->Makefile->GetDefinition(sepVar);
if (cmNonempty(sep)) {
- // TODO: Add ELF check to ABI detection and get rid of
+ // TODO: Add binary format check to ABI detection and get rid of
// CMAKE_EXECUTABLE_FORMAT.
if (cmProp fmt =
this->Makefile->GetDefinition("CMAKE_EXECUTABLE_FORMAT")) {
- return (*fmt == "ELF");
+# if defined(CMake_USE_ELF_PARSER)
+ if (*fmt == "ELF") {
+ return true;
+ }
+# endif
+# if defined(CMake_USE_XCOFF_PARSER)
+ if (*fmt == "XCOFF") {
+ return true;
+ }
+# endif
}
}
}