-
Notifications
You must be signed in to change notification settings - Fork 132
Expand file tree
/
Copy pathPackage.swift
More file actions
71 lines (70 loc) 路 2.67 KB
/
Copy pathPackage.swift
File metadata and controls
71 lines (70 loc) 路 2.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
// swift-tools-version:6.0
import PackageDescription
let package = Package(
name: "StringZilla",
platforms: [
// Linux doesn't have to be explicitly listed
.iOS(.v13), // For iOS, version 13 and later
.tvOS(.v13), // For tvOS, version 13 and later
.macOS(.v10_15), // For macOS, version 10.15 (Catalina) and later
.watchOS(.v6), // For watchOS, version 6 and later
.visionOS(.v1), // For visionOS, version 1.0 and later
],
products: [
.library(
name: "StringZilla",
targets: ["StringZillaC", "StringZilla"]
)
],
targets: [
.target(
name: "StringZillaC",
// The target is rooted at the repository so every source stays inside `path`,
// otherwise SwiftPM silently drops entries that escape it and links nothing.
path: ".",
sources: [
"c/stringzilla/runtime.c",
"c/stringzilla/compare.c",
"c/stringzilla/memory.c",
"c/stringzilla/hash.c",
"c/stringzilla/cipher.c",
"c/stringzilla/find.c",
"c/stringzilla/sort.c",
"c/stringzilla/intersect.c",
"c/stringzilla/utf8_norm.c",
"c/stringzilla/utf8_runes.c",
"c/stringzilla/utf8_tokens.c",
"c/stringzilla/utf8_wordbreaks.c",
"c/stringzilla/utf8_graphemes.c",
"c/stringzilla/utf8_sentences.c",
"c/stringzilla/utf8_linebreaks.c",
"c/stringzilla/utf8_uncased_fold.c",
"c/stringzilla/utf8_uncased.c",
],
// `include/` is the module header root, so the `module.modulemap` umbrella and the
// `#include "stringzilla/<...>.h"` chain resolve exactly as in the CMake/Rust/Python builds (`-I include`).
publicHeadersPath: "include",
cSettings: [
.define("SZ_DYNAMIC_DISPATCH", to: "1"),
.define("SZ_AVOID_LIBC", to: "0"),
.define("SZ_DEBUG", to: "0"),
.unsafeFlags(["-Wall"]),
]
),
.target(
name: "StringZilla",
dependencies: ["StringZillaC"],
path: "swift",
exclude: ["Test.swift"],
sources: ["StringProtocol+StringZilla.swift"]
),
.testTarget(
name: "StringZillaTests",
dependencies: ["StringZilla"],
path: "swift",
exclude: ["StringProtocol+StringZilla.swift"],
sources: ["Test.swift"]
),
],
cLanguageStandard: CLanguageStandard.c99
)