Skip to content

Commit

Permalink
tdx-attest-sys: don't pass '-I' to clang when SGX_SDK not defined
Browse files Browse the repository at this point in the history
I am unable to cargo build tdx-attest-sys, because when SGX_SDK is not
defined (e.g. when libtdx-attest-dev is installed as a system package),
the bindgen call ends up looking having a clang_arg("-I") argument which
panics. Make sdk_inc empty by default and move prepending "-I" to the
match block.

Signed-off-by: jenkins <[email protected]>
  • Loading branch information
jepio authored and llly committed Mar 2, 2023
1 parent 6da2f7d commit cc582e8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion QuoteGeneration/quote_wrapper/tdx-attest-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,10 @@ fn main() {
println!("cargo:rerun-if-changed=bindings.h");

// Set sdk to search path if SGX_SDK is in environment variable
let mut sdk_inc = String::from("-I");
let mut sdk_inc = String::from("");
match env::var("SGX_SDK") {
Ok(val) => {
sdk_inc.push_str("-I");
sdk_inc.push_str(&val);
sdk_inc.push_str("/include/");
},
Expand Down

0 comments on commit cc582e8

Please sign in to comment.