summaryrefslogtreecommitdiffstats
path: root/Source/cmInstallTargetGenerator.cxx
diff options
context:
space:
mode:
authorLior Goldberg <liorgol.dev@gmail.com>2015-12-25 13:08:51 (GMT)
committerBrad King <brad.king@kitware.com>2016-01-15 19:53:24 (GMT)
commit3ec9226779776811240bde88a3f173c29aa935b5 (patch)
tree1458dd0e28c4da13fe58e03bfc65f717566e10b2 /Source/cmInstallTargetGenerator.cxx
parentb8d002af1aeefb435a9560b056f081e5d8dff734 (diff)
downloadCMake-3ec9226779776811240bde88a3f173c29aa935b5.zip
CMake-3ec9226779776811240bde88a3f173c29aa935b5.tar.gz
CMake-3ec9226779776811240bde88a3f173c29aa935b5.tar.bz2
install: Do not remove compiler-defined RPATH entries
Some compilers may add their own RPATH entries when invoking the linker. For example, a GCC installation may contain the following definition in the specs file: *link_libgcc: %D -rpath <<some specific rpath in which libstdc++.so can be found>> In this case binaries may contain RPATH entries that CMake did not add. When we update the RPATH on installation we must preserve these entries even if CMake thinks the INSTALL_RPATH value should be empty. Fix this by always using file(RPATH_CHANGE) and teach it to behave as file(RPATH_REMOVE) if the actual RPATH in the file is empty after replacing the build-tree RPATH with the install-tree RPATH. This will preserve any compiler-added RPATH value instead of removing it.
Diffstat (limited to 'Source/cmInstallTargetGenerator.cxx')
-rw-r--r--Source/cmInstallTargetGenerator.cxx16
1 files changed, 4 insertions, 12 deletions
diff --git a/Source/cmInstallTargetGenerator.cxx b/Source/cmInstallTargetGenerator.cxx
index 1158a27..5e88fa2 100644
--- a/Source/cmInstallTargetGenerator.cxx
+++ b/Source/cmInstallTargetGenerator.cxx
@@ -791,18 +791,10 @@ cmInstallTargetGenerator
}
// Write a rule to run chrpath to set the install-tree RPATH
- if(newRpath.empty())
- {
- os << indent << "file(RPATH_REMOVE\n"
- << indent << " FILE \"" << toDestDirPath << "\")\n";
- }
- else
- {
- os << indent << "file(RPATH_CHANGE\n"
- << indent << " FILE \"" << toDestDirPath << "\"\n"
- << indent << " OLD_RPATH \"" << oldRpath << "\"\n"
- << indent << " NEW_RPATH \"" << newRpath << "\")\n";
- }
+ os << indent << "file(RPATH_CHANGE\n"
+ << indent << " FILE \"" << toDestDirPath << "\"\n"
+ << indent << " OLD_RPATH \"" << oldRpath << "\"\n"
+ << indent << " NEW_RPATH \"" << newRpath << "\")\n";
}
}