Avoid generating header files when they already exist
This commit is contained in:
parent
b5a9a43224
commit
735eafb7e0
|
@ -5,11 +5,14 @@ set -ex
|
|||
# Test program
|
||||
cd "$(dirname "$0")/.."
|
||||
./do.sh update
|
||||
./do.sh build token
|
||||
./do.sh fmt token-swap --all -- --check
|
||||
./do.sh build-lib token-swap -D warnings
|
||||
./do.sh build token-swap
|
||||
./do.sh clippy token-swap -- --deny=warnings
|
||||
|
||||
SPL_CBINDGEN=1 ./do.sh build-lib token-swap -D warnings
|
||||
git diff --exit-code token-swap/inc/token-swap.h
|
||||
|
||||
./do.sh build token
|
||||
./do.sh build token-swap
|
||||
./do.sh doc token-swap
|
||||
./do.sh test token-swap
|
||||
cc token-swap/inc/token-swap.h -o token-swap/target/token-swap.gch
|
||||
|
|
|
@ -6,8 +6,12 @@ set -ex
|
|||
cd "$(dirname "$0")/.."
|
||||
./do.sh update
|
||||
./do.sh fmt token --all -- --check
|
||||
./do.sh build token
|
||||
./do.sh clippy token -- --deny=warnings
|
||||
|
||||
SPL_CBINDGEN=1 ./do.sh build-lib token -D warnings
|
||||
git diff --exit-code token/inc/token.h
|
||||
|
||||
./do.sh build token
|
||||
./do.sh doc token
|
||||
./do.sh test token
|
||||
cc token/inc/token.h -o token/target/token.gch
|
||||
|
|
|
@ -3,6 +3,13 @@ extern crate cbindgen;
|
|||
use std::env;
|
||||
|
||||
fn main() {
|
||||
println!("cargo:rerun-if-env-changed=SPL_CBINDGEN");
|
||||
println!("cargo:rerun-if-changed=inc/token-swap.h");
|
||||
if std::path::Path::new("inc/token-swap.h").exists() && env::var("SPL_CBINDGEN").is_err() {
|
||||
return;
|
||||
}
|
||||
|
||||
println!("cargo:warning=Generating inc/token-swap.h");
|
||||
let crate_dir = env::var("CARGO_MANIFEST_DIR").unwrap();
|
||||
cbindgen::generate(&crate_dir)
|
||||
.unwrap()
|
||||
|
|
|
@ -3,6 +3,13 @@ extern crate cbindgen;
|
|||
use std::env;
|
||||
|
||||
fn main() {
|
||||
println!("cargo:rerun-if-env-changed=SPL_CBINDGEN");
|
||||
println!("cargo:rerun-if-changed=inc/token.h");
|
||||
if std::path::Path::new("inc/token.h").exists() && env::var("SPL_CBINDGEN").is_err() {
|
||||
return;
|
||||
}
|
||||
|
||||
println!("cargo:warning=Generating inc/token.h");
|
||||
let crate_dir = env::var("CARGO_MANIFEST_DIR").unwrap();
|
||||
let config = cbindgen::Config {
|
||||
header: Some("/* Autogenerated SPL Token program C Bindings */".to_string()),
|
||||
|
|
Loading…
Reference in New Issue