IPO: Consider support for each language separately

We only define `INTERPROCEDURAL_OPTIMIZATION` behavior for C, CXX, and
Fortran languages.  Do not try to enable support for other languages.
Furthermore, each language builds with a different compiler, so check
for support by CMake and the compiler for each language independently.

Fixes: #16944
This commit is contained in:
Brad King
2017-06-14 10:12:48 -04:00
parent d025faf436
commit ba247ccaba
22 changed files with 62 additions and 52 deletions
+1 -1
View File
@@ -1666,7 +1666,7 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmGeneratorTarget* gtgt,
return;
}
if (gtgt->IsIPOEnabled(configName)) {
if (gtgt->IsIPOEnabled(llang, configName)) {
const char* ltoValue =
this->CurrentMakefile->IsOn("_CMAKE_LTO_THIN") ? "YES_THIN" : "YES";
buildSettings->AddAttribute("LLVM_LTO", this->CreateString(ltoValue));