Skip to content

build: correct installation locations #38812

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 10, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 18 additions & 17 deletions utils/build-windows-toolchain.bat
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ set BuildRoot=T:

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

:: Setup temporary directories
md %BuildRoot%\tmp
Expand Down Expand Up @@ -213,7 +215,7 @@ cmake ^
-D CMAKE_EXE_LINKER_FLAGS="/INCREMENTAL:NO" ^
-D CMAKE_SHARED_LINKER_FLAGS="/INCREMENTAL:NO" ^

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

-D LLVM_DIR=%BuildRoot%\1\lib\cmake\llvm ^
-D SWIFT_NATIVE_SWIFT_TOOLS_PATH=%BuildRoot%\1\bin ^
Expand Down Expand Up @@ -246,7 +248,7 @@ cmake ^
-D CMAKE_EXE_LINKER_FLAGS="/INCREMENTAL:NO" ^
-D CMAKE_SHARED_LINKER_FLAGS="/INCREMENTAL:NO" ^

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

-D ENABLE_SWIFT=YES ^

Expand All @@ -269,7 +271,7 @@ cmake ^
-D CMAKE_EXE_LINKER_FLAGS="/INCREMENTAL:NO" ^
-D CMAKE_SHARED_LINKER_FLAGS="/INCREMENTAL:NO" ^

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

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

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

Expand All @@ -302,7 +303,7 @@ cmake ^
-D CMAKE_EXE_LINKER_FLAGS="/INCREMENTAL:NO" ^
-D CMAKE_SHARED_LINKER_FLAGS="/INCREMENTAL:NO" ^

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

-D dispatch_DIR=%BuildRoot%\3\cmake\modules ^
-D Foundation_DIR=%BuildRoot%\4\cmake\modules ^
Expand All @@ -326,7 +327,7 @@ cmake ^
-D CMAKE_EXE_LINKER_FLAGS="/INCREMENTAL:NO" ^
-D CMAKE_SHARED_LINKER_FLAGS="/INCREMENTAL:NO" ^

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

-D dispatch_DIR=%BuildRoot%\3\cmake\modules ^
-D Foundation_DIR=%BuildRoot%\4\cmake\modules ^
Expand All @@ -352,7 +353,7 @@ cmake ^
-D CMAKE_EXE_LINKER_FLAGS="/INCREMENTAL:NO" ^
-D CMAKE_SHARED_LINKER_FLAGS="/INCREMENTAL:NO" ^

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

-D LLBUILD_SUPPORT_BINDINGS=Swift ^

Expand Down Expand Up @@ -380,7 +381,7 @@ cmake ^
-D CMAKE_EXE_LINKER_FLAGS="/INCREMENTAL:NO" ^
-D CMAKE_SHARED_LINKER_FLAGS="/INCREMENTAL:NO" ^

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

-D dispatch_DIR=%BuildRoot%\3\cmake\modules ^
-D Foundation_DIR=%BuildRoot%\4\cmake\modules ^
Expand All @@ -406,7 +407,7 @@ cmake ^
-D CMAKE_EXE_LINKER_FLAGS="/INCREMENTAL:NO" ^
-D CMAKE_SHARED_LINKER_FLAGS="/INCREMENTAL:NO" ^

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

-D dispatch_DIR=%BuildRoot%\3\cmake\modules ^
-D Foundation_DIR=%BuildRoot%\4\cmake\modules ^
Expand All @@ -431,7 +432,7 @@ cmake ^
-D CMAKE_EXE_LINKER_FLAGS="/INCREMENTAL:NO" ^
-D CMAKE_SHARED_LINKER_FLAGS="/INCREMENTAL:NO" ^

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

-D dispatch_DIR=%BuildRoot%\3\cmake\modules ^
-D Foundation_DIR=%BuildRoot%\4\cmake\modules ^
Expand Down Expand Up @@ -460,7 +461,7 @@ cmake ^
-D CMAKE_EXE_LINKER_FLAGS="/INCREMENTAL:NO" ^
-D CMAKE_SHARED_LINKER_FLAGS="/INCREMENTAL:NO" ^

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

-D dispatch_DIR=%BuildRoot%\3\cmake\modules ^
-D Foundation_DIR=%BuildRoot%\4\cmake\modules ^
Expand All @@ -484,7 +485,7 @@ cmake ^
-D CMAKE_EXE_LINKER_FLAGS="/INCREMENTAL:NO" ^
-D CMAKE_SHARED_LINKER_FLAGS="/INCREMENTAL:NO" ^

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

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

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

-D dispatch_DIR=%BuildRoot%\3\cmake\modules ^
-D Foundation_DIR=%BuildRoot%\4\cmake\modules ^
Expand Down Expand Up @@ -537,7 +538,7 @@ cmake ^
-D CMAKE_EXE_LINKER_FLAGS="/INCREMENTAL:NO" ^
-D CMAKE_SHARED_LINKER_FLAGS="/INCREMENTAL:NO" ^

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

-D dispatch_DIR=%BuildRoot%\3\cmake\modules ^
-D Foundation_DIR=%BuildRoot%\4\cmake\modules ^
Expand All @@ -562,7 +563,7 @@ cmake ^
-D CMAKE_EXE_LINKER_FLAGS="/INCREMENTAL:NO" ^
-D CMAKE_SHARED_LINKER_FLAGS="/INCREMENTAL:NO" ^

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

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

:: Create Configuration Files
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
python -c "import plistlib; print(str(plistlib.dumps({ 'DefaultProperties': { 'DEFAULT_USE_RUNTIME': 'MD' } }), encoding='utf-8'))" > %SDKInstallRoot%\SDKSettings.plist
:: TODO(compnerd) match the XCTest installation name
python -c "import plistlib; print(str(plistlib.dumps({ 'DefaultProperties': { 'XCTEST_VERSION': 'development' } }), encoding='utf-8'))" > %BuildRoot%\Library\Developer\Platforms\Windows.platform\Info.plist
python -c "import plistlib; print(str(plistlib.dumps({ 'DefaultProperties': { 'XCTEST_VERSION': 'development' } }), encoding='utf-8'))" > %PlatformRoot%\Info.plist

:: Clean up the module cache
rd /s /q %LocalAppData%\clang\ModuleCache
Expand Down