OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 import("//build/config/android/config.gni") | 5 import("//build/config/android/config.gni") |
6 import("//build/config/sanitizers/sanitizers.gni") | 6 import("//build/config/sanitizers/sanitizers.gni") |
7 | 7 |
8 assert(is_android) | 8 assert(is_android) |
9 | 9 |
10 # This is included by reference in the //build/config/compiler config that | 10 # This is included by reference in the //build/config/compiler config that |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 # config that is applied to all targets. It is here to separate out the logic | 89 # config that is applied to all targets. It is here to separate out the logic |
90 # that is Android-only. Please see that target for advice on what should go in | 90 # that is Android-only. Please see that target for advice on what should go in |
91 # :runtime_library vs. :compiler. | 91 # :runtime_library vs. :compiler. |
92 config("runtime_library") { | 92 config("runtime_library") { |
93 # NOTE: The libc++ header include paths below are specified in cflags_cc | 93 # NOTE: The libc++ header include paths below are specified in cflags_cc |
94 # rather than include_dirs because they need to come after include_dirs. | 94 # rather than include_dirs because they need to come after include_dirs. |
95 # Think of them like system headers, but don't use '-isystem' because the | 95 # Think of them like system headers, but don't use '-isystem' because the |
96 # arm-linux-androideabi-4.4.3 toolchain (circa Gingerbread) will exhibit | 96 # arm-linux-androideabi-4.4.3 toolchain (circa Gingerbread) will exhibit |
97 # strange errors. The include ordering here is important; change with | 97 # strange errors. The include ordering here is important; change with |
98 # caution. | 98 # caution. |
99 cflags_cc = [ | 99 cflags_cc = [] |
100 "-isystem" + | 100 if (android_ndk_major_version >= 13) { |
101 rebase_path("$android_libcpp_root/libcxx/include", root_build_dir), | 101 libcxx_include_path = |
102 "-isystem" + rebase_path( | 102 rebase_path("$android_libcpp_root/include", root_build_dir) |
| 103 libcxxabi_include_path = |
| 104 rebase_path("$android_ndk_root/sources/cxx-stl/llvm-libc++abi/include", |
| 105 root_build_dir) |
| 106 |
| 107 if (!is_clang) { |
| 108 # Per the release notes, GCC is not supported in the NDK starting with |
| 109 # r13. It's still present, though, and has conflicting declarations of |
| 110 # float abs(float). |
| 111 cflags_cc += [ "-Wno-attributes" ] |
| 112 } |
| 113 } else { |
| 114 libcxx_include_path = |
| 115 rebase_path("$android_libcpp_root/libcxx/include", root_build_dir) |
| 116 libcxxabi_include_path = rebase_path( |
103 "$android_ndk_root/sources/cxx-stl/llvm-libc++abi/libcxxabi/include"
, | 117 "$android_ndk_root/sources/cxx-stl/llvm-libc++abi/libcxxabi/include"
, |
104 root_build_dir), | 118 root_build_dir) |
| 119 } |
| 120 cflags_cc += [ |
| 121 "-isystem" + libcxx_include_path, |
| 122 "-isystem" + libcxxabi_include_path, |
105 "-isystem" + | 123 "-isystem" + |
106 rebase_path("$android_ndk_root/sources/android/support/include", | 124 rebase_path("$android_ndk_root/sources/android/support/include", |
107 root_build_dir), | 125 root_build_dir), |
108 ] | 126 ] |
109 | 127 |
110 defines = [ "__GNU_SOURCE=1" ] # Necessary for clone(). | 128 defines = [ "__GNU_SOURCE=1" ] # Necessary for clone(). |
111 ldflags = [ "-nostdlib" ] | 129 ldflags = [ "-nostdlib" ] |
112 lib_dirs = [ android_libcpp_lib_dir ] | 130 lib_dirs = [ android_libcpp_lib_dir ] |
113 | 131 |
114 # The libc++ runtime library (must come first). | 132 # The libc++ runtime library (must come first). |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 | 228 |
211 # Avoid errors with current NDK: | 229 # Avoid errors with current NDK: |
212 # "third_party/android_tools/ndk/toolchains/arm-linux-androideabi-4.6/preb
uilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/include/arm_neon.h:34
26:3: error: argument must be a constant" | 230 # "third_party/android_tools/ndk/toolchains/arm-linux-androideabi-4.6/preb
uilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/include/arm_neon.h:34
26:3: error: argument must be a constant" |
213 "-finstrument-functions-exclude-file-list=arm_neon.h", | 231 "-finstrument-functions-exclude-file-list=arm_neon.h", |
214 ] | 232 ] |
215 } | 233 } |
216 } | 234 } |
217 | 235 |
218 config("no_cygprofile_instrumentation") { | 236 config("no_cygprofile_instrumentation") { |
219 } | 237 } |
OLD | NEW |