diff --git a/utils/build.ps1 b/utils/build.ps1 index 3cc001b99b4e6..3055615dcb7ec 100644 --- a/utils/build.ps1 +++ b/utils/build.ps1 @@ -619,6 +619,7 @@ enum Project { SourceKitLSP SymbolKit DocC + brotli LLVM Runtime @@ -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 @@ -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"; @@ -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"; }) } @@ -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"; @@ -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 ` @@ -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 diff --git a/utils/update_checkout/update-checkout-config.json b/utils/update_checkout/update-checkout-config.json index b28e89c2ae856..324f3ecd8f716 100644 --- a/utils/update_checkout/update-checkout-config.json +++ b/utils/update_checkout/update-checkout-config.json @@ -118,6 +118,9 @@ "zlib": { "remote": { "id": "madler/zlib" } }, + "brotli": { + "remote": { "id": "google/brotli" } + }, "mimalloc": { "remote": { "id": "microsoft/mimalloc" }, "platforms": [ "Windows" ] @@ -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": { @@ -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" } }, @@ -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" : { @@ -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" } } }