v8/BUILD.gn

875 lines
23 KiB
Plaintext
Raw Normal View History

# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# TODO(jochen): These will need to be user-settable to support standalone V8
# builds.
v8_compress_startup_data = "off"
v8_deprecation_warnings = false
v8_enable_disassembler = false
v8_enable_gdbjit = false
v8_enable_handle_zapping = true
v8_enable_i18n_support = true
v8_enable_verify_heap = false
v8_interpreted_regexp = false
v8_object_print = false
v8_postmortem_support = false
v8_use_default_platform = true
v8_use_snapshot = true
if (is_debug) {
v8_enable_extra_checks = true
} else {
v8_enable_extra_checks = false
}
# TODO(jochen): Add support for want_seperate_host_toolset.
# TODO(jochen): Add toolchain.gypi support.
###############################################################################
# Configurations
#
config("internal_config") {
visibility = ":*" # Only targets in this file can depend on this.
include_dirs = [ "src" ]
if (component_mode == "shared_library") {
defines = [
"BUILDING_V8_SHARED",
"V8_SHARED",
]
}
}
config("features") {
visibility = ":*" # Only targets in this file can depend on this.
defines = []
if (v8_enable_disassembler == true) {
defines += [
"ENABLE_DISASSEMBLER",
]
}
if (v8_enable_gdbjit == true) {
defines += [
"ENABLE_GDB_JIT_INTERFACE",
]
}
if (v8_object_print == true) {
defines += [
"OBJECT_PRINT",
]
}
if (v8_enable_verify_heap == true) {
defines += [
"VERIFY_HEAP",
]
}
if (v8_interpreted_regexp == true) {
defines += [
"V8_INTERPRETED_REGEXP",
]
}
if (v8_deprecation_warnings == true) {
defines += [
"V8_DEPRECATION_WARNINGS",
]
}
if (v8_enable_i18n_support == true) {
defines += [
"V8_I18N_SUPPORT",
]
}
if (v8_use_default_platform == true) {
defines += [
"V8_USE_DEFAULT_PLATFORM",
]
}
if (v8_compress_startup_data == "bz2") {
defines += [
"COMPRESS_STARTUP_DATA_BZ2",
]
}
if (v8_enable_extra_checks == true) {
defines += [
"ENABLE_EXTRA_CHECKS",
]
}
if (v8_enable_handle_zapping == true) {
defines += [
"ENABLE_HANDLE_ZAPPING",
]
}
}
###############################################################################
# Actions
#
# TODO(jochen): Do actions need visibility settings as well?
action("generate_trig_table") {
visibility = ":*" # Only targets in this file can depend on this.
script = "tools/generate-trig-table.py"
outputs = [
"$target_gen_dir/trig-table.cc"
]
args = rebase_path(outputs, root_build_dir)
}
action("js2c") {
visibility = ":*" # Only targets in this file can depend on this.
script = "tools/js2c.py"
# The script depends on this other script, this rule causes a rebuild if it
# changes.
source_prereqs = [ "tools/jsmin.py" ]
sources = [
"src/runtime.js",
"src/v8natives.js",
"src/array.js",
"src/string.js",
"src/uri.js",
"src/math.js",
"src/messages.js",
"src/apinatives.js",
"src/debug-debugger.js",
"src/mirror-debugger.js",
"src/liveedit-debugger.js",
"src/date.js",
"src/json.js",
"src/regexp.js",
"src/arraybuffer.js",
"src/typedarray.js",
"src/object-observe.js",
"src/macros.py",
]
outputs = [
"$target_gen_dir/libraries.cc"
]
if (v8_enable_i18n_support) {
sources += [ "src/i18n.js" ]
}
args =
rebase_path(outputs, root_build_dir) +
[ "EXPERIMENTAL", v8_compress_startup_data ] +
rebase_path(sources, root_build_dir)
}
action("js2c_experimental") {
visibility = ":*" # Only targets in this file can depend on this.
script = "tools/js2c.py"
# The script depends on this other script, this rule causes a rebuild if it
# changes.
source_prereqs = [ "tools/jsmin.py" ]
sources = [
"src/macros.py",
"src/symbol.js",
"src/proxy.js",
"src/collection.js",
"src/weak_collection.js",
"src/promise.js",
"src/generator.js",
"src/array-iterator.js",
"src/harmony-string.js",
"src/harmony-array.js",
"src/harmony-math.js",
]
outputs = [
"$target_gen_dir/experimental-libraries.cc"
]
args =
rebase_path(outputs, root_build_dir) +
[ "CORE", v8_compress_startup_data ] +
rebase_path(sources, root_build_dir)
}
action("postmortem-metadata") {
visibility = ":*" # Only targets in this file can depend on this.
script = "tools/gen-postmortem-metadata.py"
sources = [
"src/objects.h",
"src/objects-inl.h",
]
outputs = [
"$target_gen_dir/debug-support.cc"
]
args =
rebase_path(outputs, root_build_dir) +
rebase_path(sources, root_build_dir)
}
###############################################################################
# Source Sets (aka static libraries)
#
source_set("v8_nosnapshot") {
visibility = ":*" # Only targets in this file can depend on this.
deps = [
":js2c",
":js2c_experimental",
":generate_trig_table",
":v8_base",
]
sources = [
"$target_gen_dir/libraries.cc",
"$target_gen_dir/experimental-libraries.cc",
"$target_gen_dir/trig-table.cc",
"src/snapshot-empty.cc",
]
configs -= [ "//build/config/compiler:chromium_code" ]
configs += [ "//build/config/compiler:no_chromium_code" ]
configs += [ ":internal_config", ":features" ]
}
source_set("v8_base") {
visibility = ":*" # Only targets in this file can depend on this.
sources = [
"src/accessors.cc",
"src/accessors.h",
"src/allocation.cc",
"src/allocation.h",
"src/allocation-site-scopes.cc",
"src/allocation-site-scopes.h",
"src/allocation-tracker.cc",
"src/allocation-tracker.h",
"src/api.cc",
"src/api.h",
"src/arguments.cc",
"src/arguments.h",
"src/assembler.cc",
"src/assembler.h",
"src/assert-scope.h",
"src/assert-scope.cc",
"src/ast.cc",
"src/ast.h",
"src/atomicops.h",
"src/atomicops_internals_x86_gcc.cc",
"src/bignum-dtoa.cc",
"src/bignum-dtoa.h",
"src/bignum.cc",
"src/bignum.h",
"src/bootstrapper.cc",
"src/bootstrapper.h",
"src/builtins.cc",
"src/builtins.h",
"src/bytecodes-irregexp.h",
"src/cached-powers.cc",
"src/cached-powers.h",
"src/char-predicates-inl.h",
"src/char-predicates.h",
"src/checks.cc",
"src/checks.h",
"src/circular-queue-inl.h",
"src/circular-queue.h",
"src/code-stubs.cc",
"src/code-stubs.h",
"src/code-stubs-hydrogen.cc",
"src/code.h",
"src/codegen.cc",
"src/codegen.h",
"src/compilation-cache.cc",
"src/compilation-cache.h",
"src/compiler.cc",
"src/compiler.h",
"src/contexts.cc",
"src/contexts.h",
"src/conversions-inl.h",
"src/conversions.cc",
"src/conversions.h",
"src/counters.cc",
"src/counters.h",
"src/cpu-profiler-inl.h",
"src/cpu-profiler.cc",
"src/cpu-profiler.h",
"src/cpu.cc",
"src/cpu.h",
"src/data-flow.cc",
"src/data-flow.h",
"src/date.cc",
"src/date.h",
"src/dateparser-inl.h",
"src/dateparser.cc",
"src/dateparser.h",
"src/debug.cc",
"src/debug.h",
"src/deoptimizer.cc",
"src/deoptimizer.h",
"src/disasm.h",
"src/disassembler.cc",
"src/disassembler.h",
"src/diy-fp.cc",
"src/diy-fp.h",
"src/double.h",
"src/dtoa.cc",
"src/dtoa.h",
"src/effects.h",
"src/elements-kind.cc",
"src/elements-kind.h",
"src/elements.cc",
"src/elements.h",
"src/execution.cc",
"src/execution.h",
"src/extensions/externalize-string-extension.cc",
"src/extensions/externalize-string-extension.h",
"src/extensions/free-buffer-extension.cc",
"src/extensions/free-buffer-extension.h",
"src/extensions/gc-extension.cc",
"src/extensions/gc-extension.h",
"src/extensions/statistics-extension.cc",
"src/extensions/statistics-extension.h",
"src/extensions/trigger-failure-extension.cc",
"src/extensions/trigger-failure-extension.h",
"src/factory.cc",
"src/factory.h",
"src/fast-dtoa.cc",
"src/fast-dtoa.h",
"src/feedback-slots.h",
"src/fixed-dtoa.cc",
"src/fixed-dtoa.h",
"src/flag-definitions.h",
"src/flags.cc",
"src/flags.h",
"src/frames-inl.h",
"src/frames.cc",
"src/frames.h",
"src/full-codegen.cc",
"src/full-codegen.h",
"src/func-name-inferrer.cc",
"src/func-name-inferrer.h",
"src/gdb-jit.cc",
"src/gdb-jit.h",
"src/global-handles.cc",
"src/global-handles.h",
"src/globals.h",
"src/handles-inl.h",
"src/handles.cc",
"src/handles.h",
"src/hashmap.h",
"src/heap-inl.h",
"src/heap-profiler.cc",
"src/heap-profiler.h",
"src/heap-snapshot-generator-inl.h",
"src/heap-snapshot-generator.cc",
"src/heap-snapshot-generator.h",
"src/heap.cc",
"src/heap.h",
"src/hydrogen-alias-analysis.h",
"src/hydrogen-bce.cc",
"src/hydrogen-bce.h",
"src/hydrogen-bch.cc",
"src/hydrogen-bch.h",
"src/hydrogen-canonicalize.cc",
"src/hydrogen-canonicalize.h",
"src/hydrogen-check-elimination.cc",
"src/hydrogen-check-elimination.h",
"src/hydrogen-dce.cc",
"src/hydrogen-dce.h",
"src/hydrogen-dehoist.cc",
"src/hydrogen-dehoist.h",
"src/hydrogen-environment-liveness.cc",
"src/hydrogen-environment-liveness.h",
"src/hydrogen-escape-analysis.cc",
"src/hydrogen-escape-analysis.h",
"src/hydrogen-flow-engine.h",
"src/hydrogen-instructions.cc",
"src/hydrogen-instructions.h",
"src/hydrogen.cc",
"src/hydrogen.h",
"src/hydrogen-gvn.cc",
"src/hydrogen-gvn.h",
"src/hydrogen-infer-representation.cc",
"src/hydrogen-infer-representation.h",
"src/hydrogen-infer-types.cc",
"src/hydrogen-infer-types.h",
"src/hydrogen-load-elimination.cc",
"src/hydrogen-load-elimination.h",
"src/hydrogen-mark-deoptimize.cc",
"src/hydrogen-mark-deoptimize.h",
"src/hydrogen-mark-unreachable.cc",
"src/hydrogen-mark-unreachable.h",
"src/hydrogen-osr.cc",
"src/hydrogen-osr.h",
"src/hydrogen-range-analysis.cc",
"src/hydrogen-range-analysis.h",
"src/hydrogen-redundant-phi.cc",
"src/hydrogen-redundant-phi.h",
"src/hydrogen-removable-simulates.cc",
"src/hydrogen-removable-simulates.h",
"src/hydrogen-representation-changes.cc",
"src/hydrogen-representation-changes.h",
"src/hydrogen-sce.cc",
"src/hydrogen-sce.h",
"src/hydrogen-store-elimination.cc",
"src/hydrogen-store-elimination.h",
"src/hydrogen-uint32-analysis.cc",
"src/hydrogen-uint32-analysis.h",
"src/i18n.cc",
"src/i18n.h",
"src/icu_util.cc",
"src/icu_util.h",
"src/ic-inl.h",
"src/ic.cc",
"src/ic.h",
"src/incremental-marking.cc",
"src/incremental-marking.h",
"src/interface.cc",
"src/interface.h",
"src/interpreter-irregexp.cc",
"src/interpreter-irregexp.h",
"src/isolate.cc",
"src/isolate.h",
"src/json-parser.h",
"src/json-stringifier.h",
"src/jsregexp-inl.h",
"src/jsregexp.cc",
"src/jsregexp.h",
"src/lazy-instance.h",
# TODO(jochen): move libplatform/ files to their own target.
"src/libplatform/default-platform.cc",
"src/libplatform/default-platform.h",
"src/libplatform/task-queue.cc",
"src/libplatform/task-queue.h",
"src/libplatform/worker-thread.cc",
"src/libplatform/worker-thread.h",
"src/list-inl.h",
"src/list.h",
"src/lithium-allocator-inl.h",
"src/lithium-allocator.cc",
"src/lithium-allocator.h",
"src/lithium-codegen.cc",
"src/lithium-codegen.h",
"src/lithium.cc",
"src/lithium.h",
"src/liveedit.cc",
"src/liveedit.h",
"src/log-inl.h",
"src/log-utils.cc",
"src/log-utils.h",
"src/log.cc",
"src/log.h",
"src/macro-assembler.h",
"src/mark-compact.cc",
"src/mark-compact.h",
"src/messages.cc",
"src/messages.h",
"src/msan.h",
"src/natives.h",
"src/objects-debug.cc",
"src/objects-inl.h",
"src/objects-printer.cc",
"src/objects-visiting.cc",
"src/objects-visiting.h",
"src/objects.cc",
"src/objects.h",
"src/once.cc",
"src/once.h",
"src/optimizing-compiler-thread.h",
"src/optimizing-compiler-thread.cc",
"src/parser.cc",
"src/parser.h",
"src/platform/elapsed-timer.h",
"src/platform/time.cc",
"src/platform/time.h",
"src/platform.h",
"src/platform/condition-variable.cc",
"src/platform/condition-variable.h",
"src/platform/mutex.cc",
"src/platform/mutex.h",
"src/platform/semaphore.cc",
"src/platform/semaphore.h",
"src/preparse-data-format.h",
"src/preparse-data.cc",
"src/preparse-data.h",
"src/preparser.cc",
"src/preparser.h",
"src/prettyprinter.cc",
"src/prettyprinter.h",
"src/profile-generator-inl.h",
"src/profile-generator.cc",
"src/profile-generator.h",
"src/property-details.h",
"src/property.cc",
"src/property.h",
"src/regexp-macro-assembler-irregexp-inl.h",
"src/regexp-macro-assembler-irregexp.cc",
"src/regexp-macro-assembler-irregexp.h",
"src/regexp-macro-assembler-tracer.cc",
"src/regexp-macro-assembler-tracer.h",
"src/regexp-macro-assembler.cc",
"src/regexp-macro-assembler.h",
"src/regexp-stack.cc",
"src/regexp-stack.h",
"src/rewriter.cc",
"src/rewriter.h",
"src/runtime-profiler.cc",
"src/runtime-profiler.h",
"src/runtime.cc",
"src/runtime.h",
"src/safepoint-table.cc",
"src/safepoint-table.h",
"src/sampler.cc",
"src/sampler.h",
"src/scanner-character-streams.cc",
"src/scanner-character-streams.h",
"src/scanner.cc",
"src/scanner.h",
"src/scopeinfo.cc",
"src/scopeinfo.h",
"src/scopes.cc",
"src/scopes.h",
"src/serialize.cc",
"src/serialize.h",
"src/small-pointer-list.h",
"src/smart-pointers.h",
"src/snapshot-common.cc",
"src/snapshot.h",
"src/spaces-inl.h",
"src/spaces.cc",
"src/spaces.h",
"src/store-buffer-inl.h",
"src/store-buffer.cc",
"src/store-buffer.h",
"src/string-search.cc",
"src/string-search.h",
"src/string-stream.cc",
"src/string-stream.h",
"src/strtod.cc",
"src/strtod.h",
"src/stub-cache.cc",
"src/stub-cache.h",
"src/sweeper-thread.h",
"src/sweeper-thread.cc",
"src/token.cc",
"src/token.h",
"src/transitions-inl.h",
"src/transitions.cc",
"src/transitions.h",
"src/type-info.cc",
"src/type-info.h",
"src/types-inl.h",
"src/types.cc",
"src/types.h",
"src/typing.cc",
"src/typing.h",
"src/unbound-queue-inl.h",
"src/unbound-queue.h",
"src/unicode-inl.h",
"src/unicode.cc",
"src/unicode.h",
"src/unique.h",
"src/uri.h",
"src/utils-inl.h",
"src/utils.cc",
"src/utils.h",
"src/utils/random-number-generator.cc",
"src/utils/random-number-generator.h",
"src/v8.cc",
"src/v8.h",
"src/v8checks.h",
"src/v8globals.h",
"src/v8memory.h",
"src/v8threads.cc",
"src/v8threads.h",
"src/variables.cc",
"src/variables.h",
"src/version.cc",
"src/version.h",
"src/vm-state-inl.h",
"src/vm-state.h",
"src/zone-inl.h",
"src/zone.cc",
"src/zone.h",
]
if (cpu_arch == "x86") {
sources += [
"src/ia32/assembler-ia32-inl.h",
"src/ia32/assembler-ia32.cc",
"src/ia32/assembler-ia32.h",
"src/ia32/builtins-ia32.cc",
"src/ia32/code-stubs-ia32.cc",
"src/ia32/code-stubs-ia32.h",
"src/ia32/codegen-ia32.cc",
"src/ia32/codegen-ia32.h",
"src/ia32/cpu-ia32.cc",
"src/ia32/debug-ia32.cc",
"src/ia32/deoptimizer-ia32.cc",
"src/ia32/disasm-ia32.cc",
"src/ia32/frames-ia32.cc",
"src/ia32/frames-ia32.h",
"src/ia32/full-codegen-ia32.cc",
"src/ia32/ic-ia32.cc",
"src/ia32/lithium-codegen-ia32.cc",
"src/ia32/lithium-codegen-ia32.h",
"src/ia32/lithium-gap-resolver-ia32.cc",
"src/ia32/lithium-gap-resolver-ia32.h",
"src/ia32/lithium-ia32.cc",
"src/ia32/lithium-ia32.h",
"src/ia32/macro-assembler-ia32.cc",
"src/ia32/macro-assembler-ia32.h",
"src/ia32/regexp-macro-assembler-ia32.cc",
"src/ia32/regexp-macro-assembler-ia32.h",
"src/ia32/stub-cache-ia32.cc",
]
} else if (cpu_arch == "x64") {
sources += [
"src/x64/assembler-x64-inl.h",
"src/x64/assembler-x64.cc",
"src/x64/assembler-x64.h",
"src/x64/builtins-x64.cc",
"src/x64/code-stubs-x64.cc",
"src/x64/code-stubs-x64.h",
"src/x64/codegen-x64.cc",
"src/x64/codegen-x64.h",
"src/x64/cpu-x64.cc",
"src/x64/debug-x64.cc",
"src/x64/deoptimizer-x64.cc",
"src/x64/disasm-x64.cc",
"src/x64/frames-x64.cc",
"src/x64/frames-x64.h",
"src/x64/full-codegen-x64.cc",
"src/x64/ic-x64.cc",
"src/x64/lithium-codegen-x64.cc",
"src/x64/lithium-codegen-x64.h",
"src/x64/lithium-gap-resolver-x64.cc",
"src/x64/lithium-gap-resolver-x64.h",
"src/x64/lithium-x64.cc",
"src/x64/lithium-x64.h",
"src/x64/macro-assembler-x64.cc",
"src/x64/macro-assembler-x64.h",
"src/x64/regexp-macro-assembler-x64.cc",
"src/x64/regexp-macro-assembler-x64.h",
"src/x64/stub-cache-x64.cc",
]
} else if (cpu_arch == "arm") {
sources += [
"src/arm/assembler-arm-inl.h",
"src/arm/assembler-arm.cc",
"src/arm/assembler-arm.h",
"src/arm/builtins-arm.cc",
"src/arm/code-stubs-arm.cc",
"src/arm/code-stubs-arm.h",
"src/arm/codegen-arm.cc",
"src/arm/codegen-arm.h",
"src/arm/constants-arm.h",
"src/arm/constants-arm.cc",
"src/arm/cpu-arm.cc",
"src/arm/debug-arm.cc",
"src/arm/deoptimizer-arm.cc",
"src/arm/disasm-arm.cc",
"src/arm/frames-arm.cc",
"src/arm/frames-arm.h",
"src/arm/full-codegen-arm.cc",
"src/arm/ic-arm.cc",
"src/arm/lithium-arm.cc",
"src/arm/lithium-arm.h",
"src/arm/lithium-codegen-arm.cc",
"src/arm/lithium-codegen-arm.h",
"src/arm/lithium-gap-resolver-arm.cc",
"src/arm/lithium-gap-resolver-arm.h",
"src/arm/macro-assembler-arm.cc",
"src/arm/macro-assembler-arm.h",
"src/arm/regexp-macro-assembler-arm.cc",
"src/arm/regexp-macro-assembler-arm.h",
"src/arm/simulator-arm.cc",
"src/arm/stub-cache-arm.cc",
]
} else if (cpu_arch == "arm64") {
sources += [
"src/arm64/assembler-arm64.cc",
"src/arm64/assembler-arm64.h",
"src/arm64/assembler-arm64-inl.h",
"src/arm64/builtins-arm64.cc",
"src/arm64/codegen-arm64.cc",
"src/arm64/codegen-arm64.h",
"src/arm64/code-stubs-arm64.cc",
"src/arm64/code-stubs-arm64.h",
"src/arm64/constants-arm64.h",
"src/arm64/cpu-arm64.cc",
"src/arm64/debug-arm64.cc",
"src/arm64/decoder-arm64.cc",
"src/arm64/decoder-arm64.h",
"src/arm64/decoder-arm64-inl.h",
"src/arm64/deoptimizer-arm64.cc",
"src/arm64/disasm-arm64.cc",
"src/arm64/disasm-arm64.h",
"src/arm64/frames-arm64.cc",
"src/arm64/frames-arm64.h",
"src/arm64/full-codegen-arm64.cc",
"src/arm64/ic-arm64.cc",
"src/arm64/instructions-arm64.cc",
"src/arm64/instructions-arm64.h",
"src/arm64/instrument-arm64.cc",
"src/arm64/instrument-arm64.h",
"src/arm64/lithium-arm64.cc",
"src/arm64/lithium-arm64.h",
"src/arm64/lithium-codegen-arm64.cc",
"src/arm64/lithium-codegen-arm64.h",
"src/arm64/lithium-gap-resolver-arm64.cc",
"src/arm64/lithium-gap-resolver-arm64.h",
"src/arm64/macro-assembler-arm64.cc",
"src/arm64/macro-assembler-arm64.h",
"src/arm64/macro-assembler-arm64-inl.h",
"src/arm64/regexp-macro-assembler-arm64.cc",
"src/arm64/regexp-macro-assembler-arm64.h",
"src/arm64/simulator-arm64.cc",
"src/arm64/simulator-arm64.h",
"src/arm64/stub-cache-arm64.cc",
"src/arm64/utils-arm64.cc",
"src/arm64/utils-arm64.h",
]
} else if (cpu_arch == "mipsel") {
sources += [
"src/mips/assembler-mips.cc",
"src/mips/assembler-mips.h",
"src/mips/assembler-mips-inl.h",
"src/mips/builtins-mips.cc",
"src/mips/codegen-mips.cc",
"src/mips/codegen-mips.h",
"src/mips/code-stubs-mips.cc",
"src/mips/code-stubs-mips.h",
"src/mips/constants-mips.cc",
"src/mips/constants-mips.h",
"src/mips/cpu-mips.cc",
"src/mips/debug-mips.cc",
"src/mips/deoptimizer-mips.cc",
"src/mips/disasm-mips.cc",
"src/mips/frames-mips.cc",
"src/mips/frames-mips.h",
"src/mips/full-codegen-mips.cc",
"src/mips/ic-mips.cc",
"src/mips/lithium-codegen-mips.cc",
"src/mips/lithium-codegen-mips.h",
"src/mips/lithium-gap-resolver-mips.cc",
"src/mips/lithium-gap-resolver-mips.h",
"src/mips/lithium-mips.cc",
"src/mips/lithium-mips.h",
"src/mips/macro-assembler-mips.cc",
"src/mips/macro-assembler-mips.h",
"src/mips/regexp-macro-assembler-mips.cc",
"src/mips/regexp-macro-assembler-mips.h",
"src/mips/simulator-mips.cc",
"src/mips/stub-cache-mips.cc",
]
}
configs -= [ "//build/config/compiler:chromium_code" ]
configs += [ "//build/config/compiler:no_chromium_code" ]
configs += [ ":internal_config", ":features" ]
defines = []
deps = []
if (is_posix) {
sources += [
"src/platform-posix.cc"
]
}
if (is_linux) {
sources += [
"src/platform-linux.cc"
]
# TODO(brettw)
# 'conditions': [
# ['v8_compress_startup_data=="bz2"', {
# 'libraries': [
# '-lbz2',
# ]
# }],
# ],
libs = [ "rt" ]
} else if (is_android) {
# TODO(brettw) OS=="android" condition from tools/gyp/v8.gyp
} else if (is_mac) {
sources += [ "src/platform-macos,cc" ]
} else if (is_win) {
sources += [
"src/platform-win32.cc",
"src/win32-math.cc",
"src/win32-math.h",
]
defines += [ "_CRT_RAND_S" ] # for rand_s()
libs = [ "winmm.lib", "ws2_32.lib" ]
}
if (v8_enable_i18n_support) {
deps += [ "//third_party/icu" ]
if (is_win) {
deps += [ "//third_party/icu:icudata" ]
}
} else {
sources -= [
"src/i18n.cc",
"src/i18n.h",
]
}
# TODO(brettw) other conditions from v8.gyp
# TODO(brettw) icu_use_data_file_flag
}
###############################################################################
# Executables
#
# TODO(jochen): Remove this as soon as toolchain.gypi is integrated.
if (build_cpu_arch != cpu_arch) {
source_set("mksnapshot") {
sources = [
]
}
} else {
executable("mksnapshot") {
sources = [
"src/mksnapshot.cc",
]
configs -= [ "//build/config/compiler:chromium_code" ]
configs += [ "//build/config/compiler:no_chromium_code" ]
configs += [ ":internal_config", ":features" ]
deps = [
":v8_base",
":v8_nosnapshot",
]
if (v8_compress_startup_data == "bz2") {
libs = [ "bz2" ]
}
}
}