Skip to content

Commit bab4fba

Browse files
committed
build: prefer -InstallTo over custom CMake options
Re-use the existing `-InstallTo` option over the `CMAKE_INSTALL_PREFIX` CMake parameter for building the targets. This cleans up the options usage to use that mechanism. The intention is to minimise the custom parameters to CMake in favour of a standard option handling.
1 parent 74fbae1 commit bab4fba

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

utils/build.ps1

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -922,14 +922,14 @@ function Build-Compilers() {
922922
Build-CMakeProject `
923923
-Src $SourceCache\llvm-project\llvm `
924924
-Bin $BinaryCache\1 `
925+
-InstallTo "$($Arch.ToolchainInstallRoot)\usr" `
925926
-Arch $Arch `
926927
-UseMSVCCompilers C,CXX `
927928
-BuildTargets $Targets `
928929
-CacheScript $SourceCache\swift\cmake\caches\Windows-$($Arch.LLVMName).cmake `
929930
-Defines ($TestingDefines + @{
930931
CLANG_TABLEGEN = "$BinaryCache\0\bin\clang-tblgen.exe";
931932
CLANG_TIDY_CONFUSABLE_CHARS_GEN = "$BinaryCache\0\bin\clang-tidy-confusable-chars-gen.exe";
932-
CMAKE_INSTALL_PREFIX = "$($Arch.ToolchainInstallRoot)\usr";
933933
CMAKE_Swift_COMPILER = (Join-Path -Path (Get-PinnedToolchainTool) -ChildPath "swiftc.exe");
934934
CMAKE_Swift_FLAGS = @("-sdk", (Get-PinnedToolchainSDK));
935935
LLDB_PYTHON_EXE_RELATIVE_PATH = "python.exe";
@@ -1174,11 +1174,11 @@ function Build-Dispatch($Arch, [switch]$Test = $false) {
11741174
Build-CMakeProject `
11751175
-Src $SourceCache\swift-corelibs-libdispatch `
11761176
-Bin (Get-ProjectBinaryCache $Arch 2) `
1177+
-InstallTo "$($Arch.SDKInstallRoot)\usr" `
11771178
-Arch $Arch `
11781179
-UseBuiltCompilers C,CXX,Swift `
11791180
-BuildTargets $Targets `
11801181
-Defines @{
1181-
CMAKE_INSTALL_PREFIX = "$($Arch.SDKInstallRoot)\usr";
11821182
CMAKE_SYSTEM_NAME = "Windows";
11831183
CMAKE_SYSTEM_PROCESSOR = $Arch.CMakeName;
11841184
ENABLE_SWIFT = "YES";
@@ -1209,11 +1209,11 @@ function Build-Foundation($Arch, [switch]$Test = $false) {
12091209
Build-CMakeProject `
12101210
-Src $SourceCache\swift-corelibs-foundation `
12111211
-Bin $FoundationBinaryCache `
1212+
-InstallTo "$($Arch.SDKInstallRoot)\usr" `
12121213
-Arch $Arch `
12131214
-UseBuiltCompilers ASM,C,Swift `
12141215
-BuildTargets $Targets `
12151216
-Defines (@{
1216-
CMAKE_INSTALL_PREFIX = "$($Arch.SDKInstallRoot)\usr";
12171217
CMAKE_SYSTEM_NAME = "Windows";
12181218
CMAKE_SYSTEM_PROCESSOR = $Arch.CMakeName;
12191219
# Turn off safeseh for lld as it has safeseh enabled by default
@@ -1261,11 +1261,11 @@ function Build-XCTest($Arch, [switch]$Test = $false) {
12611261
Build-CMakeProject `
12621262
-Src $SourceCache\swift-corelibs-xctest `
12631263
-Bin $XCTestBinaryCache `
1264+
-InstallTo "$($Arch.XCTestInstallRoot)\usr" `
12641265
-Arch $Arch `
12651266
-UseBuiltCompilers Swift `
12661267
-BuildTargets $Targets `
12671268
-Defines (@{
1268-
CMAKE_INSTALL_PREFIX = "$($Arch.XCTestInstallRoot)\usr";
12691269
CMAKE_SYSTEM_NAME = "Windows";
12701270
CMAKE_SYSTEM_PROCESSOR = $Arch.CMakeName;
12711271
dispatch_DIR = "$DispatchBinaryCache\cmake\modules";
@@ -1432,13 +1432,13 @@ function Build-LLBuild($Arch, [switch]$Test = $false) {
14321432
Build-CMakeProject `
14331433
-Src $SourceCache\llbuild `
14341434
-Bin $BinaryCache\4 `
1435+
-InstallTo "$($Arch.ToolchainInstallRoot)\usr" `
14351436
-Arch $Arch `
14361437
-UseMSVCCompilers CXX `
14371438
-UseBuiltCompilers Swift `
14381439
-SwiftSDK $SDKInstallRoot `
14391440
-BuildTargets $Targets `
14401441
-Defines ($TestingDefines + @{
1441-
CMAKE_INSTALL_PREFIX = "$($Arch.ToolchainInstallRoot)\usr";
14421442
BUILD_SHARED_LIBS = "YES";
14431443
LLBUILD_SUPPORT_BINDINGS = "Swift";
14441444
SQLite3_INCLUDE_DIR = "$LibraryRoot\sqlite-3.43.2\usr\include";

0 commit comments

Comments
 (0)