@@ -619,6 +619,7 @@ enum Project {
619619 SourceKitLSP
620620 SymbolKit
621621 DocC
622+ brotli
622623
623624 LLVM
624625 Runtime
@@ -1996,6 +1997,26 @@ 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+ - BuildTargets default `
2010+ - Defines @ {
2011+ BUILD_SHARED_LIBS = " NO" ;
2012+ CMAKE_POSITION_INDEPENDENT_CODE = " YES" ;
2013+ CMAKE_SYSTEM_NAME = $Platform.OS.ToString ();
2014+ CMAKE_INSTALL_BINDIR = " $LibraryRoot \brotli\usr\bin\$ ( $Platform.OS.ToString ()) \$ArchName " ;
2015+ CMAKE_INSTALL_LIBDIR = " $LibraryRoot \brotli\usr\lib\$ ( $Platform.OS.ToString ()) \$ArchName " ;
2016+ }
2017+ }
2018+
2019+
19992020function Build-ZLib ([Hashtable ] $Platform ) {
20002021 $ArchName = $Platform.Architecture.LLVMName
20012022
@@ -2095,7 +2116,7 @@ function Build-CURL([Hashtable] $Platform) {
20952116 CURL_CA_BUNDLE = " none" ;
20962117 CURL_CA_FALLBACK = " NO" ;
20972118 CURL_CA_PATH = " none" ;
2098- CURL_BROTLI = " NO " ;
2119+ CURL_BROTLI = " YES " ;
20992120 CURL_DISABLE_ALTSVC = " NO" ;
21002121 CURL_DISABLE_AWS = " YES" ;
21012122 CURL_DISABLE_BASIC_AUTH = " NO" ;
@@ -2173,6 +2194,17 @@ function Build-CURL([Hashtable] $Platform) {
21732194 USE_WIN32_LDAP = " NO" ;
21742195 ZLIB_ROOT = " $LibraryRoot \zlib-1.3.1\usr" ;
21752196 ZLIB_LIBRARY = " $LibraryRoot \zlib-1.3.1\usr\lib\$ ( $Platform.OS.ToString ()) \$ArchName \zlibstatic.lib" ;
2197+ BROTLI_INCLUDE_DIR = " $LibraryRoot \brotli\usr\include" ;
2198+ BROTLIDEC_LIBRARY = if ($Platform.OS -eq [OS ]::Windows) {
2199+ " $LibraryRoot \brotli\usr\lib\$ ( $Platform.OS.ToString ()) \$ArchName \brotlidec.lib"
2200+ } else {
2201+ " $LibraryRoot \brotli\usr\lib\$ ( $Platform.OS.ToString ()) \$ArchName \brotlidec.a"
2202+ };
2203+ BROTLICOMMON_LIBRARY = if ($Platform.OS -eq [OS ]::Windows) {
2204+ " $LibraryRoot \brotli\usr\lib\$ ( $Platform.OS.ToString ()) \$ArchName \brotlicommon.lib"
2205+ } else {
2206+ " $LibraryRoot \brotli\usr\lib\$ ( $Platform.OS.ToString ()) \$ArchName \brotlicommon.a"
2207+ };
21762208 })
21772209}
21782210
@@ -2404,6 +2436,17 @@ function Build-Foundation {
24042436 " $LibraryRoot \zlib-1.3.1\usr\lib\$ ( $Platform.OS.ToString ()) \$ ( $Platform.Architecture.LLVMName ) \libz.a"
24052437 };
24062438 ZLIB_INCLUDE_DIR = " $LibraryRoot \zlib-1.3.1\usr\include" ;
2439+ BROTLIDEC_LIBRARY = if ($Platform.OS -eq [OS ]::Windows) {
2440+ " $LibraryRoot \brotli\usr\lib\$ ( $Platform.OS.ToString ()) \$ ( $Platform.Architecture.LLVMName ) \brotlidec.lib"
2441+ } else {
2442+ " $LibraryRoot \brotli\usr\lib64\$ ( $Platform.OS.ToString ()) \$ ( $Platform.Architecture.LLVMName ) \brotlidec.a"
2443+ };
2444+ BROTLICOMMON_LIBRARY = if ($Platform.OS -eq [OS ]::Windows) {
2445+ " $LibraryRoot \brotli\usr\lib\$ ( $Platform.OS.ToString ()) \$ ( $Platform.Architecture.LLVMName ) \brotlicommon.lib"
2446+ } else {
2447+ " $LibraryRoot \brotli\usr\lib64\$ ( $Platform.OS.ToString ()) \$ ( $Platform.Architecture.LLVMName ) \brotlicommon.a"
2448+ };
2449+ BROTLI_INCLUDE_DIR = " $LibraryRoot \brotli\usr\include" ;
24072450 dispatch_DIR = (Get-ProjectCMakeModules $Platform Dispatch);
24082451 SwiftSyntax_DIR = (Get-ProjectBinaryCache $HostPlatform Compilers);
24092452 _SwiftFoundation_SourceDIR = " $SourceCache \swift-foundation" ;
@@ -2426,6 +2469,7 @@ function Test-Foundation {
24262469 $env: LIBXML_LIBRARY_PATH = " $LibraryRoot /libxml2-2.11.5/usr/lib/windows/$ ( $BuildPlatform.Architecture.LLVMName ) "
24272470 $env: LIBXML_INCLUDE_PATH = " $LibraryRoot /libxml2-2.11.5/usr/include/libxml2"
24282471 $env: ZLIB_LIBRARY_PATH = " $LibraryRoot /zlib-1.3.1/usr/lib/windows/$ ( $BuildPlatform.Architecture.LLVMName ) "
2472+ $env: BROTLI_LIBRARY_PATH = " $LibraryRoot /brotli/usr/lib/windows/$ ( $BuildPlatform.Architecture.LLVMName ) "
24292473 $env: CURL_LIBRARY_PATH = " $LibraryRoot /curl-8.9.1/usr/lib/windows/$ ( $BuildPlatform.Architecture.LLVMName ) "
24302474 $env: CURL_INCLUDE_PATH = " $LibraryRoot /curl-8.9.1/usr/include"
24312475 Build-SPMProject `
@@ -2566,6 +2610,7 @@ function Build-SDK([Hashtable] $Platform, [switch] $IncludeMacros = $false) {
25662610
25672611 # Third Party Dependencies
25682612 Invoke-BuildStep Build-ZLib $Platform
2613+ Invoke-BuildStep Build-Brotli $Platform
25692614 Invoke-BuildStep Build-XML2 $Platform
25702615 Invoke-BuildStep Build-CURL $Platform
25712616 Invoke-BuildStep Build-LLVM $Platform
0 commit comments