diff options
author | Brad King <brad.king@kitware.com> | 2016-08-10 15:16:01 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2016-08-10 15:16:01 (GMT) |
commit | 50ada755e3c133149f76dddfd0921eb7a9d32506 (patch) | |
tree | 36106626f597c1879467704511880ad61789e785 /Source | |
parent | 655d242b90a06c5904b67ce063361dfb646e85b3 (diff) | |
parent | 93ac2a78d5e0dbb6607105cc8d2a3f19ebdd8583 (diff) | |
download | CMake-50ada755e3c133149f76dddfd0921eb7a9d32506.zip CMake-50ada755e3c133149f76dddfd0921eb7a9d32506.tar.gz CMake-50ada755e3c133149f76dddfd0921eb7a9d32506.tar.bz2 |
Merge topic '15687-xcode-support-system-include'
93ac2a78 Xcode: Obey SYSTEM keyword for includes (#15687)
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmGlobalXCodeGenerator.cxx | 48 |
1 files changed, 34 insertions, 14 deletions
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index b396ea1..780ca90 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -1907,23 +1907,40 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmGeneratorTarget* gtgt, BuildObjectListOrString dirs(this, this->XcodeVersion >= 30); BuildObjectListOrString fdirs(this, this->XcodeVersion >= 30); - std::vector<std::string> includes; - this->CurrentLocalGenerator->GetIncludeDirectories(includes, gtgt, "C", - configName); std::set<std::string> emitted; emitted.insert("/System/Library/Frameworks"); - for (std::vector<std::string>::iterator i = includes.begin(); - i != includes.end(); ++i) { - if (this->NameResolvesToFramework(i->c_str())) { - std::string frameworkDir = *i; - frameworkDir += "/../"; - frameworkDir = cmSystemTools::CollapseFullPath(frameworkDir); - if (emitted.insert(frameworkDir).second) { - fdirs.Add(this->XCodeEscapePath(frameworkDir)); + + if (this->XcodeVersion < 60) { + std::vector<std::string> includes; + this->CurrentLocalGenerator->GetIncludeDirectories(includes, gtgt, "C", + configName); + for (std::vector<std::string>::iterator i = includes.begin(); + i != includes.end(); ++i) { + if (this->NameResolvesToFramework(i->c_str())) { + std::string frameworkDir = *i; + frameworkDir += "/../"; + frameworkDir = cmSystemTools::CollapseFullPath(frameworkDir); + if (emitted.insert(frameworkDir).second) { + fdirs.Add(this->XCodeEscapePath(frameworkDir)); + } + } else { + std::string incpath = this->XCodeEscapePath(*i); + dirs.Add(incpath); + } + } + } else { + for (std::set<std::string>::iterator li = languages.begin(); + li != languages.end(); ++li) { + std::vector<std::string> includes; + this->CurrentLocalGenerator->GetIncludeDirectories(includes, gtgt, *li, + configName); + std::string includeFlags = this->CurrentLocalGenerator->GetIncludeFlags( + includes, gtgt, *li, true, false, configName); + + std::string& flags = cflags[*li]; + if (!includeFlags.empty()) { + flags += " " + includeFlags; } - } else { - std::string incpath = this->XCodeEscapePath(*i); - dirs.Add(incpath); } } // Add framework search paths needed for linking. @@ -2008,6 +2025,9 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmGeneratorTarget* gtgt, this->CreateString(flags)); } else if (*li == "C") { buildSettings->AddAttribute("OTHER_CFLAGS", this->CreateString(flags)); + } else if (*li == "Swift") { + buildSettings->AddAttribute("OTHER_SWIFT_FLAGS", + this->CreateString(flags)); } } |