0
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-10-31 09:14:20 -04:00
denoland-deno/libdeno/BUILD.gn
2018-12-18 15:15:08 -05:00

83 lines
1.8 KiB
Text

# Copyright 2018 the Deno authors. All rights reserved. MIT license.
import("./deno.gni")
import("//third_party/v8/gni/v8.gni")
config("deno_config") {
include_dirs = [ "//third_party/v8" ] # This allows us to v8/src/base/ libraries.
configs = [ "//third_party/v8:external_config" ]
if (is_debug) {
defines = [ "DEBUG" ]
}
if (is_clang) {
cflags = [
"-fcolor-diagnostics",
"-fansi-escape-codes",
]
}
}
v8_static_library("v8") {
public_deps = [
"//build/win:default_exe_manifest",
"//third_party/v8:v8",
"//third_party/v8:v8_libbase",
"//third_party/v8:v8_libplatform",
"//third_party/v8:v8_libsampler",
]
configs = [ ":deno_config" ]
}
# Only functionality needed for libdeno_test and snapshot_creator
# In particular no flatbuffers, no assets, no rust, no msg handlers.
# Because snapshots are slow, it's important that snapshot_creator's
# dependencies are minimal.
v8_static_library("libdeno") {
configs = [ ":deno_config" ]
sources = [
"api.cc",
"binding.cc",
"deno.h",
"file_util.cc",
"file_util.h",
"internal.h",
]
public_deps = [
":v8",
]
}
v8_executable("snapshot_creator") {
sources = [
"snapshot_creator.cc",
]
deps = [
":libdeno",
]
configs = [ ":deno_config" ]
}
v8_executable("test_cc") {
testonly = true
sources = [
"file_util_test.cc",
"libdeno_test.cc",
"test.cc",
]
deps = [
":libdeno",
":snapshot_test",
"//testing/gtest:gtest",
]
data = [
"$target_gen_dir/snapshot_test.bin",
]
snapshot_path = rebase_path(data[0], root_build_dir)
defines = [ "SNAPSHOT_PATH=\"$snapshot_path\"" ]
configs = [ ":deno_config" ]
}
# Generates $target_gen_dir/snapshot_test.bin
snapshot("snapshot_test") {
testonly = true
source_root = "libdeno_test.js"
}