Index: build/config/android/BUILD.gn |
diff --git a/build/config/android/BUILD.gn b/build/config/android/BUILD.gn |
index e4837d4d99ce412c4457d06521c090c1d8360178..8b42a2ec0afe12f4e16b9d9724e2fb8bb81cc394 100644 |
--- a/build/config/android/BUILD.gn |
+++ b/build/config/android/BUILD.gn |
@@ -96,12 +96,30 @@ config("runtime_library") { |
# arm-linux-androideabi-4.4.3 toolchain (circa Gingerbread) will exhibit |
# strange errors. The include ordering here is important; change with |
# caution. |
- cflags_cc = [ |
- "-isystem" + |
- rebase_path("$android_libcpp_root/libcxx/include", root_build_dir), |
- "-isystem" + rebase_path( |
+ cflags_cc = [] |
+ if (android_ndk_major_version >= 13) { |
+ libcxx_include_path = |
+ rebase_path("$android_libcpp_root/include", root_build_dir) |
+ libcxxabi_include_path = |
+ rebase_path("$android_ndk_root/sources/cxx-stl/llvm-libc++abi/include", |
+ root_build_dir) |
+ |
+ if (!is_clang) { |
+ # Per the release notes, GCC is not supported in the NDK starting with |
+ # r13. It's still present, though, and has conflicting declarations of |
+ # float abs(float). |
+ cflags_cc += [ "-Wno-attributes" ] |
+ } |
+ } else { |
+ libcxx_include_path = |
+ rebase_path("$android_libcpp_root/libcxx/include", root_build_dir) |
+ libcxxabi_include_path = rebase_path( |
"$android_ndk_root/sources/cxx-stl/llvm-libc++abi/libcxxabi/include", |
- root_build_dir), |
+ root_build_dir) |
+ } |
+ cflags_cc += [ |
+ "-isystem" + libcxx_include_path, |
+ "-isystem" + libcxxabi_include_path, |
"-isystem" + |
rebase_path("$android_ndk_root/sources/android/support/include", |
root_build_dir), |