ENH: only allow usage of chrpath if the executable file format is ELF
Alex
This commit is contained in:
parent
474629568c
commit
3da6fd9da4
|
@ -2537,7 +2537,8 @@ void cmTarget::GetLanguages(std::set<cmStdString>& languages) const
|
||||||
|
|
||||||
bool cmTarget::IsChrpathAvailable()
|
bool cmTarget::IsChrpathAvailable()
|
||||||
{
|
{
|
||||||
//only return true if the flag is "-Wl,rpath," amd the separator is not empty
|
//only return true if chrpath has been found (happens only if the executable
|
||||||
|
// format is ELF) and if the separator is not empty
|
||||||
if (this->Makefile->IsSet("CMAKE_CHRPATH")==false)
|
if (this->Makefile->IsSet("CMAKE_CHRPATH")==false)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
|
@ -2550,10 +2551,9 @@ bool cmTarget::IsChrpathAvailable()
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string runTimeFlagVar = "CMAKE_SHARED_LIBRARY_RUNTIME_";
|
std::string runTimeFlagSepVar = "CMAKE_SHARED_LIBRARY_RUNTIME_";
|
||||||
runTimeFlagVar += linkLanguage;
|
runTimeFlagSepVar += linkLanguage;
|
||||||
runTimeFlagVar += "_FLAG";
|
runTimeFlagSepVar += "_FLAG_SEP";
|
||||||
std::string runTimeFlagSepVar = runTimeFlagVar + "_SEP";
|
|
||||||
|
|
||||||
std::string runtimeSep =
|
std::string runtimeSep =
|
||||||
this->Makefile->GetSafeDefinition(runTimeFlagSepVar.c_str());
|
this->Makefile->GetSafeDefinition(runTimeFlagSepVar.c_str());
|
||||||
|
@ -2563,13 +2563,5 @@ bool cmTarget::IsChrpathAvailable()
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string runtimeFlag =
|
|
||||||
this->Makefile->GetSafeDefinition(runTimeFlagVar.c_str());
|
|
||||||
|
|
||||||
if (runtimeFlag!="-Wl,-rpath,")
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue