Skip to content

Commit 371b276

Browse files
authored
Add merge modules for the runtime. (#217)
- For sharing, the runtime files are built into a .wixlib, which is then referenced by the merge module project to build a merge module, and then by a package project to build the runtime MSI package. - The SDK project has references to the merge module project for each architecture, so it builds the merge modules and consumes them. - Sample added showing how to consume the merge module for an app. Other simplifications: - Drop the no-longer-needed `var.` in `$(preprocessor)` references. - Clean up XML namespaces. - Remove no-longer-needed config.wxi.
1 parent 39d4935 commit 371b276

File tree

22 files changed

+501
-414
lines changed

22 files changed

+501
-414
lines changed

platforms/Windows/Directory.Build.targets

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project>
3-
<ItemGroup Condition="'$(MSBuildProjectName)' != 'shared'">
4-
<ProjectReference Include="..\shared\shared.wixproj" />
3+
<ItemGroup Condition="'$(MSBuildProjectName)' != 'shared' AND '$(MSBuildProjectName)' != 'runtimelib'">
4+
<ProjectReference Include="$(MSBuildThisFileDirectory)shared\shared.wixproj" />
55
</ItemGroup>
66

77
<Import Project="WiXCodeSigning.targets" />

platforms/Windows/bld/bld.wxs

Lines changed: 73 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:ui="http://wixtoolset.org/schemas/v4/wxs/ui">
1+
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
22
<Package
33
Language="1033"
44
Manufacturer="swift.org"
55
Name="!(loc.Bld_ProductName)"
66
UpgradeCode="7e95dc06-7f84-4e8e-a038-8304af0468fb"
7-
Version="$(var.ProductVersion)"
7+
Version="$(ProductVersion)"
88
Scope="$(PackageScope)">
99

1010
<Media Id="1" Cabinet="bld.cab" EmbedCab="yes" />
@@ -28,20 +28,20 @@
2828
<ComponentGroup Id="binutils" Directory="_usr_bin">
2929
<!-- TODO(compnerd) can we use symbolic links to llvm-ar.exe instead? -->
3030
<Component>
31-
<File Source="$(var.TOOLCHAIN_ROOT)\usr\bin\llvm-dlltool.exe" />
31+
<File Source="$(TOOLCHAIN_ROOT)\usr\bin\llvm-dlltool.exe" />
3232
</Component>
3333
<Component>
34-
<File Source="$(var.TOOLCHAIN_ROOT)\usr\bin\llvm-lib.exe" />
34+
<File Source="$(TOOLCHAIN_ROOT)\usr\bin\llvm-lib.exe" />
3535
</Component>
3636
<Component>
37-
<File Source="$(var.TOOLCHAIN_ROOT)\usr\bin\llvm-ranlib.exe" />
37+
<File Source="$(TOOLCHAIN_ROOT)\usr\bin\llvm-ranlib.exe" />
3838
</Component>
3939
<!-- TODO(compnerd) can we use symbolic links to llvm-objdump.exe instead? -->
4040
<Component>
41-
<File Source="$(var.TOOLCHAIN_ROOT)\usr\bin\llvm-readelf.exe" />
41+
<File Source="$(TOOLCHAIN_ROOT)\usr\bin\llvm-readelf.exe" />
4242
</Component>
4343
<Component>
44-
<File Source="$(var.TOOLCHAIN_ROOT)\usr\bin\llvm-strip.exe" />
44+
<File Source="$(TOOLCHAIN_ROOT)\usr\bin\llvm-strip.exe" />
4545
</Component>
4646
<!--
4747
TODO(compnerd) we should symlink:
@@ -59,94 +59,94 @@
5959
-->
6060

6161
<Component>
62-
<File Source="$(var.TOOLCHAIN_ROOT)\usr\bin\dsymutil.exe" />
62+
<File Source="$(TOOLCHAIN_ROOT)\usr\bin\dsymutil.exe" />
6363
</Component>
6464
<Component>
65-
<File Source="$(var.TOOLCHAIN_ROOT)\usr\bin\llvm-ar.exe" />
65+
<File Source="$(TOOLCHAIN_ROOT)\usr\bin\llvm-ar.exe" />
6666
</Component>
6767
<Component>
68-
<File Source="$(var.TOOLCHAIN_ROOT)\usr\bin\llvm-cov.exe" />
68+
<File Source="$(TOOLCHAIN_ROOT)\usr\bin\llvm-cov.exe" />
6969
</Component>
7070
<Component>
71-
<File Source="$(var.TOOLCHAIN_ROOT)\usr\bin\llvm-cvtres.exe" />
71+
<File Source="$(TOOLCHAIN_ROOT)\usr\bin\llvm-cvtres.exe" />
7272
</Component>
7373
<Component>
74-
<File Source="$(var.TOOLCHAIN_ROOT)\usr\bin\llvm-cxxfilt.exe" />
74+
<File Source="$(TOOLCHAIN_ROOT)\usr\bin\llvm-cxxfilt.exe" />
7575
</Component>
7676
<Component>
77-
<File Source="$(var.TOOLCHAIN_ROOT)\usr\bin\llvm-dwarfdump.exe" />
77+
<File Source="$(TOOLCHAIN_ROOT)\usr\bin\llvm-dwarfdump.exe" />
7878
</Component>
7979
<Component>
80-
<File Source="$(var.TOOLCHAIN_ROOT)\usr\bin\llvm-dwp.exe" />
80+
<File Source="$(TOOLCHAIN_ROOT)\usr\bin\llvm-dwp.exe" />
8181
</Component>
8282
<Component>
83-
<File Source="$(var.TOOLCHAIN_ROOT)\usr\bin\llvm-lipo.exe" />
83+
<File Source="$(TOOLCHAIN_ROOT)\usr\bin\llvm-lipo.exe" />
8484
</Component>
8585
<Component>
86-
<File Source="$(var.TOOLCHAIN_ROOT)\usr\bin\llvm-mt.exe" />
86+
<File Source="$(TOOLCHAIN_ROOT)\usr\bin\llvm-mt.exe" />
8787
</Component>
8888
<Component>
89-
<File Source="$(var.TOOLCHAIN_ROOT)\usr\bin\llvm-nm.exe" />
89+
<File Source="$(TOOLCHAIN_ROOT)\usr\bin\llvm-nm.exe" />
9090
</Component>
9191
<Component>
92-
<File Source="$(var.TOOLCHAIN_ROOT)\usr\bin\llvm-objcopy.exe" />
92+
<File Source="$(TOOLCHAIN_ROOT)\usr\bin\llvm-objcopy.exe" />
9393
</Component>
9494
<Component>
95-
<File Source="$(var.TOOLCHAIN_ROOT)\usr\bin\llvm-objdump.exe" />
95+
<File Source="$(TOOLCHAIN_ROOT)\usr\bin\llvm-objdump.exe" />
9696
</Component>
9797
<Component>
98-
<File Source="$(var.TOOLCHAIN_ROOT)\usr\bin\llvm-pdbutil.exe" />
98+
<File Source="$(TOOLCHAIN_ROOT)\usr\bin\llvm-pdbutil.exe" />
9999
</Component>
100100
<Component>
101-
<File Source="$(var.TOOLCHAIN_ROOT)\usr\bin\llvm-profdata.exe" />
101+
<File Source="$(TOOLCHAIN_ROOT)\usr\bin\llvm-profdata.exe" />
102102
</Component>
103103
<Component>
104-
<File Source="$(var.TOOLCHAIN_ROOT)\usr\bin\llvm-rc.exe" />
104+
<File Source="$(TOOLCHAIN_ROOT)\usr\bin\llvm-rc.exe" />
105105
</Component>
106106
<Component>
107-
<File Source="$(var.TOOLCHAIN_ROOT)\usr\bin\llvm-readobj.exe" />
107+
<File Source="$(TOOLCHAIN_ROOT)\usr\bin\llvm-readobj.exe" />
108108
</Component>
109109
<Component>
110-
<File Source="$(var.TOOLCHAIN_ROOT)\usr\bin\llvm-size.exe" />
110+
<File Source="$(TOOLCHAIN_ROOT)\usr\bin\llvm-size.exe" />
111111
</Component>
112112
<Component>
113-
<File Source="$(var.TOOLCHAIN_ROOT)\usr\bin\llvm-strings.exe" />
113+
<File Source="$(TOOLCHAIN_ROOT)\usr\bin\llvm-strings.exe" />
114114
</Component>
115115
<Component>
116-
<File Source="$(var.TOOLCHAIN_ROOT)\usr\bin\llvm-symbolizer.exe" />
116+
<File Source="$(TOOLCHAIN_ROOT)\usr\bin\llvm-symbolizer.exe" />
117117
</Component>
118118
<Component>
119-
<File Source="$(var.TOOLCHAIN_ROOT)\usr\bin\llvm-undname.exe" />
119+
<File Source="$(TOOLCHAIN_ROOT)\usr\bin\llvm-undname.exe" />
120120
</Component>
121121
</ComponentGroup>
122122

123123
<ComponentGroup Id="lto">
124124
<Component Directory="_usr_bin">
125-
<File Source="$(var.TOOLCHAIN_ROOT)\usr\bin\LTO.dll" />
125+
<File Source="$(TOOLCHAIN_ROOT)\usr\bin\LTO.dll" />
126126
</Component>
127127

128128
<Component Directory="_usr_lib">
129-
<File Source="$(var.TOOLCHAIN_ROOT)\usr\lib\LTO.lib" />
129+
<File Source="$(TOOLCHAIN_ROOT)\usr\lib\LTO.lib" />
130130
</Component>
131131

132132
<Component Directory="_usr_include_llvm_c">
133-
<File Source="$(var.TOOLCHAIN_ROOT)\usr\include\llvm-c\lto.h" />
133+
<File Source="$(TOOLCHAIN_ROOT)\usr\include\llvm-c\lto.h" />
134134
</Component>
135135
</ComponentGroup>
136136

137137
<ComponentGroup Id="clang" Directory="_usr_bin">
138138
<!-- TODO(compnerd) can we use symbolic links to clang.exe instead? -->
139139
<Component>
140-
<File Source="$(var.TOOLCHAIN_ROOT)\usr\bin\clang-cl.exe" />
140+
<File Source="$(TOOLCHAIN_ROOT)\usr\bin\clang-cl.exe" />
141141
</Component>
142142
<Component>
143-
<File Source="$(var.TOOLCHAIN_ROOT)\usr\bin\clang-cpp.exe" />
143+
<File Source="$(TOOLCHAIN_ROOT)\usr\bin\clang-cpp.exe" />
144144
</Component>
145145
<Component>
146-
<File Source="$(var.TOOLCHAIN_ROOT)\usr\bin\clang++.exe" />
146+
<File Source="$(TOOLCHAIN_ROOT)\usr\bin\clang++.exe" />
147147
</Component>
148148
<Component>
149-
<File Source="$(var.TOOLCHAIN_ROOT)\usr\bin\clang.exe" />
149+
<File Source="$(TOOLCHAIN_ROOT)\usr\bin\clang.exe" />
150150
</Component>
151151
<!--
152152
TODO(compnerd) we should include:
@@ -160,103 +160,103 @@
160160
<ComponentGroup Id="lld" Directory="_usr_bin">
161161
<!-- TODO(compnerd) can we use symbolic links to lld.exe instead? -->
162162
<Component>
163-
<File Source="$(var.TOOLCHAIN_ROOT)\usr\bin\ld.lld.exe" />
163+
<File Source="$(TOOLCHAIN_ROOT)\usr\bin\ld.lld.exe" />
164164
</Component>
165165
<Component>
166-
<File Source="$(var.TOOLCHAIN_ROOT)\usr\bin\ld64.lld.exe" />
166+
<File Source="$(TOOLCHAIN_ROOT)\usr\bin\ld64.lld.exe" />
167167
</Component>
168168
<Component>
169-
<File Source="$(var.TOOLCHAIN_ROOT)\usr\bin\lld-link.exe" />
169+
<File Source="$(TOOLCHAIN_ROOT)\usr\bin\lld-link.exe" />
170170
</Component>
171171
<Component>
172-
<File Source="$(var.TOOLCHAIN_ROOT)\usr\bin\wasm-ld.exe" />
172+
<File Source="$(TOOLCHAIN_ROOT)\usr\bin\wasm-ld.exe" />
173173
</Component>
174174
<Component>
175-
<File Source="$(var.TOOLCHAIN_ROOT)\usr\bin\lld.exe" />
175+
<File Source="$(TOOLCHAIN_ROOT)\usr\bin\lld.exe" />
176176
</Component>
177177
</ComponentGroup>
178178

179179
<ComponentGroup Id="BlocksRuntime">
180180
<Component Directory="_usr_bin">
181-
<File Source="$(var.TOOLCHAIN_ROOT)\usr\bin\BlocksRuntime.dll" />
181+
<File Source="$(TOOLCHAIN_ROOT)\usr\bin\BlocksRuntime.dll" />
182182
</Component>
183183

184184
<Component Directory="_usr_lib">
185-
<File Source="$(var.TOOLCHAIN_ROOT)\usr\lib\BlocksRuntime.lib" />
185+
<File Source="$(TOOLCHAIN_ROOT)\usr\lib\BlocksRuntime.lib" />
186186
</Component>
187187

188188
<!-- TODO(compnerd) should we install the block headers? -->
189189
</ComponentGroup>
190190

191191
<ComponentGroup Id="libdispatch">
192192
<Component Directory="_usr_bin">
193-
<File Source="$(var.TOOLCHAIN_ROOT)\usr\bin\dispatch.dll" />
193+
<File Source="$(TOOLCHAIN_ROOT)\usr\bin\dispatch.dll" />
194194
</Component>
195195

196196
<Component Directory="_usr_lib">
197-
<File Source="$(var.TOOLCHAIN_ROOT)\usr\lib\dispatch.lib" />
197+
<File Source="$(TOOLCHAIN_ROOT)\usr\lib\dispatch.lib" />
198198
</Component>
199199

200200
<!-- TODO(compnerd) should we install the dispatch headers? -->
201201
</ComponentGroup>
202202

203203
<ComponentGroup Id="SwiftCxx" Directory="_usr_lib_swift_swiftToCxx">
204204
<Component>
205-
<File Source="$(var.TOOLCHAIN_ROOT)\usr\lib\swift\swiftToCxx\_SwiftCxxInteroperability.h" />
205+
<File Source="$(TOOLCHAIN_ROOT)\usr\lib\swift\swiftToCxx\_SwiftCxxInteroperability.h" />
206206
</Component>
207207
<Component>
208-
<File Source="$(var.TOOLCHAIN_ROOT)\usr\lib\swift\swiftToCxx\_SwiftStdlibCxxOverlay.h" />
208+
<File Source="$(TOOLCHAIN_ROOT)\usr\lib\swift\swiftToCxx\_SwiftStdlibCxxOverlay.h" />
209209
</Component>
210210
<Component>
211-
<File Source="$(var.TOOLCHAIN_ROOT)\usr\lib\swift\swiftToCxx\experimental-interoperability-version.json" />
211+
<File Source="$(TOOLCHAIN_ROOT)\usr\lib\swift\swiftToCxx\experimental-interoperability-version.json" />
212212
</Component>
213213
</ComponentGroup>
214214

215215
<ComponentGroup Id="SwiftDemangle">
216216
<Component Directory="_usr_bin">
217-
<File Source="$(var.TOOLCHAIN_ROOT)\usr\bin\swiftDemangle.dll" />
217+
<File Source="$(TOOLCHAIN_ROOT)\usr\bin\swiftDemangle.dll" />
218218
</Component>
219219
<Component Directory="_usr_lib">
220-
<File Source="$(var.TOOLCHAIN_ROOT)\usr\lib\swiftDemangle.lib" />
220+
<File Source="$(TOOLCHAIN_ROOT)\usr\lib\swiftDemangle.lib" />
221221
</Component>
222222
</ComponentGroup>
223223

224224
<ComponentGroup Id="SwiftFeatures" Directory="_usr_share_swift">
225225
<Component>
226-
<File Source="$(var.TOOLCHAIN_ROOT)\usr\share\swift\features.json" />
226+
<File Source="$(TOOLCHAIN_ROOT)\usr\share\swift\features.json" />
227227
</Component>
228228
</ComponentGroup>
229229

230230
<ComponentGroup Id="SwiftMigrator" Directory="_usr_lib_swift_migrator">
231231
<Component>
232-
<File Source="$(var.TOOLCHAIN_ROOT)\usr\lib\swift\migrator\ios4.json" />
232+
<File Source="$(TOOLCHAIN_ROOT)\usr\lib\swift\migrator\ios4.json" />
233233
</Component>
234234
<Component>
235-
<File Source="$(var.TOOLCHAIN_ROOT)\usr\lib\swift\migrator\ios42.json" />
235+
<File Source="$(TOOLCHAIN_ROOT)\usr\lib\swift\migrator\ios42.json" />
236236
</Component>
237237
<Component>
238-
<File Source="$(var.TOOLCHAIN_ROOT)\usr\lib\swift\migrator\macos4.json" />
238+
<File Source="$(TOOLCHAIN_ROOT)\usr\lib\swift\migrator\macos4.json" />
239239
</Component>
240240
<Component>
241-
<File Source="$(var.TOOLCHAIN_ROOT)\usr\lib\swift\migrator\macos42.json" />
241+
<File Source="$(TOOLCHAIN_ROOT)\usr\lib\swift\migrator\macos42.json" />
242242
</Component>
243243
<Component>
244-
<File Source="$(var.TOOLCHAIN_ROOT)\usr\lib\swift\migrator\overlay4.json" />
244+
<File Source="$(TOOLCHAIN_ROOT)\usr\lib\swift\migrator\overlay4.json" />
245245
</Component>
246246
<Component>
247-
<File Source="$(var.TOOLCHAIN_ROOT)\usr\lib\swift\migrator\overlay42.json" />
247+
<File Source="$(TOOLCHAIN_ROOT)\usr\lib\swift\migrator\overlay42.json" />
248248
</Component>
249249
<Component>
250-
<File Source="$(var.TOOLCHAIN_ROOT)\usr\lib\swift\migrator\tvos4.json" />
250+
<File Source="$(TOOLCHAIN_ROOT)\usr\lib\swift\migrator\tvos4.json" />
251251
</Component>
252252
<Component>
253-
<File Source="$(var.TOOLCHAIN_ROOT)\usr\lib\swift\migrator\tvos42.json" />
253+
<File Source="$(TOOLCHAIN_ROOT)\usr\lib\swift\migrator\tvos42.json" />
254254
</Component>
255255
<Component>
256-
<File Source="$(var.TOOLCHAIN_ROOT)\usr\lib\swift\migrator\watchos4.json" />
256+
<File Source="$(TOOLCHAIN_ROOT)\usr\lib\swift\migrator\watchos4.json" />
257257
</Component>
258258
<Component>
259-
<File Source="$(var.TOOLCHAIN_ROOT)\usr\lib\swift\migrator\watchos42.json" />
259+
<File Source="$(TOOLCHAIN_ROOT)\usr\lib\swift\migrator\watchos42.json" />
260260
</Component>
261261
</ComponentGroup>
262262

@@ -268,58 +268,58 @@
268268

269269
<!-- TODO(compnerd) can we use symbolic links to swift-frontend.exe instead? -->
270270
<Component>
271-
<File Source="$(var.TOOLCHAIN_ROOT)\usr\bin\swift-api-digester.exe" />
271+
<File Source="$(TOOLCHAIN_ROOT)\usr\bin\swift-api-digester.exe" />
272272
</Component>
273273
<Component>
274-
<File Source="$(var.TOOLCHAIN_ROOT)\usr\bin\swift-autolink-extract.exe" />
274+
<File Source="$(TOOLCHAIN_ROOT)\usr\bin\swift-autolink-extract.exe" />
275275
</Component>
276276
<Component>
277-
<File Source="$(var.TOOLCHAIN_ROOT)\usr\bin\swift-symbolgraph-extract.exe" />
277+
<File Source="$(TOOLCHAIN_ROOT)\usr\bin\swift-symbolgraph-extract.exe" />
278278
</Component>
279279
<Component>
280-
<File Source="$(var.TOOLCHAIN_ROOT)\usr\bin\swift-demangle.exe" />
280+
<File Source="$(TOOLCHAIN_ROOT)\usr\bin\swift-demangle.exe" />
281281
</Component>
282282
<Component>
283-
<File Source="$(var.TOOLCHAIN_ROOT)\usr\bin\swift-frontend.exe" />
283+
<File Source="$(TOOLCHAIN_ROOT)\usr\bin\swift-frontend.exe" />
284284
</Component>
285285
</ComponentGroup>
286286

287287
<ComponentGroup Id="argument_parser" Directory="_usr_bin">
288288
<Component>
289-
<File Source="$(var.DEVTOOLS_ROOT)\usr\bin\ArgumentParser.dll" />
289+
<File Source="$(DEVTOOLS_ROOT)\usr\bin\ArgumentParser.dll" />
290290
</Component>
291291
</ComponentGroup>
292292

293293
<ComponentGroup Id="tools_support_core" Directory="_usr_bin">
294294
<Component>
295-
<File Source="$(var.DEVTOOLS_ROOT)\usr\bin\TSCBasic.dll" />
295+
<File Source="$(DEVTOOLS_ROOT)\usr\bin\TSCBasic.dll" />
296296
</Component>
297297
<Component>
298-
<File Source="$(var.DEVTOOLS_ROOT)\usr\bin\TSCUtility.dll" />
298+
<File Source="$(DEVTOOLS_ROOT)\usr\bin\TSCUtility.dll" />
299299
</Component>
300300
</ComponentGroup>
301301

302302
<ComponentGroup Id="swift_driver" Directory="_usr_bin">
303303
<!-- TODO(compnerd) can we use symbolic links to swift.exe instead? -->
304304
<Component>
305-
<File Name="swiftc.exe" Source="$(var.DEVTOOLS_ROOT)\usr\bin\swift-driver.exe" />
305+
<File Name="swiftc.exe" Source="$(DEVTOOLS_ROOT)\usr\bin\swift-driver.exe" />
306306
</Component>
307307

308308
<Component>
309-
<File Name="swift.exe" Source="$(var.DEVTOOLS_ROOT)\usr\bin\swift-driver.exe" />
309+
<File Name="swift.exe" Source="$(DEVTOOLS_ROOT)\usr\bin\swift-driver.exe" />
310310
</Component>
311311
<Component>
312-
<File Source="$(var.DEVTOOLS_ROOT)\usr\bin\swift-help.exe" />
312+
<File Source="$(DEVTOOLS_ROOT)\usr\bin\swift-help.exe" />
313313
</Component>
314314

315315
<Component>
316-
<File Source="$(var.DEVTOOLS_ROOT)\usr\bin\SwiftOptions.dll" />
316+
<File Source="$(DEVTOOLS_ROOT)\usr\bin\SwiftOptions.dll" />
317317
</Component>
318318
<Component>
319-
<File Source="$(var.DEVTOOLS_ROOT)\usr\bin\SwiftDriver.dll" />
319+
<File Source="$(DEVTOOLS_ROOT)\usr\bin\SwiftDriver.dll" />
320320
</Component>
321321
<Component>
322-
<File Source="$(var.DEVTOOLS_ROOT)\usr\bin\SwiftDriverExecution.dll" />
322+
<File Source="$(DEVTOOLS_ROOT)\usr\bin\SwiftDriverExecution.dll" />
323323
</Component>
324324
</ComponentGroup>
325325

platforms/Windows/bundle/installer.wxs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:bal="http://wixtoolset.org/schemas/v4/wxs/bal">
22
<Bundle
33
Name="!(loc.BundleName)"
4-
Version="$(var.ProductVersion)"
4+
Version="$(ProductVersion)"
55
Manufacturer="swift.org"
66
Compressed="$(IsBundleCompressed)"
77
UpgradeCode="710F1827-DA4A-4BF4-BDCE-D5F2D7C0DEF2">

0 commit comments

Comments
 (0)