feat(bindings): auto-detect scanners
This commit is contained in:
parent
60c5057617
commit
66dab20462
5 changed files with 38 additions and 26 deletions
|
|
@ -1,6 +1,13 @@
|
|||
// swift-tools-version:5.3
|
||||
|
||||
import Foundation
|
||||
import PackageDescription
|
||||
|
||||
var sources = ["src/parser.c"]
|
||||
if FileManager.default.fileExists(atPath: "src/scanner.c") {
|
||||
sources.append("src/scanner.c")
|
||||
}
|
||||
|
||||
let package = Package(
|
||||
name: "TreeSitterCAMEL_PARSER_NAME",
|
||||
products: [
|
||||
|
|
@ -14,10 +21,7 @@ let package = Package(
|
|||
name: "TreeSitterCAMEL_PARSER_NAME",
|
||||
dependencies: [],
|
||||
path: ".",
|
||||
sources: [
|
||||
"src/parser.c",
|
||||
// NOTE: if your language has an external scanner, add it here.
|
||||
],
|
||||
sources: sources,
|
||||
resources: [
|
||||
.copy("queries")
|
||||
],
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue