Skip to content

Commit 99bb8c9

Browse files
committed
build: correct installation locations
Update the toolchain install destinations for the various pieces to have the pieces where they are expected. This is particularly important as the installer packaging assumes that the installation is in the canonical location.
1 parent 79d45c0 commit 99bb8c9

File tree

1 file changed

+18
-17
lines changed

1 file changed

+18
-17
lines changed

utils/build-windows-toolchain.bat

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ set BuildRoot=T:
2626

2727
:: Identify the InstallRoot
2828
set InstallRoot=%BuildRoot%\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr
29+
set PlatformRoot=%BuildRoot%\Library\Developer\Platforms\Windows.platform
30+
set SDKInstallRoot=%PlatformRoot%\Developer\SDKs\Windows.sdk
2931

3032
:: Setup temporary directories
3133
md %BuildRoot%\tmp
@@ -213,7 +215,7 @@ cmake ^
213215
-D CMAKE_EXE_LINKER_FLAGS="/INCREMENTAL:NO" ^
214216
-D CMAKE_SHARED_LINKER_FLAGS="/INCREMENTAL:NO" ^
215217

216-
-D CMAKE_INSTALL_PREFIX=%BuildRoot%\Library\Developer\Platforms\Windows.platform\Developer\SDKs\Windows.sdk\usr ^
218+
-D CMAKE_INSTALL_PREFIX=%SDKInstallRoot%\usr ^
217219

218220
-D LLVM_DIR=%BuildRoot%\1\lib\cmake\llvm ^
219221
-D SWIFT_NATIVE_SWIFT_TOOLS_PATH=%BuildRoot%\1\bin ^
@@ -246,7 +248,7 @@ cmake ^
246248
-D CMAKE_EXE_LINKER_FLAGS="/INCREMENTAL:NO" ^
247249
-D CMAKE_SHARED_LINKER_FLAGS="/INCREMENTAL:NO" ^
248250

249-
-D CMAKE_INSTALL_PREFIX=%BuildRoot%\Library\Developer\Platforms\Windows.platform\Developer\SDKs\Windows.sdk\usr ^
251+
-D CMAKE_INSTALL_PREFIX=%SDKInstallRoot%\usr ^
250252

251253
-D ENABLE_SWIFT=YES ^
252254

@@ -269,7 +271,7 @@ cmake ^
269271
-D CMAKE_EXE_LINKER_FLAGS="/INCREMENTAL:NO" ^
270272
-D CMAKE_SHARED_LINKER_FLAGS="/INCREMENTAL:NO" ^
271273

272-
-D CMAKE_INSTALL_PREFIX=%BuildRoot%\Library\Developer\Platforms\Windows.platform\Developer\SDKs\Windows.sdk\usr ^
274+
-D CMAKE_INSTALL_PREFIX=%SDKInstallRoot%\usr ^
273275

274276
-D CURL_DIR=%BuildRoot%\Library\curl-7.77.0\usr\lib\cmake\CURL ^
275277
-D ICU_ROOT=%BuildRoot%\Library\icu-67.1 ^
@@ -284,7 +286,6 @@ cmake ^
284286

285287
-G Ninja ^
286288
-S %SourceRoot%\swift-corelibs-foundation || (exit /b)
287-
:: TODO(compnerd) remove this - debugging
288289
cmake --build %BuildRoot%\4 || (exit /b)
289290
cmake --build %BuildRoot%\4 --target install || (exit /b)
290291

@@ -302,7 +303,7 @@ cmake ^
302303
-D CMAKE_EXE_LINKER_FLAGS="/INCREMENTAL:NO" ^
303304
-D CMAKE_SHARED_LINKER_FLAGS="/INCREMENTAL:NO" ^
304305

305-
-D CMAKE_INSTALL_PREFIX=%BuildRoot%\Library\Developer\Platforms\Windows.platform\Developer\SDKs\Windows.sdk\usr ^
306+
-D CMAKE_INSTALL_PREFIX=%PlatformRoot%\Developer\Library\XCTest-development\usr ^
306307

307308
-D dispatch_DIR=%BuildRoot%\3\cmake\modules ^
308309
-D Foundation_DIR=%BuildRoot%\4\cmake\modules ^
@@ -326,7 +327,7 @@ cmake ^
326327
-D CMAKE_EXE_LINKER_FLAGS="/INCREMENTAL:NO" ^
327328
-D CMAKE_SHARED_LINKER_FLAGS="/INCREMENTAL:NO" ^
328329

