summaryrefslogtreecommitdiff
path: root/build.rs
diff options
context:
space:
mode:
authorandy finch <andyfinch7@gmail.com>2019-03-05 17:26:59 -0500
committerRyan Dahl <ry@tinyclouds.org>2019-03-05 17:26:59 -0500
commitda004fb6c8213956cf6fa608e1d732f8f75da481 (patch)
tree07154a4882f6d75e3e9d693feb3310a797929a0d /build.rs
parentee29ed79a7539dbc821495106da9308e6c0ef295 (diff)
fix snapshots in gn build (#1886)
Bug introduced in 75fe80d5a4992ddad89160c2e0113a1af8d3d24a
Diffstat (limited to 'build.rs')
-rw-r--r--build.rs14
1 files changed, 9 insertions, 5 deletions
diff --git a/build.rs b/build.rs
index 98dd393c3..261189f5e 100644
--- a/build.rs
+++ b/build.rs
@@ -76,11 +76,15 @@ fn main() {
}
}
- // Enable snapshots for x64 builds
- if env::var("CARGO_CFG_TARGET_ARCH").unwrap() == "x86_64" {
- // Not related to v8_use_snapshot
- // This only enables using pregenerated snapshots for isolate init
- println!("cargo:rustc-cfg=feature=\"use-snapshot-init\"");
+ // If target_arch != host_arch disable snapshots since we are cross compiling.
+ if env::var("CARGO_CFG_TARGET_ARCH").unwrap().as_str() != env::var("HOST")
+ .unwrap()
+ .as_str()
+ .split("-")
+ .collect::<Vec<&str>>()[0]
+ {
+ // no-snapshot-init is not related to v8_use_snapshots
+ println!("cargo:rustc-cfg=feature=\"no-snapshot-init\"");
}
if !gn_out_path.join("build.ninja").exists() {