1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-24 08:09:08 -05:00
denoland-deno/core/libdeno/BUILD.gn

99 lines
1.9 KiB
Text
Raw Normal View History

2019-01-21 14:03:30 -05:00
# Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
import("//v8/gni/v8.gni")
group("default") {
testonly = true
deps = [
":libdeno_static_lib",
":libdeno_test",
":v8",
]
}
config("deno_config") {
include_dirs = [ "//v8" ] # This allows us to v8/src/base/ libraries.
configs = [ "//v8:external_config" ]
cflags = []
if (is_debug) {
defines = [ "DEBUG" ]
}
if (is_clang) {
cflags += [
"-fcolor-diagnostics",
"-fansi-escape-codes",
]
}
if (is_debug && is_clang && !is_win) {
cflags += [ "-glldb" ]
}
2018-12-13 16:19:17 -05:00
if (is_win) {
# The `/Zl` ("omit default library name") flag makes the compiler produce
# object files that can link with both the static and dynamic CRT.
cflags += [ "/Zl" ]
2018-12-13 16:19:17 -05:00
}
}
v8_source_set("v8") {
deps = [
"//v8:v8",
"//v8:v8_libbase",
"//v8:v8_libplatform",
"//v8:v8_libsampler",
]
2018-12-19 20:11:58 -05:00
configs = [ ":deno_config" ]
}
# Only functionality needed for libdeno_test and snapshot_creator
# In particular no assets, no rust, no msg handlers.
# Because snapshots are slow, it's important that snapshot_creator's
# dependencies are minimal.
2018-12-19 20:11:58 -05:00
v8_source_set("libdeno") {
sources = [
"api.cc",
"binding.cc",
"buffer.h",
"deno.h",
2019-01-29 11:32:40 -05:00
"exceptions.cc",
"exceptions.h",
"internal.h",
"modules.cc",
]
2018-12-13 16:19:17 -05:00
deps = [
2018-12-13 15:56:53 -05:00
":v8",
2018-12-19 20:11:58 -05:00
]
configs = [ ":deno_config" ]
}
# The cargo-driven build links with libdeno to pull in all non-rust code.
v8_static_library("libdeno_static_lib") {
output_name = "libdeno"
deps = [
":libdeno",
2018-12-13 16:19:17 -05:00
"//build/config:shared_library_deps",
2018-12-13 15:56:53 -05:00
]
2018-12-19 20:11:58 -05:00
configs = [ ":deno_config" ]
}
2019-05-01 09:48:56 -04:00
v8_executable("libdeno_test") {
testonly = true
sources = [
"libdeno_test.cc",
"modules_test.cc",
"test.cc",
]
deps = [
":libdeno",
"//testing/gtest:gtest",
]
data = [
2019-06-04 13:35:51 -04:00
"libdeno_test.js",
]
2019-06-04 13:35:51 -04:00
js_path = rebase_path(data[0])
defines = [ "JS_PATH=\"$js_path\"" ]
configs = [ ":deno_config" ]
}