chore: update bindings & ci workflow
This commit is contained in:
committed by
Michael Hoffmann
parent
5160a52f2d
commit
b553906543
4
.github/workflows/build.yaml
vendored
4
.github/workflows/build.yaml
vendored
@@ -8,7 +8,7 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [ubuntu-latest, windows-latest, macos-latest]
|
||||
compiler: [gcc, clang++]
|
||||
compiler: [gcc, clang]
|
||||
|
||||
name: compile
|
||||
runs-on: ${{ matrix.os }}
|
||||
@@ -19,4 +19,4 @@ jobs:
|
||||
uses: egor-tensin/setup-mingw@v2
|
||||
|
||||
- name: build
|
||||
run: ${{ matrix.compiler }} -o scanner.o -I./src -c src/scanner.cc -Werror
|
||||
run: ${{ matrix.compiler }} -o scanner.o -I./src -c src/scanner.c -Werror
|
||||
|
||||
@@ -9,18 +9,13 @@ edition = "2018"
|
||||
license = "Apache"
|
||||
|
||||
build = "bindings/rust/build.rs"
|
||||
include = [
|
||||
"bindings/rust/*",
|
||||
"grammar.js",
|
||||
"queries/*",
|
||||
"src/*",
|
||||
]
|
||||
include = ["bindings/rust/*", "grammar.js", "queries/*", "src/*"]
|
||||
|
||||
[lib]
|
||||
path = "bindings/rust/lib.rs"
|
||||
|
||||
[dependencies]
|
||||
tree-sitter = "~0.20"
|
||||
tree-sitter = "~0.20.10"
|
||||
|
||||
[build-dependencies]
|
||||
cc = "1.0"
|
||||
|
||||
@@ -30,7 +30,7 @@ let package = Package(
|
||||
],
|
||||
sources: [
|
||||
"src/parser.c",
|
||||
"src/scanner.cc",
|
||||
"src/scanner.c",
|
||||
],
|
||||
publicHeadersPath: "bindings/swift",
|
||||
cSettings: [.headerSearchPath("src")],
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
"sources": [
|
||||
"bindings/node/binding.cc",
|
||||
"src/parser.c",
|
||||
# If your language uses an external scanner, add it here.
|
||||
"src/scanner.c",
|
||||
],
|
||||
"cflags_c": [
|
||||
"-std=c99",
|
||||
|
||||
@@ -2,7 +2,7 @@ fn main() {
|
||||
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")
|
||||
@@ -10,26 +10,10 @@ fn main() {
|
||||
let parser_path = src_dir.join("parser.c");
|
||||
c_config.file(&parser_path);
|
||||
|
||||
// If your language uses an external scanner written in C,
|
||||
// then include this block of code:
|
||||
|
||||
/*
|
||||
let scanner_path = src_dir.join("scanner.c");
|
||||
c_config.file(&scanner_path);
|
||||
println!("cargo:rerun-if-changed={}", scanner_path.to_str().unwrap());
|
||||
*/
|
||||
|
||||
c_config.compile("parser");
|
||||
println!("cargo:rerun-if-changed={}", parser_path.to_str().unwrap());
|
||||
|
||||
let mut cpp_config = cc::Build::new();
|
||||
cpp_config.cpp(true);
|
||||
cpp_config.include(&src_dir);
|
||||
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);
|
||||
cpp_config.compile("scanner");
|
||||
println!("cargo:rerun-if-changed={}", scanner_path.to_str().unwrap());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user