@@ -619,6 +619,7 @@ enum Project {
619619 SourceKitLSP
620620 SymbolKit
621621 DocC
622+ brotli
622623
623624 LLVM
624625 Runtime
@@ -1996,6 +1997,25 @@ function Build-Sanitizers([Hashtable] $Platform) {
19961997 })
19971998}
19981999
2000+ function Build-Brotli ([Hashtable ] $Platform ) {
2001+ $ArchName = $Platform.Architecture.LLVMName
2002+
2003+ Build-CMakeProject `
2004+ - Src $SourceCache \brotli `
2005+ - Bin " $ ( Get-ProjectBinaryCache $Platform brotli) " `
2006+ - InstallTo " $LibraryRoot \brotli\usr" `
2007+ - Platform $Platform `
2008+ - UseMSVCCompilers C `
2009+ - Defines @ {
2010+ BUILD_SHARED_LIBS = " NO" ;
2011+ CMAKE_POSITION_INDEPENDENT_CODE = " YES" ;
2012+ CMAKE_SYSTEM_NAME = $Platform.OS.ToString ();
2013+ CMAKE_INSTALL_BINDIR = " $LibraryRoot \brotli\usr\bin\$ ( $Platform.OS.ToString ()) \$ArchName " ;
2014+ CMAKE_INSTALL_LIBDIR = " $LibraryRoot \brotli\usr\lib\$ ( $Platform.OS.ToString ()) \$ArchName " ;
2015+ }
2016+ }
2017+
2018+
19992019function Build-ZLib ([Hashtable ] $Platform ) {
20002020 $ArchName = $Platform.Architecture.LLVMName
20012021
@@ -2095,7 +2115,7 @@ function Build-CURL([Hashtable] $Platform) {
20952115 CURL_CA_BUNDLE = " none" ;
20962116 CURL_CA_FALLBACK = " NO" ;
20972117 CURL_CA_PATH = " none" ;
2098- CURL_BROTLI = " NO " ;
2118+ CURL_BROTLI = " YES " ;
20992119 CURL_DISABLE_ALTSVC = " NO" ;
21002120 CURL_DISABLE_AWS = " YES" ;
21012121 CURL_DISABLE_BASIC_AUTH = " NO" ;
@@ -2173,6 +2193,9 @@ function Build-CURL([Hashtable] $Platform) {
21732193 USE_WIN32_LDAP = " NO" ;
21742194 ZLIB_ROOT = " $LibraryRoot \zlib-1.3.1\usr" ;
21752195 ZLIB_LIBRARY = " $LibraryRoot \zlib-1.3.1\usr\lib\$ ( $Platform.OS.ToString ()) \$ArchName \zlibstatic.lib" ;
2196+ BROTLI_INCLUDE_DIR = " $LibraryRoot \brotli\usr\include" ;
2197+ BROTLIDEC_LIBRARY = " $LibraryRoot \brotli\usr\lib\$ ( $Platform.OS.ToString ()) \$ArchName \brotlidec.lib" ;
2198+ BROTLICOMMON_LIBRARY = " $LibraryRoot \brotli\usr\lib\$ ( $Platform.OS.ToString ()) \$ArchName \brotlicommon.lib" ;
21762199 })
21772200}
21782201
@@ -2404,6 +2427,17 @@ function Build-Foundation {
24042427 " $LibraryRoot \zlib-1.3.1\usr\lib\$ ( $Platform.OS.ToString ()) \$ ( $Platform.Architecture.LLVMName ) \libz.a"
24052428 };
24062429 ZLIB_INCLUDE_DIR = " $LibraryRoot \zlib-1.3.1\usr\include" ;
2430+ BROTLIDEC_LIBRARY = if ($Platform.OS -eq [OS ]::Windows) {
2431+ " $LibraryRoot \brotli\usr\lib\$ ( $Platform.OS.ToString ()) \$ ( $Platform.Architecture.LLVMName ) \brotlidec.lib"
2432+ } else {
2433+ " $LibraryRoot \brotli\usr\lib64\$ ( $Platform.OS.ToString ()) \$ ( $Platform.Architecture.LLVMName ) \brotlidec.a"
2434+ };
2435+ BROTLICOMMON_LIBRARY = if ($Platform.OS -eq [OS ]::Windows) {
2436+ " $LibraryRoot \brotli\usr\lib\$ ( $Platform.OS.ToString ()) \$ ( $Platform.Architecture.LLVMName ) \brotlicommon.lib"
2437+ } else {
2438+ " $LibraryRoot \brotli\usr\lib64\$ ( $Platform.OS.ToString ()) \$ ( $Platform.Architecture.LLVMName ) \brotlicommon.a"
2439+ };
2440+ BROTLI_INCLUDE_DIR = " $LibraryRoot \brotli\usr\include" ;
24072441 dispatch_DIR = (Get-ProjectCMakeModules $Platform Dispatch);
24082442 SwiftSyntax_DIR = (Get-ProjectBinaryCache $HostPlatform Compilers);
24092443 _SwiftFoundation_SourceDIR = " $SourceCache \swift-foundation" ;
@@ -2426,6 +2460,7 @@ function Test-Foundation {
24262460 $env: LIBXML_LIBRARY_PATH = " $LibraryRoot /libxml2-2.11.5/usr/lib/windows/$ ( $BuildPlatform.Architecture.LLVMName ) "
24272461 $env: LIBXML_INCLUDE_PATH = " $LibraryRoot /libxml2-2.11.5/usr/include/libxml2"
24282462 $env: ZLIB_LIBRARY_PATH = " $LibraryRoot /zlib-1.3.1/usr/lib/windows/$ ( $BuildPlatform.Architecture.LLVMName ) "
2463+ $env: BROTLI_LIBRARY_PATH = " $LibraryRoot /brotli/usr/lib/windows/$ ( $BuildPlatform.Architecture.LLVMName ) "
24292464 $env: CURL_LIBRARY_PATH = " $LibraryRoot /curl-8.9.1/usr/lib/windows/$ ( $BuildPlatform.Architecture.LLVMName ) "
24302465 $env: CURL_INCLUDE_PATH = " $LibraryRoot /curl-8.9.1/usr/include"
24312466 Build-SPMProject `
@@ -2566,6 +2601,7 @@ function Build-SDK([Hashtable] $Platform, [switch] $IncludeMacros = $false) {
25662601
25672602 # Third Party Dependencies
25682603 Invoke-BuildStep Build-ZLib $Platform
2604+ Invoke-BuildStep Build-Brotli $Platform
25692605 Invoke-BuildStep Build-XML2 $Platform
25702606 Invoke-BuildStep Build-CURL $Platform
25712607 Invoke-BuildStep Build-LLVM $Platform
0 commit comments