mirror of
https://github.com/denoland/rusty_v8.git
synced 2024-11-21 12:18:58 +00:00
clean up (#4)
This commit is contained in:
parent
7846160a63
commit
0463a8bbfb
21
LICENSE
Normal file
21
LICENSE
Normal file
@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2018-2019 the Deno authors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
@ -4,3 +4,6 @@
|
||||
|
||||
This is a project to replace libdeno with a full V8 binding. It's very much
|
||||
under construction and not usable. I'll update this message if it ever is.
|
||||
|
||||
|
||||
Env vars used in build.rs: `SCCACHE`, `GCLIENT_SYNC`
|
||||
|
41
build.rs
41
build.rs
@ -1,3 +1,4 @@
|
||||
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
|
||||
use cargo_gn;
|
||||
use std::env;
|
||||
use std::path::Path;
|
||||
@ -26,25 +27,26 @@ fn main() {
|
||||
println!("cargo:warning=Not using sccache");
|
||||
}
|
||||
|
||||
// gn_root should be absolute.
|
||||
// gn_root needs to be an absolute path.
|
||||
let gn_root = env::current_dir()
|
||||
.unwrap()
|
||||
.into_os_string()
|
||||
.into_string()
|
||||
.unwrap();;
|
||||
.unwrap();
|
||||
|
||||
let gn_out = cargo_gn::maybe_gen(&gn_root, gn_args);
|
||||
assert!(gn_out.exists());
|
||||
assert!(gn_out.join("args.gn").exists());
|
||||
cargo_gn::build("rusty_v8");
|
||||
|
||||
println!("cargo:rustc-link-lib=static=rusty_v8");
|
||||
|
||||
if cfg!(target_os = "windows") {
|
||||
println!("cargo:rustc-link-lib=dylib=winmm");
|
||||
}
|
||||
}
|
||||
|
||||
fn git_submodule_update() {
|
||||
println!("cargo:warning=Running git submodule update");
|
||||
Command::new("git")
|
||||
.arg("submodule")
|
||||
.arg("update")
|
||||
@ -57,30 +59,27 @@ fn gclient_sync() {
|
||||
let root = env::current_dir().unwrap();
|
||||
let third_party = root.join("third_party");
|
||||
let gclient_rel = PathBuf::from("depot_tools/gclient.py");
|
||||
let gclient_file = third_party.join("gclient_config.py");
|
||||
assert!(gclient_file.exists());
|
||||
|
||||
if !third_party.join(&gclient_rel).exists() {
|
||||
git_submodule_update();
|
||||
}
|
||||
|
||||
println!(
|
||||
"cargo:warning=Running gclient sync to download V8. This could take a while."
|
||||
);
|
||||
println!("Running gclient sync to download V8. This could take a while.");
|
||||
|
||||
let mut cmd = Command::new("python");
|
||||
cmd.current_dir(&third_party);
|
||||
cmd.arg(&gclient_rel);
|
||||
cmd.arg("sync");
|
||||
cmd.arg("--no-history");
|
||||
cmd.arg("--shallow");
|
||||
// cmd.arg("--verbose");
|
||||
cmd.env("DEPOT_TOOLS_UPDATE", "0");
|
||||
cmd.env("DEPOT_TOOLS_METRICS", "0");
|
||||
cmd.env("GCLIENT_FILE", third_party.join("gclient_config.py"));
|
||||
// We're not using Google's internal infrastructure.
|
||||
cmd.env("DEPOT_TOOLS_WIN_TOOLCHAIN", "0");
|
||||
|
||||
println!("running: {:?}", cmd);
|
||||
let status = cmd.status().expect("gclient sync failed");
|
||||
let status = Command::new("python")
|
||||
.current_dir(&third_party)
|
||||
.arg(&gclient_rel)
|
||||
.arg("sync")
|
||||
.arg("--no-history")
|
||||
.arg("--shallow")
|
||||
.env("DEPOT_TOOLS_UPDATE", "0")
|
||||
.env("DEPOT_TOOLS_METRICS", "0")
|
||||
.env("GCLIENT_FILE", gclient_file)
|
||||
.env("DEPOT_TOOLS_WIN_TOOLCHAIN", "0")
|
||||
.status()
|
||||
.expect("gclient sync failed");
|
||||
assert!(status.success());
|
||||
}
|
||||
|
||||
|
@ -1,3 +1,5 @@
|
||||
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
|
||||
|
||||
#![warn(clippy::all)]
|
||||
#![allow(dead_code)]
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user