diff options
author | Gregor Jasny <gjasny@googlemail.com> | 2016-12-27 21:18:30 (GMT) |
---|---|---|
committer | Gregor Jasny <gjasny@googlemail.com> | 2016-12-27 21:18:30 (GMT) |
commit | 88f07fb417a25f98662da2abf09a9db03f48eb7f (patch) | |
tree | 85cad64fde40939e8a720aa250512e034205f569 /Source/cmGlobalXCodeGenerator.cxx | |
parent | 65fb0fa63279b96035a144fd2f6413d1b2def47f (diff) | |
download | CMake-88f07fb417a25f98662da2abf09a9db03f48eb7f.zip CMake-88f07fb417a25f98662da2abf09a9db03f48eb7f.tar.gz CMake-88f07fb417a25f98662da2abf09a9db03f48eb7f.tar.bz2 |
Xcode: Properly mark SYSTEM includes as such
We now populate the per-language flags in addition to the header
search paths stored in HEADER_SEARCH_PATHS. This preserves include
paths for GNU assembly files (cmake/cmake#16449) and also provides
SYSTEM include semantics.
Closes: cmake/cmake#15687
Diffstat (limited to 'Source/cmGlobalXCodeGenerator.cxx')
-rw-r--r-- | Source/cmGlobalXCodeGenerator.cxx | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index 736aa91..96535eb 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -1977,6 +1977,22 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmGeneratorTarget* gtgt, buildSettings->AddAttribute("HEADER_SEARCH_PATHS", dirs.CreateList()); } + if (this->XcodeVersion >= 60) { + // Add those per-language flags in addition to HEADER_SEARCH_PATHS to gain + // system include directory awareness. We need to also keep on setting + // HEADER_SEARCH_PATHS to work around a missing compile options flag for + // GNU assembly files (#16449) + for (std::set<std::string>::iterator li = languages.begin(); + li != languages.end(); ++li) { + std::string includeFlags = this->CurrentLocalGenerator->GetIncludeFlags( + includes, gtgt, *li, true, false, configName); + + if (!includeFlags.empty()) { + cflags[*li] += " " + includeFlags; + } + } + } + bool same_gflags = true; std::map<std::string, std::string> gflags; std::string const* last_gflag = 0; |