mirror of
https://github.com/Kitware/CMake.git
synced 2026-02-21 14:40:26 -06:00
Merge topic 'apple-merge-same-sysroot'
3a7d1e9592 Apple: Merge per-arch sysroot parameters if all are the same
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4647
This commit is contained in:
@@ -1880,6 +1880,26 @@ std::string cmLocalGenerator::GetLinkLibsCMP0065(
|
||||
return linkFlags;
|
||||
}
|
||||
|
||||
bool cmLocalGenerator::AllAppleArchSysrootsAreTheSame(
|
||||
const std::vector<std::string>& archs, const char* sysroot)
|
||||
{
|
||||
if (!sysroot) {
|
||||
return false;
|
||||
}
|
||||
|
||||
for (std::string const& arch : archs) {
|
||||
std::string const& archSysroot = this->AppleArchSysroots[arch];
|
||||
if (cmIsOff(archSysroot)) {
|
||||
continue;
|
||||
}
|
||||
if (archSysroot != sysroot) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void cmLocalGenerator::AddArchitectureFlags(std::string& flags,
|
||||
cmGeneratorTarget const* target,
|
||||
const std::string& lang,
|
||||
@@ -1908,7 +1928,8 @@ void cmLocalGenerator::AddArchitectureFlags(std::string& flags,
|
||||
std::string("CMAKE_") + lang + "_SYSROOT_FLAG";
|
||||
const char* sysrootFlag = this->Makefile->GetDefinition(sysrootFlagVar);
|
||||
if (sysrootFlag && *sysrootFlag) {
|
||||
if (!this->AppleArchSysroots.empty()) {
|
||||
if (!this->AppleArchSysroots.empty() &&
|
||||
!this->AllAppleArchSysrootsAreTheSame(archs, sysroot)) {
|
||||
for (std::string const& arch : archs) {
|
||||
std::string const& archSysroot = this->AppleArchSysroots[arch];
|
||||
if (cmIsOff(archSysroot)) {
|
||||
|
||||
@@ -538,6 +538,8 @@ private:
|
||||
int targetType);
|
||||
|
||||
void ComputeObjectMaxPath();
|
||||
bool AllAppleArchSysrootsAreTheSame(const std::vector<std::string>& archs,
|
||||
const char* sysroot);
|
||||
};
|
||||
|
||||
#if !defined(CMAKE_BOOTSTRAP)
|
||||
|
||||
Reference in New Issue
Block a user