// 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 package { default_applicable_licenses: ["external_v8_license"], } // Added automatically by a large-scale-change that took the approach of // 'apply every license found to every target'. While this makes sure we respect // every license restriction, it may not be entirely correct. // // e.g. GPL in an MIT project might only apply to the contrib/ directory. // // Please consider splitting the single license below into multiple licenses, // taking care not to lose any license_kind information, and overriding the // default license using the 'licenses: [...]' property on targets as needed. // // For unused files, consider creating a 'filegroup' with "//visibility:private" // to attach the license to, and including a comment whether the files may be // used in the current project. // // large-scale-change included anything that looked like it might be a license // text as a license_text. e.g. LICENSE, NOTICE, COPYING etc. // // Please consider removing redundant or irrelevant files from 'license_text:'. // http://go/android-license-faq license { name: "external_v8_license", visibility: [":__subpackages__"], license_kinds: [ "SPDX-license-identifier-Apache-2.0", "SPDX-license-identifier-BSD", "SPDX-license-identifier-CC-BY", "SPDX-license-identifier-CPL-1.0", "SPDX-license-identifier-GPL", "SPDX-license-identifier-GPL-2.0", "SPDX-license-identifier-MIT", "SPDX-license-identifier-PSF-2.0", "legacy_unencumbered", ], license_text: [ "LICENSE", "LICENSE.fdlibm", "LICENSE.strongtalk", "LICENSE.v8", "LICENSE.valgrind", "NOTICE", ], } build = [ "Android.base.bp", "Android.platform.bp", "Android.sampler.bp", "Android.v8.bp", "Android.v8gen.bp", ] cc_defaults { name: "v8_defaults", cflags: [ "-Wall", "-Werror", "-Wno-endif-labels", "-Wno-implicit-fallthrough", "-Wno-import", "-Wno-format", "-Wno-unused-variable", "-Wno-unused-parameter", "-Wno-unused-private-field", "-Wno-sign-compare", "-Wno-missing-field-initializers", "-Wno-ignored-qualifiers", "-Wno-undefined-var-template", "-Wno-null-pointer-arithmetic", "-Wno-non-virtual-dtor", "-Wno-user-defined-warnings", "-Wno-unused-lambda-capture", "-fno-exceptions", "-fvisibility=hidden", "-DENABLE_DEBUGGER_SUPPORT", "-DENABLE_LOGGING_AND_PROFILING", "-DENABLE_VMSTATE_TRACKING", "-DV8_NATIVE_REGEXP", "-DV8_INTL_SUPPORT", "-DV8_CONCURRENT_MARKING", "-std=gnu++0x", "-Os", ], arch: { arm: { cflags: ["-DV8_TARGET_ARCH_ARM"], }, arm64: { cflags: ["-DV8_TARGET_ARCH_ARM64"], }, x86: { cflags: ["-DV8_TARGET_ARCH_IA32"], }, x86_64: { cflags: ["-DV8_TARGET_ARCH_X64"], }, }, } cc_library_static { name: "libv8gen", defaults: ["v8_defaults"], srcs: ["src/snapshot/snapshot-empty.cc"], generated_sources: [ "v8gen_libraries", "v8gen_extra_libraries", "v8gen_experimental_extra_libraries", ], cflags: ["-DANDROID_LINK_SHARED_ICU4C"], header_libs: [ "libicuuc_headers", "libicui18n_headers", ], generated_headers: ["v8_torque_file"], apex_available: [ "com.android.i18n", ], } cc_binary_host { name: "v8_torque", defaults: ["v8_defaults"], srcs: [ "src/torque/declarable.cc", "src/torque/declaration-visitor.cc", "src/torque/declarations.cc", "src/torque/earley-parser.cc", "src/torque/file-visitor.cc", "src/torque/implementation-visitor.cc", "src/torque/scope.cc", "src/torque/source-positions.cc", "src/torque/torque-parser.cc", "src/torque/type-oracle.cc", "src/torque/types.cc", "src/torque/utils.cc", "src/torque/torque.cc", ], static_libs: [ "libv8base", ], } genrule { name: "v8_torque_file", tools: ["v8_torque"], srcs: [ "src/builtins/base.tq", "src/builtins/array.tq", "src/builtins/array-copywithin.tq", "src/builtins/array-foreach.tq", "src/builtins/array-reverse.tq", "src/builtins/typed-array.tq", "src/builtins/data-view.tq", "third_party/v8/builtins/array-sort.tq", ], cmd: "mkdir -p $(genDir)/torque-generated/ && $(location v8_torque) -o $(genDir)/torque-generated/ $(in) && $(location v8_torque) -o $(genDir)/ $(in)", out: [ "torque-generated/builtin-definitions-from-dsl.h", "torque-generated/builtins-base-from-dsl-gen.h", "torque-generated/builtins-array-from-dsl-gen.h", "torque-generated/builtins-typed-array-from-dsl-gen.h", "torque-generated/builtins-data-view-from-dsl-gen.h", "builtin-definitions-from-dsl.h", "builtins-base-from-dsl-gen.h", "builtins-array-from-dsl-gen.h", "builtins-typed-array-from-dsl-gen.h", "builtins-data-view-from-dsl-gen.h", ], } genrule { name: "v8_torque_file_cc", tools: ["v8_torque"], srcs: [ "src/builtins/base.tq", "src/builtins/array.tq", "src/builtins/array-copywithin.tq", "src/builtins/array-foreach.tq", "src/builtins/array-reverse.tq", "src/builtins/typed-array.tq", "src/builtins/data-view.tq", //"test/torque/test-torque.tq", "third_party/v8/builtins/array-sort.tq", ], cmd: "mkdir -p $(genDir)/torque-generated/ && $(location v8_torque) -o $(genDir)/ $(in)", out: [ "builtins-base-from-dsl-gen.cc", "builtins-array-from-dsl-gen.cc", "builtins-typed-array-from-dsl-gen.cc", "builtins-data-view-from-dsl-gen.cc", ], } 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_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", ], apex_available: [ "com.android.i18n", ], export_include_dirs: ["include"], } // The bare 'd8' name conflicts with d8 from prebuilts/r8 // NOT WORKING YET /* cc_binary { name: "v8_d8", defaults: ["v8_defaults"], srcs: [ "src/d8.cc", "src/d8-posix.cc", "src/async-hooks-wrapper.cc", "src/d8-console.cc", //"src/inspector/v8-inspector-impl.cc", ], generated_sources: ["v8_d8_gen"], generated_headers: ["v8_torque_file"], static_libs: ["libv8"], shared_libs: [ "liblog", "libicuuc", "libicui18n", ], cflags: ["-O0", "-DANDROID_LINK_SHARED_ICU4C"], local_include_dirs: ["include"], } 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"], } */