Skip to content

Commit

Permalink
demonstrate allowlist use in simple example
Browse files Browse the repository at this point in the history
  • Loading branch information
Twinklebear committed Jun 29, 2022
1 parent a52d5c9 commit 007b06d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions examples/simple/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,17 @@ fn link_ispc() {
#[cfg(target_arch = "aarch64")]
let target_isas = vec![TargetISA::Neoni32x4];

let bindgen_opts = ispc_compile::BindgenOptions {
allowlist_functions: vec![std::borrow::Cow::Borrowed(&"add_lists")],
};

// For a portable program we can explicitly compile for each target ISA
// we want. Then ISPC will pick the correct ISA at runtime to call
// for the target CPU.
ispc_compile::Config::new()
.file("src/simple.ispc")
.target_isas(target_isas)
.bindgen_options(bindgen_opts)
.out_dir("src/")
.compile("simple");
}
Expand Down

0 comments on commit 007b06d

Please sign in to comment.