| OLD | NEW |
| 1 # Copyright 2016 Google Inc. | 1 # Copyright 2016 Google Inc. |
| 2 # | 2 # |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 declare_args() { | 6 declare_args() { |
| 7 cc = "cc" | 7 cc = "cc" |
| 8 cxx = "c++" | 8 cxx = "c++" |
| 9 | 9 |
| 10 if (is_android) { |
| 11 cc = "$ndk/toolchains/llvm/prebuilt/$ndk_host/bin/clang" |
| 12 cxx = "$ndk/toolchains/llvm/prebuilt/$ndk_host/bin/clang++" |
| 13 } |
| 14 |
| 10 extra_cflags = "" | 15 extra_cflags = "" |
| 11 extra_cflags_c = "" | 16 extra_cflags_c = "" |
| 12 extra_cflags_cc = "" | 17 extra_cflags_cc = "" |
| 13 } | 18 } |
| 14 | 19 |
| 15 config("no_rtti") { | 20 config("no_rtti") { |
| 16 cflags_cc = [ "-fno-rtti" ] | 21 cflags_cc = [ "-fno-rtti" ] |
| 17 } | 22 } |
| 18 | 23 |
| 19 config("default") { | 24 config("default") { |
| (...skipping 15 matching lines...) Expand all Loading... |
| 35 "-Wno-unused-parameter", | 40 "-Wno-unused-parameter", |
| 36 ] | 41 ] |
| 37 cflags_cc = [ | 42 cflags_cc = [ |
| 38 "-std=c++11", | 43 "-std=c++11", |
| 39 "-fno-exceptions", | 44 "-fno-exceptions", |
| 40 "-fno-threadsafe-statics", | 45 "-fno-threadsafe-statics", |
| 41 "-fvisibility-inlines-hidden", | 46 "-fvisibility-inlines-hidden", |
| 42 | 47 |
| 43 "-Wnon-virtual-dtor", | 48 "-Wnon-virtual-dtor", |
| 44 ] | 49 ] |
| 50 if (current_cpu == "arm") { |
| 51 cflags += [ "-mfpu=neon" ] |
| 52 } |
| 53 |
| 54 if (is_android) { |
| 55 asmflags = [ "--target=$ndk_target" ] |
| 56 cflags += [ |
| 57 "--sysroot=$ndk/platforms/$ndk_platform", |
| 58 "--target=$ndk_target", |
| 59 ] |
| 60 cflags_cc += [ |
| 61 "-isystem$ndk/sources/android/support/include", |
| 62 "-isystem$ndk/sources/cxx-stl/llvm-libc++/libcxx/include", |
| 63 ] |
| 64 ldflags = [ |
| 65 "--sysroot=$ndk/platforms/$ndk_platform", |
| 66 "--target=$ndk_target", |
| 67 "-B$ndk/toolchains/$ndk_target-4.9/prebuilt/$ndk_host/$ndk_target/bin", |
| 68 "-pie", |
| 69 ] |
| 70 lib_dirs = [ |
| 71 "$ndk/sources/cxx-stl/llvm-libc++/libs/$ndk_stdlib", |
| 72 "$ndk/toolchains/$ndk_target-4.9/prebuilt/$ndk_host/lib/gcc/$ndk_target/4.
9.x", |
| 73 ] |
| 74 libs = [ |
| 75 # Order matters here! Keep these three in exactly this order. |
| 76 "c++_static", |
| 77 "c++abi", |
| 78 "android_support", |
| 79 ] |
| 80 } |
| 81 |
| 82 if (is_linux) { |
| 83 libs = [ "pthread" ] |
| 84 } |
| 45 } | 85 } |
| 46 | 86 |
| 47 config("release") { | 87 config("release") { |
| 48 cflags = [ "-Os" ] | 88 cflags = [ "-Os" ] |
| 49 defines = [ "NDEBUG" ] | 89 defines = [ "NDEBUG" ] |
| 50 } | 90 } |
| 51 | 91 |
| 52 config("executable") { | 92 config("executable") { |
| 53 if (is_mac) { | 93 if (is_mac) { |
| 54 ldflags = [ "-Wl,-rpath,@loader_path/." ] | 94 ldflags = [ "-Wl,-rpath,@loader_path/." ] |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 } | 173 } |
| 134 | 174 |
| 135 tool("stamp") { | 175 tool("stamp") { |
| 136 command = "touch {{output}}" | 176 command = "touch {{output}}" |
| 137 } | 177 } |
| 138 | 178 |
| 139 tool("copy") { | 179 tool("copy") { |
| 140 command = "ln -f {{source}} {{output}} 2>/dev/null || (rm -rf {{output}} &&
cp -af {{source}} {{output}})" | 180 command = "ln -f {{source}} {{output}} 2>/dev/null || (rm -rf {{output}} &&
cp -af {{source}} {{output}})" |
| 141 } | 181 } |
| 142 } | 182 } |
| OLD | NEW |