Repository navigation
Expand file tree
/
Copy pathPackage.swift
More file actions
180 lines (178 loc) · 6.72 KB
/
Copy pathPackage.swift
File metadata and controls
180 lines (178 loc) · 6.72 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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
// swift-tools-version:5.7
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription
let package = Package(
name: "Apex",
platforms: [
.macOS(.v10_13),
.iOS(.v11),
],
products: [
.library(
name: "Apex",
targets: ["Apex"]
),
.library(
name: "ApexC",
targets: ["ApexC"]
)
],
targets: [
// Headers for cmark-gfm SPM build (config.h, cmark-gfm_export.h, cmark-gfm_version.h).
// Separate target so dependency include path is used; headerSearchPath is not
// applied when the package is built as a dependency (Xcode/SPM bug).
.target(
name: "CcmarkGFMSupport",
path: "PackageSupport/cmark-gfm",
sources: ["cmark_gfm_spm_stub.c"],
publicHeadersPath: ".",
cSettings: [.headerSearchPath(".")]
),
// cmark-gfm core library (built from submodule)
.target(
name: "CcmarkGFM",
dependencies: ["CcmarkGFMSupport"],
path: "vendor/cmark-gfm/src",
exclude: [
"main.c", // CLI executable
"xml.c", // XML renderer (not needed)
"man.c", // Man page renderer (not needed)
"plaintext.c", // Plaintext renderer (not needed)
"latex.c", // LaTeX renderer (not needed)
],
publicHeadersPath: ".",
cSettings: [
.headerSearchPath("."),
.headerSearchPath("../extensions"),
.define("CMARK_STATIC_DEFINE"),
.define("CMARK_GFM_STATIC_DEFINE"),
.define("HAVE_STDBOOL_H", to: "1"),
.define("HAVE___BUILTIN_EXPECT", to: "1"),
.define("HAVE___ATTRIBUTE__", to: "1"),
]
),
// cmark-gfm extensions
.target(
name: "CcmarkGFMExtensions",
dependencies: ["CcmarkGFM", "CcmarkGFMSupport"],
path: "vendor/cmark-gfm/extensions",
publicHeadersPath: ".",
cSettings: [
.headerSearchPath("../src"),
.define("CMARK_GFM_EXTENSIONS_STATIC_DEFINE"),
]
),
// libyaml bundled library (built from submodule)
.target(
name: "CYaml",
path: "vendor/libyaml",
exclude: [
"src/Makefile.am"
],
sources: ["src"],
publicHeadersPath: "include",
cSettings: [
.headerSearchPath("include"),
.headerSearchPath("src"),
.define("YAML_VERSION_MAJOR", to: "0"),
.define("YAML_VERSION_MINOR", to: "2"),
.define("YAML_VERSION_PATCH", to: "5"),
.define("YAML_VERSION_STRING", to: "\"0.2.5\""),
]
),
// Apex C library
.target(
name: "ApexC",
dependencies: ["CcmarkGFM", "CcmarkGFMExtensions", "CYaml"],
path: ".",
sources: [
"src/apex.c",
"src/ast_markdown.c",
"src/ast_terminal.c",
"src/ast_man.c",
"src/ast_rtf.c",
"src/filters_ast.c",
"src/ast_json.c",
"src/plugins_env.c",
"src/plugins.c",
"src/plugins_remote.c",
"src/plugin_catalog.c",
"src/html_renderer.c",
"src/extensions/metadata.c",
"src/extensions/wiki_links.c",
"src/extensions/math.c",
"src/extensions/critic.c",
"src/extensions/callouts.c",
"src/extensions/raw_content.c",
"src/extensions/code_fence_attrs.c",
"src/extensions/quarto_diagrams.c",
"src/extensions/quarto_shortcodes.c",
"src/extensions/quarto_polish.c",
"src/extensions/quarto_lists.c",
"src/extensions/includes.c",
"src/extensions/inline_tables.c",
"src/extensions/toc.c",
"src/extensions/abbreviations.c",
"src/extensions/emoji.c",
"src/extensions/special_markers.c",
"src/extensions/ial.c",
"src/extensions/bear_image_attrs.c",
"src/extensions/definition_list.c",
"src/extensions/advanced_footnotes.c",
"src/extensions/advanced_tables.c",
"src/extensions/html_markdown.c",
"src/extensions/fenced_divs.c",
"src/extensions/table_html_postprocess.c",
"src/extensions/inline_footnotes.c",
"src/extensions/highlight.c",
"src/extensions/insert.c",
"src/extensions/sup_sub.c",
"src/extensions/header_ids.c",
"src/extensions/relaxed_tables.c",
"src/extensions/grid_tables.c",
"src/extensions/citations.c",
"src/extensions/index.c",
"src/extensions/concordance.c",
"src/extensions/syntax_highlight.c",
"src/pretty_html.c",
"src/buffer.c",
"src/parser.c",
"src/renderer.c",
"src/utf8.c",
],
publicHeadersPath: "include",
cSettings: [
.headerSearchPath("include"),
.headerSearchPath("include/apex"),
.headerSearchPath("vendor/cmark-gfm/src"),
.headerSearchPath("vendor/cmark-gfm/extensions"),
.headerSearchPath("vendor/libyaml/include"),
.define("APEX_HAVE_LIBYAML", to: "1"), // Always enabled when bundled
]
),
// Objective-C wrapper
.target(
name: "ApexObjC",
dependencies: ["ApexC"],
path: "objc",
exclude: ["Apex.swift", "ApexPlugins.swift"],
sources: ["NSString+Apex.m", "NSString+ApexPlugins.m"],
publicHeadersPath: ".",
cSettings: [
.headerSearchPath("../include"),
]
),
// Swift wrapper
.target(
name: "Apex",
dependencies: ["ApexObjC", "ApexC"],
path: "objc",
exclude: ["NSString+Apex.m", "NSString+Apex.h", "NSString+ApexPlugins.m", "NSString+ApexPlugins.h"],
sources: ["Apex.swift", "ApexPlugins.swift"],
publicHeadersPath: ".",
swiftSettings: [
.define("APEX_HAVE_LIBYAML"), // Always enabled when bundled
]
),
]
)