329-
-D CMAKE_INSTALL_PREFIX=%BuildRoot%\Library\Developer\Platforms\Windows.platform\Developer\SDKs\Windows.sdk\usr ^
330+
-D CMAKE_INSTALL_PREFIX=%InstallRoot% ^
330331

331332
-D dispatch_DIR=%BuildRoot%\3\cmake\modules ^
332333
-D Foundation_DIR=%BuildRoot%\4\cmake\modules ^
@@ -352,7 +353,7 @@ cmake ^
352353
-D CMAKE_EXE_LINKER_FLAGS="/INCREMENTAL:NO" ^
353354
-D CMAKE_SHARED_LINKER_FLAGS="/INCREMENTAL:NO" ^
354355

355-
-D CMAKE_INSTALL_PREFIX=%BuildRoot%\Library\Developer\Platforms\Windows.platform\Developer\SDKs\Windows.sdk\usr ^
356+
-D CMAKE_INSTALL_PREFIX=%InstallRoot% ^
356357

357358
-D LLBUILD_SUPPORT_BINDINGS=Swift ^
358359

@@ -380,7 +381,7 @@ cmake ^
380381
-D CMAKE_EXE_LINKER_FLAGS="/INCREMENTAL:NO" ^
381382
-D CMAKE_SHARED_LINKER_FLAGS="/INCREMENTAL:NO" ^
382383

383-
-D CMAKE_INSTALL_PREFIX=%BuildRoot%\Library\Developer\Platforms\Windows.platform\Developer\SDKs\Windows.sdk\usr ^
384+
-D CMAKE_INSTALL_PREFIX=%InstallRoot% ^
384385

385386
-D dispatch_DIR=%BuildRoot%\3\cmake\modules ^
386387
-D Foundation_DIR=%BuildRoot%\4\cmake\modules ^
@@ -406,7 +407,7 @@ cmake ^
406407
-D CMAKE_EXE_LINKER_FLAGS="/INCREMENTAL:NO" ^
407408
-D CMAKE_SHARED_LINKER_FLAGS="/INCREMENTAL:NO" ^
408409

409-
-D CMAKE_INSTALL_PREFIX=%BuildRoot%\Library\Developer\Platforms\Windows.platform\Developer\SDKs\Windows.sdk\usr ^
410+
-D CMAKE_INSTALL_PREFIX=%InstallRoot% ^
410411

411412
-D dispatch_DIR=%BuildRoot%\3\cmake\modules ^
412413
-D Foundation_DIR=%BuildRoot%\4\cmake\modules ^
@@ -431,7 +432,7 @@ cmake ^
431432
-D CMAKE_EXE_LINKER_FLAGS="/INCREMENTAL:NO" ^
432433
-D CMAKE_SHARED_LINKER_FLAGS="/INCREMENTAL:NO" ^
433434

434-
-D CMAKE_INSTALL_PREFIX=%BuildRoot%\Library\Developer\Platforms\Windows.platform\Developer\SDKs\Windows.sdk\usr ^
435+
-D CMAKE_INSTALL_PREFIX=%InstallRoot% ^
435436

436437
-D dispatch_DIR=%BuildRoot%\3\cmake\modules ^
437438
-D Foundation_DIR=%BuildRoot%\4\cmake\modules ^
@@ -460,7 +461,7 @@ cmake ^
460461
-D CMAKE_EXE_LINKER_FLAGS="/INCREMENTAL:NO" ^
461462
-D CMAKE_SHARED_LINKER_FLAGS="/INCREMENTAL:NO" ^
462463

463-
-D CMAKE_INSTALL_PREFIX=%BuildRoot%\Library\Developer\Platforms\Windows.platform\Developer\SDKs\Windows.sdk\usr ^
464+
-D CMAKE_INSTALL_PREFIX=%InstallRoot% ^
464465

465466
-D dispatch_DIR=%BuildRoot%\3\cmake\modules ^
466467
-D Foundation_DIR=%BuildRoot%\4\cmake\modules ^
@@ -484,7 +485,7 @@ cmake ^
484485
-D CMAKE_EXE_LINKER_FLAGS="/INCREMENTAL:NO" ^
485486
-D CMAKE_SHARED_LINKER_FLAGS="/INCREMENTAL:NO" ^
486487

