summaryrefslogtreecommitdiffstats
path: root/Source/cmGeneratorTarget.cxx
diff options
context:
space:
mode:
authorBen Boeckel <ben.boeckel@kitware.com>2016-09-13 15:23:19 (GMT)
committerBrad King <brad.king@kitware.com>2016-09-15 17:44:58 (GMT)
commit72dfca30b94ba1e85533c61a7b5a330dfbc04da5 (patch)
tree6ab46217e829ef5b803f4c433c1d90c380539549 /Source/cmGeneratorTarget.cxx
parentea69e03afaeff76d2141ab4a330f3489297a3a41 (diff)
downloadCMake-72dfca30b94ba1e85533c61a7b5a330dfbc04da5.zip
CMake-72dfca30b94ba1e85533c61a7b5a330dfbc04da5.tar.gz
CMake-72dfca30b94ba1e85533c61a7b5a330dfbc04da5.tar.bz2
ninja: error out on relink requirements
Ninja does not support PRE_INSTALL_SCRIPT properties and does not perform the relink required by installation without help from some other mechanism, so error out if it would be required. Issue: #13934, #16304
Diffstat (limited to 'Source/cmGeneratorTarget.cxx')
-rw-r--r--Source/cmGeneratorTarget.cxx23
1 files changed, 22 insertions, 1 deletions
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 4f8c036..1e21ac4 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -1162,7 +1162,28 @@ bool cmGeneratorTarget::NeedRelinkBeforeInstall(
// If either a build or install tree rpath is set then the rpath
// will likely change between the build tree and install tree and
// this target must be relinked.
- return this->HaveBuildTreeRPATH(config) || this->HaveInstallTreeRPATH();
+ bool have_rpath =
+ this->HaveBuildTreeRPATH(config) || this->HaveInstallTreeRPATH();
+ bool is_ninja =
+ this->LocalGenerator->GetGlobalGenerator()->GetName() == "Ninja";
+
+ if (have_rpath && is_ninja) {
+ 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 "
+ "relinking step."
+ ;
+ /* clang-format on */
+
+ cmake* cm = this->LocalGenerator->GetCMakeInstance();
+ cm->IssueMessage(cmake::FATAL_ERROR, w.str(), this->GetBacktrace());
+ }
+
+ return have_rpath;
}
bool cmGeneratorTarget::IsChrpathUsed(const std::string& config) const