-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPackage.swift
More file actions
115 lines (112 loc) · 3.69 KB
/
Copy pathPackage.swift
File metadata and controls
115 lines (112 loc) · 3.69 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
// swift-tools-version: 6.2
import PackageDescription
// Platform-specific source files for FreeType
#if os(macOS) || os(iOS)
let ftSystem = "builds/unix/ftsystem.c"
let ftDebug = "src/base/ftdebug.c"
#elseif os(Windows)
let ftSystem = "builds/windows/ftsystem.c"
let ftDebug = "builds/windows/ftdebug.c"
#else
let ftSystem = "src/base/ftsystem.c"
let ftDebug = "src/base/ftdebug.c"
#endif
let package = Package(
name: "Apus",
products: [
.library(name: "Apus", targets: ["Apus"]),
],
traits: [
.trait(name: "Fontconfig", description: "Enable Fontconfig support for font discovery on Linux"),
.default(enabledTraits: ["Fontconfig"]),
],
targets: [
.target(
name: "Apus",
dependencies: [
"harfbuzz",
"freetype",
.target(
name: "Fontconfig",
condition: .when(platforms: [.linux], traits: ["Fontconfig"])
),
]
),
.testTarget(
name: "ApusTests",
dependencies: ["Apus"]
),
.target(
name: "freetype",
path: "Sources/freetype",
sources: [
ftSystem,
ftDebug,
"src/autofit/autofit.c",
"src/base/ftbase.c",
"src/base/ftbbox.c",
"src/base/ftbdf.c",
"src/base/ftbitmap.c",
"src/base/ftcid.c",
"src/base/ftfstype.c",
"src/base/ftgasp.c",
"src/base/ftglyph.c",
"src/base/ftgxval.c",
"src/base/ftinit.c",
"src/base/ftmm.c",
"src/base/ftotval.c",
"src/base/ftpatent.c",
"src/base/ftpfr.c",
"src/base/ftstroke.c",
"src/base/ftsynth.c",
"src/base/fttype1.c",
"src/base/ftwinfnt.c",
"src/bdf/bdf.c",
"src/bzip2/ftbzip2.c",
"src/cache/ftcache.c",
"src/cff/cff.c",
"src/cid/type1cid.c",
"src/gzip/ftgzip.c",
"src/lzw/ftlzw.c",
"src/pcf/pcf.c",
"src/pfr/pfr.c",
"src/psaux/psaux.c",
"src/pshinter/pshinter.c",
"src/psnames/psnames.c",
"src/raster/raster.c",
"src/sdf/sdf.c",
"src/sfnt/sfnt.c",
"src/smooth/smooth.c",
"src/svg/svg.c",
"src/truetype/truetype.c",
"src/type1/type1.c",
"src/type42/type42.c",
"src/winfonts/winfnt.c",
],
publicHeadersPath: "include",
cSettings: [
.define("FT2_BUILD_LIBRARY"),
.define("FT_CONFIG_CONFIG_H", to: "<freetype/config/ftconfig.h>"),
.define("FT_CONFIG_OPTIONS_H", to: "<freetype/config/ftoption.h>"),
.define("HAVE_UNISTD_H", to: "1", .when(platforms: [.macOS, .iOS, .linux])),
.define("HAVE_FCNTL_H", to: "1", .when(platforms: [.macOS, .iOS, .linux])),
]
),
.target(
name: "harfbuzz",
dependencies: ["freetype"],
path: "Sources/harfbuzz",
sources: ["src/harfbuzz.cc"],
publicHeadersPath: "src",
cxxSettings: [
.define("HAVE_FREETYPE"),
]
),
.systemLibrary(
name: "Fontconfig",
path: "Sources/Fontconfig",
pkgConfig: "fontconfig",
providers: [.apt(["libfontconfig1-dev"])]
),
]
)