blob: de7a223b10e55dcf572481466ab42aa4be829713 [file] [log] [blame]
// Copyright 2018, The Android Open Source Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Include generated Android.bp files
build = [
"Android.base.bp",
"Android.platform.bp",
"Android.sampler.bp",
"Android.v8.bp",
"Android.v8gen.bp",
"Android.mkpeephole.bp",
]
cc_defaults {
name: "v8_defaults",
cflags: [
"-Wall",
"-Werror",
"-Wno-endif-labels",
"-Wno-implicit-fallthrough",
"-Wno-import",
"-Wno-format",
"-Wno-unused-parameter",
"-Wno-unused-private-field",
"-Wno-sign-compare",
"-Wno-missing-field-initializers",
"-Wno-ignored-qualifiers",
"-Wno-undefined-var-template",
"-fno-exceptions",
"-fvisibility=hidden",
"-DENABLE_DEBUGGER_SUPPORT",
"-DENABLE_LOGGING_AND_PROFILING",
"-DENABLE_VMSTATE_TRACKING",
"-DV8_NATIVE_REGEXP",
"-DV8_I18N_SUPPORT",
"-std=gnu++0x",
"-Os",
],
arch: {
arm: {
cflags: ["-DV8_TARGET_ARCH_ARM"],
},
arm64: {
cflags: ["-DV8_TARGET_ARCH_ARM64"],
},
mips: {
cflags: [
"-DV8_TARGET_ARCH_MIPS",
"-Umips",
"-finline-limit=64",
"-fno-strict-aliasing",
],
},
mips64: {
cflags: [
"-DV8_TARGET_ARCH_MIPS64",
"-Umips",
"-finline-limit=64",
"-fno-strict-aliasing",
],
},
x86: {
cflags: ["-DV8_TARGET_ARCH_IA32"],
},
x86_64: {
cflags: ["-DV8_TARGET_ARCH_X64"],
},
},
}
genrule {
name: "v8_peephole_file",
tools: ["v8mkpeephole"],
cmd: "$(location v8mkpeephole) $(out)",
out: ["bytecode-peephole-table.cc"],
}
cc_library_static {
name: "v8peephole",
defaults: ["v8_defaults"],
generated_sources: ["v8_peephole_file"],
}
cc_library_static {
name: "libv8gen",
defaults: ["v8_defaults"],
srcs: ["src/snapshot/snapshot-empty.cc"],
generated_sources: [
"v8gen_libraries",
"v8gen_experimental_libraries",
"v8gen_extra_libraries",
"v8gen_experimental_extra_libraries",
],
}
python_binary_host {
name: "v8_js2c",
main: "tools/js2c.py",
srcs: [
"tools/js2c.py",
"tools/jsmin.py",
],
version: {
py2: {
enabled: true,
embedded_launcher: true,
},
py3: {
enabled: false,
},
},
}
genrule {
name: "v8gen_libraries",
tools: ["v8_js2c"],
cmd: "$(location v8_js2c) $(out) CORE $(in)",
srcs: [":v8_js_lib_files"],
out: ["libraries.cc"],
}
genrule {
name: "v8gen_experimental_libraries",
tools: ["v8_js2c"],
cmd: "$(location v8_js2c) $(out) EXPERIMENTAL $(in)",
srcs: [":v8_js_experimental_lib_files"],
out: ["experimental-libraries.cc"],
}
genrule {
name: "v8gen_extra_libraries",
tools: ["v8_js2c"],
cmd: "$(location v8_js2c) $(out) EXTRAS",
out: ["extra-libraries.cc"],
}
genrule {
name: "v8gen_experimental_extra_libraries",
tools: ["v8_js2c"],
cmd: "$(location v8_js2c) $(out) EXPERIMENTAL_EXTRAS",
out: ["experimental-extra-libraries.cc"],
}
cc_library_static {
name: "libv8",
defaults: ["v8_defaults"],
whole_static_libs: [
"libv8base",
"libv8platform",
"libv8sampler",
"libv8src",
"libv8gen",
"v8peephole",
],
export_include_dirs: ["include"],
}
// The bare 'd8' name conflicts with d8 from prebuilts/r8
cc_binary {
name: "v8_d8",
defaults: ["v8_defaults"],
srcs: [
"src/d8.cc",
"src/d8-posix.cc",
],
generated_sources: ["v8_d8_gen"],
static_libs: ["libv8"],
shared_libs: [
"liblog",
"libicuuc",
"libicui18n",
],
cflags: ["-O0"],
local_include_dirs: ["include"],
arch: {
mips: {
// Bug: http://b/31101212 WAR LLVM bug until next Clang update
cflags: ["-O2"],
},
},
}
genrule {
name: "v8_d8_gen",
tools: ["v8_js2c"],
cmd: "$(location v8_js2c) $(out) D8 $(in)",
srcs: [
"src/d8.js",
"src/js/macros.py",
],
out: ["d8-js.cc"],
}