summaryrefslogtreecommitdiffstats
path: root/Source/cmInstallTargetGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2023-03-28 15:38:29 (GMT)
committerBrad King <brad.king@kitware.com>2023-03-28 16:06:24 (GMT)
commit9c14f1484871fb667611e531b9a7139279924f74 (patch)
treee7ae1fa23f0e35ef3806f4185fddee7af4b589b3 /Source/cmInstallTargetGenerator.cxx
parentf4b8176447699ba82c2bf7baf2d609d0d6e3259b (diff)
downloadCMake-9c14f1484871fb667611e531b9a7139279924f74.zip
CMake-9c14f1484871fb667611e531b9a7139279924f74.tar.gz
CMake-9c14f1484871fb667611e531b9a7139279924f74.tar.bz2
install(TARGETS): Do not apply installation tweaks to NAMELINK files
These files are symlinks to the real binaries, and we already apply tweaks to those. Previously we generated installation tweak code guarded by a `NOT IS_SYMLINK` condition that is never true. Drop the code altogether. Add a test covering the motivating use case, in which a `POST_BUILD` step modifies the namelink file to not actually be a symlink. Fixes: #24647
Diffstat (limited to 'Source/cmInstallTargetGenerator.cxx')
-rw-r--r--Source/cmInstallTargetGenerator.cxx10
1 files changed, 6 insertions, 4 deletions
diff --git a/Source/cmInstallTargetGenerator.cxx b/Source/cmInstallTargetGenerator.cxx
index 6c31da6..9220123 100644
--- a/Source/cmInstallTargetGenerator.cxx
+++ b/Source/cmInstallTargetGenerator.cxx
@@ -529,7 +529,7 @@ void cmInstallTargetGenerator::AddInstallNamePatchRule(
std::ostream& os, Indent indent, const std::string& config,
std::string const& toDestDirPath)
{
- if (this->ImportLibrary ||
+ if (this->ImportLibrary || this->NamelinkMode == NamelinkModeOnly ||
!(this->Target->GetType() == cmStateEnums::SHARED_LIBRARY ||
this->Target->GetType() == cmStateEnums::MODULE_LIBRARY ||
this->Target->GetType() == cmStateEnums::EXECUTABLE)) {
@@ -626,7 +626,8 @@ void cmInstallTargetGenerator::AddRPathCheckRule(
std::string const& toDestDirPath)
{
// Skip the chrpath if the target does not need it.
- if (this->ImportLibrary || !this->Target->IsChrpathUsed(config)) {
+ if (this->ImportLibrary || this->NamelinkMode == NamelinkModeOnly ||
+ !this->Target->IsChrpathUsed(config)) {
return;
}
// Skip if on Apple
@@ -677,7 +678,8 @@ void cmInstallTargetGenerator::AddChrpathPatchRule(
std::string const& toDestDirPath)
{
// Skip the chrpath if the target does not need it.
- if (this->ImportLibrary || !this->Target->IsChrpathUsed(config)) {
+ if (this->ImportLibrary || this->NamelinkMode == NamelinkModeOnly ||
+ !this->Target->IsChrpathUsed(config)) {
return;
}
@@ -816,7 +818,7 @@ void cmInstallTargetGenerator::AddStripRule(std::ostream& os, Indent indent,
// don't strip static and import libraries, because it removes the only
// symbol table they have so you can't link to them anymore
if (this->Target->GetType() == cmStateEnums::STATIC_LIBRARY ||
- this->ImportLibrary) {
+ this->ImportLibrary || this->NamelinkMode == NamelinkModeOnly) {
return;
}