summaryrefslogtreecommitdiff
path: root/BUILD.gn
diff options
context:
space:
mode:
Diffstat (limited to 'BUILD.gn')
-rw-r--r--BUILD.gn120
1 files changed, 7 insertions, 113 deletions
diff --git a/BUILD.gn b/BUILD.gn
index 060b024a1..c6b29306e 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -1,20 +1,20 @@
# Copyright 2018 the Deno authors. All rights reserved. MIT license.
import("//build/toolchain/cc_wrapper.gni")
-import("//third_party/v8/gni/v8.gni")
-import("//third_party/v8/snapshot_toolchain.gni")
import("//build_extra/flatbuffers/flatbuffer.gni")
import("//build_extra/flatbuffers/rust/rust_flatbuffer.gni")
-import("//build_extra/deno.gni")
import("//build_extra/rust/rust.gni")
import("//build_extra/toolchain/validate.gni")
+import("//third_party/v8/gni/v8.gni")
+import("//third_party/v8/snapshot_toolchain.gni")
+import("libdeno/deno.gni")
group("default") {
testonly = true
deps = [
":deno",
":hyper_hello",
- ":test_cc",
":test_rs",
+ "libdeno:test_cc",
]
}
@@ -25,31 +25,6 @@ group("cargo_check_deps") {
]
}
-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" ]
- }
-
- # Targets built with the `rust_executable()` template automatically pick up
- # these dependencies, but those built with `executable()` need them when they
- # have Rust inputs. Currently, there's only one such target, `test_cc`.
- if (is_mac) {
- libs = [ "resolv" ]
- }
- if (is_win) {
- libs = [ "userenv.lib" ]
- }
-
- if (is_clang) {
- cflags = [
- "-fcolor-diagnostics",
- "-fansi-escape-codes",
- ]
- }
-}
-
main_extern = [
"$rust_build:atty",
"$rust_build:dirs",
@@ -149,7 +124,7 @@ source_set("snapshot") {
sources = [
"src/snapshot.cc",
]
- configs += [ ":deno_config" ]
+ configs += [ "libdeno:deno_config" ]
inputs = [
"$target_gen_dir/snapshot_deno.bin",
]
@@ -198,89 +173,14 @@ rust_test("test_rs") {
]
}
-v8_executable("test_cc") {
- testonly = true
- sources = [
- "libdeno/file_util_test.cc",
- "libdeno/libdeno_test.cc",
- "libdeno/test.cc",
- ]
- deps = [
- ":create_snapshot_libdeno_test",
- ":libdeno",
- "//testing/gtest:gtest",
- ]
- data = [
- "$target_gen_dir/snapshot_libdeno_test.bin",
- ]
- snapshot_path = rebase_path(data[0], root_build_dir)
- defines = [ "SNAPSHOT_PATH=\"$snapshot_path\"" ]
- configs = [ ":deno_config" ]
-}
-
-v8_static_library("v8") {
- public_deps = [
- "third_party/v8:v8",
- "third_party/v8:v8_libbase",
- "third_party/v8:v8_libplatform",
- "third_party/v8:v8_libsampler",
- "//build/win:default_exe_manifest",
- ]
- 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 = [
- "libdeno/api.cc",
- "libdeno/binding.cc",
- "libdeno/deno.h",
- "libdeno/file_util.cc",
- "libdeno/file_util.h",
- "libdeno/internal.h",
- ]
- if (!use_prebuilt_v8) {
- public_deps = [
- ":v8",
- ]
- } else {
- # TODO(ry) It would be nice to have a standalone target for the prebuilt
- # library that could simply be added to the deps here, but it wasn't
- # obvious how to accomplish that in gn.
- if (is_mac) {
- libs = [ "//prebuilt/mac/libv8.a" ]
- } else if (is_linux) {
- libs = [ "//prebuilt/linux64/libv8.a" ]
- } else if (is_win) {
- libs = [ "//prebuilt/win/v8.lib" ]
- } else {
- assert(false, "We don't have prebuilt binaries for this platform yet.")
- }
- }
-}
-
v8_static_library("deno_deps") {
complete_static_lib = true
public_deps = [
- ":libdeno",
":msg_rs",
":snapshot",
+ "libdeno:libdeno",
]
- configs = [ ":deno_config" ]
-}
-
-v8_executable("snapshot_creator") {
- sources = [
- "libdeno/snapshot_creator.cc",
- ]
- deps = [
- ":libdeno",
- ]
- configs = [ ":deno_config" ]
+ configs = [ "libdeno:deno_config" ]
}
# Generates the core TypeScript type library for deno that will be
@@ -380,9 +280,3 @@ create_snapshot("deno") {
":bundle",
]
}
-
-# Generates $target_gen_dir/snapshot_libdeno_test.bin
-create_snapshot("libdeno_test") {
- testonly = true
- js = "libdeno/libdeno_test.js"
-}