1// Copyright 2018, The Android Open Source Project 2// 3// Licensed under the Apache License, Version 2.0 (the "License"); 4// you may not use this file except in compliance with the License. 5// You may obtain a copy of the License at 6// 7// http://www.apache.org/licenses/LICENSE-2.0 8// 9// Unless required by applicable law or agreed to in writing, software 10// distributed under the License is distributed on an "AS IS" BASIS, 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12// See the License for the specific language governing permissions and 13// limitations under the License. 14 15// Include generated Android.bp files 16build = [ 17 "Android.base.bp", 18 "Android.platform.bp", 19 "Android.sampler.bp", 20 "Android.v8.bp", 21 "Android.v8gen.bp", 22] 23 24cc_defaults { 25 name: "v8_defaults", 26 27 cflags: [ 28 "-Wall", 29 "-Werror", 30 "-Wno-endif-labels", 31 "-Wno-implicit-fallthrough", 32 "-Wno-import", 33 "-Wno-format", 34 "-Wno-unused-variable", 35 "-Wno-unused-parameter", 36 "-Wno-unused-private-field", 37 "-Wno-sign-compare", 38 "-Wno-missing-field-initializers", 39 "-Wno-ignored-qualifiers", 40 "-Wno-undefined-var-template", 41 "-Wno-null-pointer-arithmetic", 42 "-Wno-non-virtual-dtor", 43 "-Wno-user-defined-warnings", 44 "-Wno-unused-lambda-capture", 45 "-fno-exceptions", 46 "-fvisibility=hidden", 47 "-DENABLE_DEBUGGER_SUPPORT", 48 "-DENABLE_LOGGING_AND_PROFILING", 49 "-DENABLE_VMSTATE_TRACKING", 50 "-DV8_NATIVE_REGEXP", 51 "-DV8_INTL_SUPPORT", 52 "-DV8_CONCURRENT_MARKING", 53 "-std=gnu++0x", 54 "-Os", 55 ], 56 57 arch: { 58 arm: { 59 cflags: ["-DV8_TARGET_ARCH_ARM"], 60 }, 61 arm64: { 62 cflags: ["-DV8_TARGET_ARCH_ARM64"], 63 }, 64 mips: { 65 cflags: [ 66 "-DV8_TARGET_ARCH_MIPS", 67 "-Umips", 68 "-finline-limit=64", 69 "-fno-strict-aliasing", 70 ], 71 }, 72 mips64: { 73 cflags: [ 74 "-DV8_TARGET_ARCH_MIPS64", 75 "-Umips", 76 "-finline-limit=64", 77 "-fno-strict-aliasing", 78 ], 79 }, 80 x86: { 81 cflags: ["-DV8_TARGET_ARCH_IA32"], 82 }, 83 x86_64: { 84 cflags: ["-DV8_TARGET_ARCH_X64"], 85 }, 86 }, 87} 88 89cc_library_static { 90 name: "libv8gen", 91 defaults: ["v8_defaults"], 92 srcs: ["src/snapshot/snapshot-empty.cc"], 93 generated_sources: [ 94 "v8gen_libraries", 95 "v8gen_extra_libraries", 96 "v8gen_experimental_extra_libraries", 97 ], 98 cflags: ["-DANDROID_LINK_SHARED_ICU4C"], 99 header_libs: [ 100 "libicuuc_headers", 101 "libicui18n_headers", 102 ], 103 generated_headers: ["v8_torque_file"], 104} 105 106cc_binary_host { 107 name: "v8_torque", 108 defaults: ["v8_defaults"], 109 srcs: [ 110 "src/torque/declarable.cc", 111 "src/torque/declaration-visitor.cc", 112 "src/torque/declarations.cc", 113 "src/torque/earley-parser.cc", 114 "src/torque/file-visitor.cc", 115 "src/torque/implementation-visitor.cc", 116 "src/torque/scope.cc", 117 "src/torque/source-positions.cc", 118 "src/torque/torque-parser.cc", 119 "src/torque/type-oracle.cc", 120 "src/torque/types.cc", 121 "src/torque/utils.cc", 122 123 "src/torque/torque.cc", 124 ], 125 static_libs: [ 126 "libv8base", 127 ], 128} 129 130genrule { 131 name: "v8_torque_file", 132 tools: ["v8_torque"], 133 srcs: [ 134 "src/builtins/base.tq", 135 "src/builtins/array.tq", 136 "src/builtins/array-copywithin.tq", 137 "src/builtins/array-foreach.tq", 138 "src/builtins/array-reverse.tq", 139 "src/builtins/typed-array.tq", 140 "src/builtins/data-view.tq", 141 "third_party/v8/builtins/array-sort.tq", 142 ], 143 cmd: "mkdir -p $(genDir)/torque-generated/ && $(location v8_torque) -o $(genDir)/torque-generated/ $(in) && $(location v8_torque) -o $(genDir)/ $(in)", 144 out: [ 145 "torque-generated/builtin-definitions-from-dsl.h", 146 "torque-generated/builtins-base-from-dsl-gen.h", 147 "torque-generated/builtins-array-from-dsl-gen.h", 148 "torque-generated/builtins-typed-array-from-dsl-gen.h", 149 "torque-generated/builtins-data-view-from-dsl-gen.h", 150 "builtin-definitions-from-dsl.h", 151 "builtins-base-from-dsl-gen.h", 152 "builtins-array-from-dsl-gen.h", 153 "builtins-typed-array-from-dsl-gen.h", 154 "builtins-data-view-from-dsl-gen.h", 155 ], 156} 157 158genrule { 159 name: "v8_torque_file_cc", 160 tools: ["v8_torque"], 161 srcs: [ 162 "src/builtins/base.tq", 163 "src/builtins/array.tq", 164 "src/builtins/array-copywithin.tq", 165 "src/builtins/array-foreach.tq", 166 "src/builtins/array-reverse.tq", 167 "src/builtins/typed-array.tq", 168 "src/builtins/data-view.tq", 169 //"test/torque/test-torque.tq", 170 "third_party/v8/builtins/array-sort.tq", 171 ], 172 cmd: "mkdir -p $(genDir)/torque-generated/ && $(location v8_torque) -o $(genDir)/ $(in)", 173 out: [ 174 "builtins-base-from-dsl-gen.cc", 175 "builtins-array-from-dsl-gen.cc", 176 "builtins-typed-array-from-dsl-gen.cc", 177 "builtins-data-view-from-dsl-gen.cc", 178 ], 179} 180 181 182python_binary_host { 183 name: "v8_js2c", 184 main: "tools/js2c.py", 185 srcs: [ 186 "tools/js2c.py", 187 "tools/jsmin.py", 188 ], 189 version: { 190 py2: { 191 enabled: true, 192 embedded_launcher: true, 193 }, 194 py3: { 195 enabled: false, 196 }, 197 }, 198} 199 200genrule { 201 name: "v8gen_libraries", 202 tools: ["v8_js2c"], 203 cmd: "$(location v8_js2c) $(out) CORE $(in)", 204 srcs: [":v8_js_lib_files"], 205 out: ["libraries.cc"], 206} 207 208genrule { 209 name: "v8gen_extra_libraries", 210 tools: ["v8_js2c"], 211 cmd: "$(location v8_js2c) $(out) EXTRAS", 212 out: ["extra-libraries.cc"], 213} 214 215genrule { 216 name: "v8gen_experimental_extra_libraries", 217 tools: ["v8_js2c"], 218 cmd: "$(location v8_js2c) $(out) EXPERIMENTAL_EXTRAS", 219 out: ["experimental-extra-libraries.cc"], 220} 221 222cc_library_static { 223 name: "libv8", 224 defaults: ["v8_defaults"], 225 whole_static_libs: [ 226 "libv8base", 227 "libv8platform", 228 "libv8sampler", 229 "libv8src", 230 "libv8gen", 231 ], 232 export_include_dirs: ["include"], 233} 234 235// The bare 'd8' name conflicts with d8 from prebuilts/r8 236// NOT WORKING YET 237/* 238cc_binary { 239 name: "v8_d8", 240 defaults: ["v8_defaults"], 241 242 srcs: [ 243 "src/d8.cc", 244 "src/d8-posix.cc", 245 "src/async-hooks-wrapper.cc", 246 "src/d8-console.cc", 247 //"src/inspector/v8-inspector-impl.cc", 248 ], 249 generated_sources: ["v8_d8_gen"], 250 generated_headers: ["v8_torque_file"], 251 252 static_libs: ["libv8"], 253 shared_libs: [ 254 "liblog", 255 "libicuuc", 256 "libicui18n", 257 ], 258 cflags: ["-O0", "-DANDROID_LINK_SHARED_ICU4C"], 259 local_include_dirs: ["include"], 260 261 arch: { 262 mips: { 263 // Bug: http://b/31101212 WAR LLVM bug until next Clang update 264 cflags: ["-O2"], 265 }, 266 }, 267} 268 269genrule { 270 name: "v8_d8_gen", 271 tools: ["v8_js2c"], 272 cmd: "$(location v8_js2c) $(out) D8 $(in)", 273 srcs: [ 274 "src/d8.js", 275 "src/js/macros.py", 276 ], 277 out: ["d8-js.cc"], 278} 279*/