Skip to content
Draft
Show file tree
Hide file tree
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
34 changes: 33 additions & 1 deletion utils/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -619,6 +619,7 @@ enum Project {
SourceKitLSP
SymbolKit
DocC
brotli

LLVM
Runtime
Expand Down Expand Up @@ -1996,6 +1997,21 @@ function Build-Sanitizers([Hashtable] $Platform) {
})
}

function Build-Brotli([Hashtable] $Platform) {
Build-CMakeProject `
-Src $SourceCache\brotli `
-Bin "$(Get-ProjectBinaryCache $Platform brotli)" `
-InstallTo "$LibraryRoot\brotli\usr" `
-Platform $Platform `
-UseMSVCCompilers C `
-Defines @{
BUILD_SHARED_LIBS = "NO";
CMAKE_POSITION_INDEPENDENT_CODE = "YES";
CMAKE_SYSTEM_NAME = $Platform.OS.ToString();
}
}


function Build-ZLib([Hashtable] $Platform) {
$ArchName = $Platform.Architecture.LLVMName

Expand Down Expand Up @@ -2095,7 +2111,7 @@ function Build-CURL([Hashtable] $Platform) {
CURL_CA_BUNDLE = "none";
CURL_CA_FALLBACK = "NO";
CURL_CA_PATH = "none";
CURL_BROTLI = "NO";
CURL_BROTLI = "YES";
CURL_DISABLE_ALTSVC = "NO";
CURL_DISABLE_AWS = "YES";
CURL_DISABLE_BASIC_AUTH = "NO";
Expand Down Expand Up @@ -2173,6 +2189,9 @@ function Build-CURL([Hashtable] $Platform) {
USE_WIN32_LDAP = "NO";
ZLIB_ROOT = "$LibraryRoot\zlib-1.3.1\usr";
ZLIB_LIBRARY = "$LibraryRoot\zlib-1.3.1\usr\lib\$($Platform.OS.ToString())\$ArchName\zlibstatic.lib";
BROTLI_INCLUDE_DIR = "$LibraryRoot\brotli\usr\include";
BROTLIDEC_LIBRARY = "$LibraryRoot\brotli\usr\lib\brotlidec.lib";
BROTLICOMMON_LIBRARY = "$LibraryRoot\brotli\usr\lib\brotlicommon.lib";
})
}

Expand Down Expand Up @@ -2404,6 +2423,17 @@ function Build-Foundation {
"$LibraryRoot\zlib-1.3.1\usr\lib\$($Platform.OS.ToString())\$($Platform.Architecture.LLVMName)\libz.a"
};
ZLIB_INCLUDE_DIR = "$LibraryRoot\zlib-1.3.1\usr\include";
BROTLIDEC_LIBRARY = if ($Platform.OS -eq [OS]::Windows) {
"$LibraryRoot\brotli\usr\lib\brotlidec.lib"
} else {
"$LibraryRoot\brotli\usr\lib64\brotlidec.a"
};
BROTLICOMMON_LIBRARY = if ($Platform.OS -eq [OS]::Windows) {
"$LibraryRoot\brotli\usr\lib\brotlicommon.lib"
}else {
"$LibraryRoot\brotli\usr\lib64\brotlicommon.a"
};
BROTLI_INCLUDE_DIR = "$LibraryRoot\brotli\usr\include";
dispatch_DIR = (Get-ProjectCMakeModules $Platform Dispatch);
SwiftSyntax_DIR = (Get-ProjectBinaryCache $HostPlatform Compilers);
_SwiftFoundation_SourceDIR = "$SourceCache\swift-foundation";
Expand All @@ -2426,6 +2456,7 @@ function Test-Foundation {
$env:LIBXML_LIBRARY_PATH="$LibraryRoot/libxml2-2.11.5/usr/lib/windows/$($BuildPlatform.Architecture.LLVMName)"
$env:LIBXML_INCLUDE_PATH="$LibraryRoot/libxml2-2.11.5/usr/include/libxml2"
$env:ZLIB_LIBRARY_PATH="$LibraryRoot/zlib-1.3.1/usr/lib/windows/$($BuildPlatform.Architecture.LLVMName)"
$env:BROTLI_LIBRARY_PATH="$LibraryRoot/brotli/usr/lib"
$env:CURL_LIBRARY_PATH="$LibraryRoot/curl-8.9.1/usr/lib/windows/$($BuildPlatform.Architecture.LLVMName)"
$env:CURL_INCLUDE_PATH="$LibraryRoot/curl-8.9.1/usr/include"
Build-SPMProject `
Expand Down Expand Up @@ -2566,6 +2597,7 @@ function Build-SDK([Hashtable] $Platform, [switch] $IncludeMacros = $false) {

# Third Party Dependencies
Invoke-BuildStep Build-ZLib $Platform
Invoke-BuildStep Build-Brotli $Platform
Invoke-BuildStep Build-XML2 $Platform
Invoke-BuildStep Build-CURL $Platform
Invoke-BuildStep Build-LLVM $Platform
Expand Down
13 changes: 10 additions & 3 deletions utils/update_checkout/update-checkout-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,9 @@
"zlib": {
"remote": { "id": "madler/zlib" }
},
"brotli": {
"remote": { "id": "google/brotli" }
},
"mimalloc": {
"remote": { "id": "microsoft/mimalloc" },
"platforms": [ "Windows" ]
Expand Down Expand Up @@ -177,7 +180,8 @@
"curl": "curl-8_9_1",
"libxml2": "v2.11.5",
"zlib": "v1.3.1",
"mimalloc": "v3.0.1"
"mimalloc": "v3.0.1",
"brotli": "v1.1.0"
}
},
"release/6.2": {
Expand Down Expand Up @@ -232,6 +236,7 @@
"curl": "curl-8_9_1",
"libxml2": "v2.11.5",
"zlib": "v1.3.1",
"brotli": "v1.1.0",
"mimalloc": "v3.0.1"
}
},
Expand Down Expand Up @@ -441,7 +446,8 @@
"curl": "curl-8_9_1",
"libxml2": "v2.11.5",
"zlib": "v1.3.1",
"mimalloc": "v3.0.1"
"mimalloc": "v3.0.1",
"brotli": "v1.1.0"
}
},
"next" : {
Expand Down Expand Up @@ -491,7 +497,8 @@
"curl": "curl-8_9_1",
"libxml2": "v2.11.5",
"zlib": "v1.3.1",
"mimalloc": "v3.0.1"
"mimalloc": "v3.0.1",
"brotli": "v1.1.0"
}
}
}
Expand Down