diff options
author | Brad King <brad.king@kitware.com> | 2008-03-01 17:51:07 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2008-03-01 17:51:07 (GMT) |
commit | 34c76d4304064d7d0e28ceaeee8ba4048497215a (patch) | |
tree | 1fe059dba6b66836c39b0e2b2c0d622a78b5c981 /Source/cmTarget.cxx | |
parent | 61178a0682a024e03e6fe41897b40bb096611f7a (diff) | |
download | CMake-34c76d4304064d7d0e28ceaeee8ba4048497215a.zip CMake-34c76d4304064d7d0e28ceaeee8ba4048497215a.tar.gz CMake-34c76d4304064d7d0e28ceaeee8ba4048497215a.tar.bz2 |
ENH: Use builtin chrpath instead of relinking ELF targets
- Add cmSystemTools::ChangeRPath method
- Add undocumented file(CHRPATH) command
- When installing use file(CHRPATH) to change the rpath
instead of relinking
- Remove CMAKE_CHRPATH lookup from CMakeFindBinUtils
- Remove CMAKE_USE_CHRPATH option since this should
always work
Diffstat (limited to 'Source/cmTarget.cxx')
-rw-r--r-- | Source/cmTarget.cxx | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index b4c36c6..880c370 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -3006,8 +3006,9 @@ void cmTarget::GetLanguages(std::set<cmStdString>& languages) const //---------------------------------------------------------------------------- bool cmTarget::IsChrpathUsed() { - // Enable use of "chrpath" if it is available, the user has turned - // on the feature, and the rpath flag uses a separator. +#if defined(CMAKE_USE_ELF_PARSER) + // Enable if the rpath flag uses a separator and the target uses ELF + // binaries. if(const char* ll = this->GetLinkerLanguage( this->Makefile->GetLocalGenerator()->GetGlobalGenerator())) { @@ -3017,13 +3018,16 @@ bool cmTarget::IsChrpathUsed() const char* sep = this->Makefile->GetDefinition(sepVar.c_str()); if(sep && *sep) { - if(this->Makefile->IsSet("CMAKE_CHRPATH") && - this->Makefile->IsOn("CMAKE_USE_CHRPATH")) + // TODO: Add ELF check to ABI detection and get rid of + // CMAKE_EXECUTABLE_FORMAT. + if(const char* fmt = + this->Makefile->GetDefinition("CMAKE_EXECUTABLE_FORMAT")) { - return true; + return strcmp(fmt, "ELF") == 0; } } } +#endif return false; } |