487-
-D CMAKE_INSTALL_PREFIX=%BuildRoot%\Library\Developer\Platforms\Windows.platform\Developer\SDKs\Windows.sdk\usr ^
488+
-D CMAKE_INSTALL_PREFIX=%InstallRoot% ^
488489

489490
-G Ninja ^
490491
-S %SourceRoot%\swift-collections || (exit /b)
@@ -505,7 +506,7 @@ cmake ^
505506
-D CMAKE_EXE_LINKER_FLAGS="/INCREMENTAL:NO" ^
506507
-D CMAKE_SHARED_LINKER_FLAGS="/INCREMENTAL:NO" ^
507508

508-
-D CMAKE_INSTALL_PREFIX=%BuildRoot%\Library\Developer\Platforms\Windows.platform\Developer\SDKs\Windows.sdk\usr ^
509+
-D CMAKE_INSTALL_PREFIX=%InstallRoot% ^
509510

510511
-D dispatch_DIR=%BuildRoot%\3\cmake\modules ^
511512
-D Foundation_DIR=%BuildRoot%\4\cmake\modules ^
@@ -537,7 +538,7 @@ cmake ^
537538
-D CMAKE_EXE_LINKER_FLAGS="/INCREMENTAL:NO" ^
538539
-D CMAKE_SHARED_LINKER_FLAGS="/INCREMENTAL:NO" ^
539540

540-
-D CMAKE_INSTALL_PREFIX=%BuildRoot%\Library\Developer\Platforms\Windows.platform\Developer\SDKs\Windows.sdk\usr ^
541+
-D CMAKE_INSTALL_PREFIX=%InstallRoot% ^
541542

542543
-D dispatch_DIR=%BuildRoot%\3\cmake\modules ^
543544
-D Foundation_DIR=%BuildRoot%\4\cmake\modules ^
@@ -562,7 +563,7 @@ cmake ^
562563
-D CMAKE_EXE_LINKER_FLAGS="/INCREMENTAL:NO" ^
563564
-D CMAKE_SHARED_LINKER_FLAGS="/INCREMENTAL:NO" ^
564565

565-
-D CMAKE_INSTALL_PREFIX=%BuildRoot%\Library\Developer\Platforms\Windows.platform\Developer\SDKs\Windows.sdk\usr ^
566+
-D CMAKE_INSTALL_PREFIX=%InstallRoot% ^
566567

567568
-D dispatch_DIR=%BuildRoot%\3\cmake\modules ^
568569
-D Foundation_DIR=%BuildRoot%\4\cmake\modules ^
@@ -580,9 +581,9 @@ cmake --build %BuildRoot%\15 || (exit /b)
580581
cmake --build %BuildRoot%\15 --target install || (exit /b)
581582

582583
:: Create Configuration Files
583-
python -c "import plistlib; print(str(plistlib.dumps({ 'DefaultProperties': { 'DEFAULT_USE_RUNTIME': 'MD' } }), encoding='utf-8'))" > %BuildRoot%\Library\Developer\Platforms\Windows.platform\Developer\SDKs\Windows.sdk\SDKSettings.plist
584+
python -c "import plistlib; print(str(plistlib.dumps({ 'DefaultProperties': { 'DEFAULT_USE_RUNTIME': 'MD' } }), encoding='utf-8'))" > %SDKInstallRoot%\SDKSettings.plist
584585
:: TODO(compnerd) match the XCTest installation name
585-
python -c "import plistlib; print(str(plistlib.dumps({ 'DefaultProperties': { 'XCTEST_VERSION': 'development' } }), encoding='utf-8'))" > %BuildRoot%\Library\Developer\Platforms\Windows.platform\Info.plist
586+
python -c "import plistlib; print(str(plistlib.dumps({ 'DefaultProperties': { 'XCTEST_VERSION': 'development' } }), encoding='utf-8'))" > %PlatformRoot%\Info.plist
586587

587588
:: Clean up the module cache
588589
rd /s /q %LocalAppData%\clang\ModuleCache

0 commit comments

Comments
 (0)