Skip to content

Commit

Permalink
Merge pull request #564 from ionut-arm/missing-vendor
Browse files Browse the repository at this point in the history
Add error message if submodule not initialised
  • Loading branch information
ionut-arm authored Dec 1, 2021
2 parents 8710b12 + 1e68947 commit 9bc0c81
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ fn generate_ts_bindings(ts_include_dir: String) -> Result<()> {
let header = ts_include_dir.clone() + "/components/service/locator/interface/service_locator.h";
let encoding_header = ts_include_dir.clone() + "/protocols/rpc/common/packed-c/encoding.h";

if !Path::new(&header).exists() {
return Err(Error::new(
ErrorKind::Other,
"Trusted Services Locator header is missing. Have you run 'git submodule update --init'?",
));
}

println!("cargo:rerun-if-changed={}", header);

let bindings = bindgen::Builder::default()
Expand Down Expand Up @@ -67,8 +74,8 @@ fn generate_proto_sources(contract_dir: String) -> Result<()> {
#[cfg(feature = "trusted-service-provider")]
fn main() -> Result<()> {
{
generate_proto_sources(String::from("trusted-services-vendor/protocols"))?;
generate_ts_bindings(String::from("trusted-services-vendor"))?;
generate_proto_sources(String::from("trusted-services-vendor/protocols"))?;
}

Ok(())
Expand Down

0 comments on commit 9bc0c81

Please sign in to comment.