Fix C++ on Darwin
Port of https://android-review.googlesource.com/207241
Change-Id: Idad81a528a2104579de0225b0724bb81293eea44
diff --git a/cc/cc.go b/cc/cc.go
index d79cdbe..4a87433 100644
--- a/cc/cc.go
+++ b/cc/cc.go
@@ -955,6 +955,10 @@
// Host builds will use GNU libstdc++.
if ctx.Device() {
flags.CFlags = append(flags.CFlags, "-I"+common.PathForSource(ctx, "bionic/libstdc++/include").String())
+ } else {
+ // Host builds will use the system C++. libc++ on Darwin, GNU libstdc++ everywhere else
+ flags.CppFlags = append(flags.CppFlags, flags.Toolchain.SystemCppCppflags())
+ flags.LdFlags = append(flags.LdFlags, flags.Toolchain.SystemCppLdflags())
}
case "ndk_system":
ndkSrcRoot := common.PathForSource(ctx, "prebuilts/ndk/current/sources/cxx-stl/system/include")