Skip to content

Commit

Permalink
feat: added support for --target wasm32-unknown-unknown
Browse files Browse the repository at this point in the history
  • Loading branch information
av1ctor authored and andriyDev committed Jan 11, 2024
1 parent dd0aa88 commit aacc5a4
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,8 @@ fn generate_recast_bindings(
out_file: PathBuf,
) {
let mut builder = bindgen::Builder::default()
.parse_callbacks(Box::new(bindgen::CargoCallbacks))
.clang_args(["-x", "c++"].iter())
.parse_callbacks(Box::new(bindgen::CargoCallbacks::new()))
.clang_args(["-x", "c++", "-fvisibility=default"].iter())
.clang_args(
include_dirs
.iter()
Expand Down Expand Up @@ -361,8 +361,8 @@ fn generate_inline_bindings(
) {
let mut builder = bindgen::Builder::default()
.header("inline_lib_src/inline.h")
.parse_callbacks(Box::new(bindgen::CargoCallbacks))
.clang_args(["-x", "c++"].iter())
.parse_callbacks(Box::new(bindgen::CargoCallbacks::new()))
.clang_args(["-x", "c++", "-fvisibility=default"].iter())
.clang_args(
include_dirs
.iter()
Expand Down Expand Up @@ -412,6 +412,8 @@ fn link_cpp_std() {
Some("c++".to_string())
} else if target.contains("android") {
Some("c++_shared".to_string())
} else if target.contains("wasm32") {
None
} else {
Some("stdc++".to_string())
};
Expand Down

0 comments on commit aacc5a4

Please sign in to comment.