Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(842)

Unified Diff: gn/BUILD.gn

Issue 2275983004: GN: Android (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: note Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « BUILD.gn ('k') | gn/BUILDCONFIG.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gn/BUILD.gn
diff --git a/gn/BUILD.gn b/gn/BUILD.gn
index fecca8efe81f7dd55b097fc78194e5fbb8961ffc..0a56fa206f66facdfa400e883d070c4c2bd52de2 100644
--- a/gn/BUILD.gn
+++ b/gn/BUILD.gn
@@ -7,6 +7,11 @@ declare_args() {
cc = "cc"
cxx = "c++"
+ if (is_android) {
+ cc = "$ndk/toolchains/llvm/prebuilt/$ndk_host/bin/clang"
+ cxx = "$ndk/toolchains/llvm/prebuilt/$ndk_host/bin/clang++"
+ }
+
extra_cflags = ""
extra_cflags_c = ""
extra_cflags_cc = ""
@@ -42,6 +47,41 @@ config("default") {
"-Wnon-virtual-dtor",
]
+ if (current_cpu == "arm") {
+ cflags += [ "-mfpu=neon" ]
+ }
+
+ if (is_android) {
+ asmflags = [ "--target=$ndk_target" ]
+ cflags += [
+ "--sysroot=$ndk/platforms/$ndk_platform",
+ "--target=$ndk_target",
+ ]
+ cflags_cc += [
+ "-isystem$ndk/sources/android/support/include",
+ "-isystem$ndk/sources/cxx-stl/llvm-libc++/libcxx/include",
+ ]
+ ldflags = [
+ "--sysroot=$ndk/platforms/$ndk_platform",
+ "--target=$ndk_target",
+ "-B$ndk/toolchains/$ndk_target-4.9/prebuilt/$ndk_host/$ndk_target/bin",
+ "-pie",
+ ]
+ lib_dirs = [
+ "$ndk/sources/cxx-stl/llvm-libc++/libs/$ndk_stdlib",
+ "$ndk/toolchains/$ndk_target-4.9/prebuilt/$ndk_host/lib/gcc/$ndk_target/4.9.x",
+ ]
+ libs = [
+ # Order matters here! Keep these three in exactly this order.
+ "c++_static",
+ "c++abi",
+ "android_support",
+ ]
+ }
+
+ if (is_linux) {
+ libs = [ "pthread" ]
+ }
}
config("release") {
« no previous file with comments | « BUILD.gn ('k') | gn/BUILDCONFIG.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698