Skip to content

Commit

Permalink
fix(build): change scanner name
Browse files Browse the repository at this point in the history
  • Loading branch information
amaanq committed Feb 9, 2024
1 parent 863e4e9 commit bb0eb0f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 24 deletions.
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ let package = Package(
],
sources: [
"src/parser.c",
"src/scanner.cc",
"src/scanner.c",
],
resources: [
.copy("queries")
Expand Down
2 changes: 1 addition & 1 deletion binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"sources": [
"src/parser.c",
"bindings/node/binding.cc",
"src/scanner.cc"
"src/scanner.c"
],
"cflags_c": [
"-std=c99",
Expand Down
29 changes: 7 additions & 22 deletions bindings/rust/build.rs
Original file line number Diff line number Diff line change
@@ -1,34 +1,19 @@
use std::env;
use std::path::Path;
extern crate cc;

fn main() {
let src_dir = Path::new("src");
let src_dir = std::path::Path::new("src");

let mut c_config = cc::Build::new();
c_config.include(&src_dir);
c_config.include(src_dir);
c_config
.flag_if_supported("-Wno-unused-parameter")
.flag_if_supported("-Wno-unused-but-set-variable")
.flag_if_supported("-Wno-trigraphs");
let parser_path = src_dir.join("parser.c");
c_config.file(&parser_path);
println!("cargo:rerun-if-changed={}", parser_path.to_str().unwrap());
c_config.compile("parser");

let mut cpp_config = cc::Build::new();
cpp_config.cpp(true);
cpp_config.include(&src_dir);

if env::var("TARGET").unwrap() == "wasm32-wasi" {
cpp_config.flag_if_supported("-fno-exceptions");
}

cpp_config
.flag_if_supported("-Wno-unused-parameter")
.flag_if_supported("-Wno-unused-but-set-variable");
let scanner_path = src_dir.join("scanner.cc");
cpp_config.file(&scanner_path);
let scanner_path = src_dir.join("scanner.c");
c_config.file(&scanner_path);
println!("cargo:rerun-if-changed={}", scanner_path.to_str().unwrap());
cpp_config.compile("scanner");

c_config.compile("parser");
println!("cargo:rerun-if-changed={}", parser_path.to_str().unwrap());
}

0 comments on commit bb0eb0f

Please sign in to comment.