Merge topic 'ipo-xcode'

7e75568b Xcode: Support IPO (LTO)

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !785
This commit is contained in:
Brad King
2017-05-03 15:04:08 +00:00
committed by Kitware Robot
5 changed files with 10 additions and 6 deletions
+1 -1
View File
@@ -217,7 +217,7 @@ function(check_ipo_supported)
return()
endif()
if(CMAKE_GENERATOR MATCHES "^(Visual Studio |Xcode$)")
if(CMAKE_GENERATOR MATCHES "^Visual Studio ")
_ipo_not_supported("CMake doesn't support IPO for current generator")
return()
endif()
+5 -2
View File
@@ -1683,8 +1683,11 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmGeneratorTarget* gtgt,
return;
}
// Check IPO related warning/error.
gtgt->IsIPOEnabled(configName);
if (gtgt->IsIPOEnabled(configName)) {
const char* ltoValue =
this->CurrentMakefile->IsOn("_CMAKE_LTO_THIN") ? "YES_THIN" : "YES";
buildSettings->AddAttribute("LLVM_LTO", this->CreateString(ltoValue));
}
// Add define flags
this->CurrentLocalGenerator->AppendFlags(
+2
View File
@@ -90,6 +90,8 @@ public:
bool HasKnownObjectFileLocation(std::string* reason) const CM_OVERRIDE;
bool IsIPOSupported() const CM_OVERRIDE { return true; }
bool UseEffectivePlatformName(cmMakefile* mf) const CM_OVERRIDE;
bool ShouldStripResourcePath(cmMakefile*) const CM_OVERRIDE;
+1 -2
View File
@@ -5,7 +5,6 @@ run_cmake(CMP0069-NEW-cmake)
run_cmake(CMP0069-NEW-compiler)
run_cmake(CMP0069-WARN)
string(COMPARE EQUAL "${RunCMake_GENERATOR}" "Xcode" is_xcode)
if(is_xcode OR RunCMake_GENERATOR MATCHES "^Visual Studio ")
if(RunCMake_GENERATOR MATCHES "^Visual Studio ")
run_cmake(CMP0069-NEW-generator)
endif()
@@ -8,6 +8,6 @@ run_cmake(not-supported-by-compiler)
run_cmake(save-to-result)
run_cmake(cmp0069-is-old)
if(RunCMake_GENERATOR MATCHES "^(Visual Studio |Xcode$)")
if(RunCMake_GENERATOR MATCHES "^Visual Studio ")
run_cmake(not-supported-by-generator)
endif()