1
0
mirror of https://github.com/fluencelabs/wasmer synced 2025-07-18 17:11:56 +00:00
Files
.azure
.github
docs
examples
fuzz
integration_tests
lib
clif-backend
dev-utils
emscripten
emscripten-tests
kernel-loader
kernel-net
llvm-backend
middleware-common
middleware-common-tests
runtime
runtime-c-api
runtime-core
src
Cargo.toml
README.md
build.rs
image-loading-linux-x86-64.s
image-loading-macos-x86-64.s
singlepass-backend
spectests
wasi
wasi-tests
win-exception-handler
.gitignore
README.md
scripts
src
wapm-cli
.dockerignore
.gitattributes
.gitignore
.gitmodules
ATTRIBUTIONS.md
CHANGELOG.md
CODE_OF_CONDUCT.md
CONTRIBUTING.md
Cargo.lock
Cargo.toml
Dockerfile
Dockerfile.build
LICENSE
Makefile
README.md
SECURITY.md
azure-pipelines.yml
bors.toml
build
install.sh
logo.png
rustfmt.toml
wasmer/lib/runtime-core/build.rs

43 lines
1.3 KiB
Rust
Raw Normal View History

2019-03-19 10:58:58 -07:00
use blake2b_simd::blake2bp;
2019-06-26 01:39:30 +08:00
use std::{env, fs, io::Write, path::PathBuf};
2019-03-19 10:58:58 -07:00
const WASMER_VERSION: &'static str = env!("CARGO_PKG_VERSION");
fn main() {
let mut state = blake2bp::State::new();
state.update(WASMER_VERSION.as_bytes());
let hasher = state.finalize();
let hash_string = hasher.to_hex().as_str().to_owned();
2019-03-19 11:23:04 -07:00
let crate_dir = env::var("OUT_DIR").unwrap();
2019-03-19 10:58:58 -07:00
let wasmer_version_hash_file = {
let mut path = PathBuf::from(&crate_dir);
path.push("wasmer_version_hash.txt");
path
};
let mut f_out = fs::File::create(wasmer_version_hash_file)
.expect("Could not create file for wasmer hash value");
f_out
.write_all(hash_string.as_bytes())
.expect("Could not write to file for wasmer hash value");
// Enable "nightly" cfg if the current compiler is nightly.
if rustc_version::version_meta().unwrap().channel == rustc_version::Channel::Nightly {
println!("cargo:rustc-cfg=nightly");
}
2019-06-25 20:01:56 +08:00
2019-06-26 12:33:50 +08:00
if cfg!(all(target_os = "linux", target_arch = "x86_64")) {
cc::Build::new()
.file("image-loading-linux-x86-64.s")
.compile("image-loading");
} else if cfg!(all(target_os = "macos", target_arch = "x86_64")) {
cc::Build::new()
.file("image-loading-macos-x86-64.s")
.compile("image-loading");
} else {
}
2019-03-19 10:58:58 -07:00
}