chore: clean up and remove redundant gn args (#981)

This commit is contained in:
Bert Belder 2022-05-24 02:31:58 +02:00
parent 9cc57eb44d
commit a9567bc31a
No known key found for this signature in database
GPG Key ID: 7A77887B2E2ED461
3 changed files with 16 additions and 27 deletions

29
.gn
View File

@ -17,27 +17,26 @@ check_targets = []
secondary_source = "//v8/" secondary_source = "//v8/"
default_args = { default_args = {
clang_use_chrome_plugins = false
is_component_build = false
linux_use_bundled_binutils = false linux_use_bundled_binutils = false
use_sysroot = false
use_dummy_lastchange = true use_dummy_lastchange = true
treat_warnings_as_errors = true use_sysroot = false
win_crt_flavor_agnostic = true
# Minimize size of debuginfo in distributed static library.
no_inline_line_tables = true
symbol_level = 1
v8_enable_snapshot_compression = false
v8_enable_javascript_promise_hooks = true
v8_promise_internal_field_count = 1
v8_use_external_startup_data = false
v8_use_snapshot = true
# To avoid test failure: # To avoid test failure:
# Fatal error in ../../../v8/src/heap/read-only-spaces.cc, line 69 # Fatal error in ../../../v8/src/heap/read-only-spaces.cc, line 69
# Check failed: read_only_blob_checksum_ == snapshot_checksum (<unprintable> # Check failed: read_only_blob_checksum_ == snapshot_checksum (<unprintable>
# vs. 604745897). # vs. 604745897).
v8_enable_shared_ro_heap = false v8_enable_shared_ro_heap = false
# https://cs.chromium.org/chromium/src/docs/ccache_mac.md
clang_use_chrome_plugins = false
v8_monolithic = false
v8_enable_snapshot_compression = false
v8_enable_javascript_promise_hooks = true
v8_promise_internal_field_count = 1
v8_use_external_startup_data = false
v8_use_snapshot = true
is_component_build = false
win_crt_flavor_agnostic = true
symbol_level = 1
} }

View File

@ -42,8 +42,4 @@ config("rusty_v8_config") {
"-fansi-escape-codes", "-fansi-escape-codes",
] ]
} }
if (is_debug && is_clang && !is_win) {
cflags += [ "-glldb" ]
}
} }

View File

@ -11,6 +11,8 @@ use std::process::Stdio;
use which::which; use which::which;
fn main() { fn main() {
println!("cargo:rerun-if-changed=.gn");
println!("cargo:rerun-if-changed=BUILD.gn");
println!("cargo:rerun-if-changed=src/binding.cc"); println!("cargo:rerun-if-changed=src/binding.cc");
// These are all the environment variables that we check. This is // These are all the environment variables that we check. This is
@ -120,10 +122,6 @@ fn build_v8() {
gn_args.push("use_custom_libcxx=false".to_string()); gn_args.push("use_custom_libcxx=false".to_string());
} }
if !is_debug() {
gn_args.push("v8_enable_handle_zapping=false".to_string());
}
// Fix GN's host_cpu detection when using x86_64 bins on Apple Silicon // Fix GN's host_cpu detection when using x86_64 bins on Apple Silicon
if cfg!(target_os = "macos") && cfg!(target_arch = "aarch64") { if cfg!(target_os = "macos") && cfg!(target_arch = "aarch64") {
gn_args.push("host_cpu=\"arm64\"".to_string()) gn_args.push("host_cpu=\"arm64\"".to_string())
@ -133,15 +131,12 @@ fn build_v8() {
println!("clang_base_path {}", clang_base_path.display()); println!("clang_base_path {}", clang_base_path.display());
gn_args.push(format!("clang_base_path={:?}", clang_base_path)); gn_args.push(format!("clang_base_path={:?}", clang_base_path));
gn_args.push("treat_warnings_as_errors=false".to_string()); gn_args.push("treat_warnings_as_errors=false".to_string());
// we can't use chromiums clang plugins with a system clang
gn_args.push("clang_use_chrome_plugins=false".to_string());
} else { } else {
println!("using Chromiums clang"); println!("using Chromiums clang");
let clang_base_path = clang_download(); let clang_base_path = clang_download();
gn_args.push(format!("clang_base_path={:?}", clang_base_path)); gn_args.push(format!("clang_base_path={:?}", clang_base_path));
if cfg!(target_os = "android") && cfg!(target_arch = "aarch64") { if cfg!(target_os = "android") && cfg!(target_arch = "aarch64") {
gn_args.push("clang_use_chrome_plugins=false".to_string());
gn_args.push("treat_warnings_as_errors=false".to_string()); gn_args.push("treat_warnings_as_errors=false".to_string());
} }
} }
@ -178,7 +173,6 @@ fn build_v8() {
}; };
if target_triple == "aarch64-linux-android" { if target_triple == "aarch64-linux-android" {
gn_args.push("is_component_build=false".to_string());
gn_args.push(r#"v8_target_cpu="arm64""#.to_string()); gn_args.push(r#"v8_target_cpu="arm64""#.to_string());
gn_args.push(r#"target_os="android""#.to_string()); gn_args.push(r#"target_os="android""#.to_string());