AIX: Fix INSTALL_REMOVE_ENVIRONMENT_RPATH with GNU compiler

Since commit baa33acbda (AIX-GNU: Put implicit link directories in
runtime libpath, 2013-02-14, v2.8.11~184^2~1) we explicitly add the GNU
compiler driver's builtin RPATH entries.  Extend commit f08dcbffec
(Property: Add INSTALL_REMOVE_ENVIRONMENT_RPATH property, 2019-07-12,
v3.16.0-rc1~350^2~1) to exclude them.

Fixes: #27738
This commit is contained in:
Aditya Kamath authored and Brad King committed 2026-04-14 16:01:18 -04:00
1 parent 6e4c378b3e
commit fa1218290d
1 file changed
+5 -1
+5 -1
View File
@@ -2294,7 +2294,11 @@ void cmComputeLinkInformation::GetRPath(std::vector<std::string>& runtimeDirs,
// Add runtime paths required by the toolchains' runtime libraries.
// This is done even when skipping RPATH entries modeled by CMake.
{
// However, INSTALL_REMOVE_ENVIRONMENT_RPATH tells us to exclude
// toolchain-defined RPATH entries from installation.
bool const removeEnvironmentRPath = for_install &&
this->Target->GetPropertyAsBool("INSTALL_REMOVE_ENVIRONMENT_RPATH");
if (!removeEnvironmentRPath) {
cmGeneratorTarget::LinkClosure const* lc =
this->Target->GetLinkClosure(this->Config);
for (std::string const& li : lc->Languages) {