summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorGregor Jasny <gjasny@googlemail.com>2019-02-05 13:23:31 (GMT)
committerBrad King <brad.king@kitware.com>2019-02-07 11:43:51 (GMT)
commit8af334f5baa1a628895571491f67a4f7d9483d9b (patch)
tree23ed607ee777b3b3bfbbee6bde97794d3c6b0730 /Source
parent6f23321d405930241fa431cfda7650f2993f0c19 (diff)
downloadCMake-8af334f5baa1a628895571491f67a4f7d9483d9b.zip
CMake-8af334f5baa1a628895571491f67a4f7d9483d9b.tar.gz
CMake-8af334f5baa1a628895571491f67a4f7d9483d9b.tar.bz2
Xcode: Derive stdlib from CXX flags
Closes: #18396
Diffstat (limited to 'Source')
-rw-r--r--Source/cmGlobalXCodeGenerator.cxx16
1 files changed, 16 insertions, 0 deletions
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index 16f8a0e..51c001e 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -2254,6 +2254,22 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmGeneratorTarget* gtgt,
debugStr = "NO";
}
+ // extract C++ stdlib
+ for (auto const& language : languages) {
+ if (language != "CXX") {
+ continue;
+ }
+ std::string& flags = cflags[language];
+
+ auto stdlib =
+ this->ExtractFlagRegex("(^| )(-stdlib=[^ ]+)( |$)", 2, flags);
+ if (stdlib.size() > 8) {
+ const auto cxxLibrary = stdlib.substr(8);
+ buildSettings->AddAttribute("CLANG_CXX_LIBRARY",
+ this->CreateString(cxxLibrary));
+ }
+ }
+
buildSettings->AddAttribute("COMBINE_HIDPI_IMAGES",
this->CreateString("YES"));
buildSettings->AddAttribute("GCC_GENERATE_DEBUGGING_SYMBOLS",