@@ -619,6 +619,7 @@ enum Project {
619
619
SourceKitLSP
620
620
SymbolKit
621
621
DocC
622
+ brotli
622
623
623
624
LLVM
624
625
Runtime
@@ -1996,6 +1997,21 @@ function Build-Sanitizers([Hashtable] $Platform) {
1996
1997
})
1997
1998
}
1998
1999
2000
+ function Build-Brotli ([Hashtable ] $Platform ) {
2001
+ Build-CMakeProject `
2002
+ - Src $SourceCache \brotli `
2003
+ - Bin " $ ( Get-ProjectBinaryCache $Platform brotli) " `
2004
+ - InstallTo " $LibraryRoot \brotli\usr" `
2005
+ - Platform $Platform `
2006
+ - UseMSVCCompilers C `
2007
+ - Defines @ {
2008
+ BUILD_SHARED_LIBS = " NO" ;
2009
+ CMAKE_POSITION_INDEPENDENT_CODE = " YES" ;
2010
+ CMAKE_SYSTEM_NAME = $Platform.OS.ToString ();
2011
+ }
2012
+ }
2013
+
2014
+
1999
2015
function Build-ZLib ([Hashtable ] $Platform ) {
2000
2016
$ArchName = $Platform.Architecture.LLVMName
2001
2017
@@ -2095,7 +2111,7 @@ function Build-CURL([Hashtable] $Platform) {
2095
2111
CURL_CA_BUNDLE = " none" ;
2096
2112
CURL_CA_FALLBACK = " NO" ;
2097
2113
CURL_CA_PATH = " none" ;
2098
- CURL_BROTLI = " NO " ;
2114
+ CURL_BROTLI = " YES " ;
2099
2115
CURL_DISABLE_ALTSVC = " NO" ;
2100
2116
CURL_DISABLE_AWS = " YES" ;
2101
2117
CURL_DISABLE_BASIC_AUTH = " NO" ;
@@ -2173,6 +2189,9 @@ function Build-CURL([Hashtable] $Platform) {
2173
2189
USE_WIN32_LDAP = " NO" ;
2174
2190
ZLIB_ROOT = " $LibraryRoot \zlib-1.3.1\usr" ;
2175
2191
ZLIB_LIBRARY = " $LibraryRoot \zlib-1.3.1\usr\lib\$ ( $Platform.OS.ToString ()) \$ArchName \zlibstatic.lib" ;
2192
+ DBROTLI_INCLUDE_DIR = " $LibraryRoot \brotli\usr\include" ;
2193
+ BROTLIDEC_LIBRARY = " $LibraryRoot \brotli\usr\lib\brotlidec.lib" ;
2194
+ BROTLICOMMON_LIBRARY = " $LibraryRoot \brotli\usr\lib\brotlicommon.lib" ;
2176
2195
})
2177
2196
}
2178
2197
@@ -2404,6 +2423,17 @@ function Build-Foundation {
2404
2423
" $LibraryRoot \zlib-1.3.1\usr\lib\$ ( $Platform.OS.ToString ()) \$ ( $Platform.Architecture.LLVMName ) \libz.a"
2405
2424
};
2406
2425
ZLIB_INCLUDE_DIR = " $LibraryRoot \zlib-1.3.1\usr\include" ;
2426
+ BROTLIDEC_LIBRARY = if ($Platform.OS -eq [OS ]::Windows) {
2427
+ " $LibraryRoot \brotli\usr\lib\brotlidec.lib"
2428
+ } else {
2429
+ " $LibraryRoot \brotli\usr\lib64\brotlidec.a"
2430
+ }
2431
+ BROTLICOMMON_LIBRARY = if ($Platform.OS -eq [OS ]::Windows) {
2432
+ " $LibraryRoot \brotli\usr\lib\brotlicommon.lib"
2433
+ }else {
2434
+ " $LibraryRoot \brotli\usr\lib64\brotlicommon.a"
2435
+ }
2436
+ DBROTLI_INCLUDE_DIR = " $LibraryRoot \brotli\usr\include" ;
2407
2437
dispatch_DIR = (Get-ProjectCMakeModules $Platform Dispatch);
2408
2438
SwiftSyntax_DIR = (Get-ProjectBinaryCache $HostPlatform Compilers);
2409
2439
_SwiftFoundation_SourceDIR = " $SourceCache \swift-foundation" ;
@@ -2426,6 +2456,7 @@ function Test-Foundation {
2426
2456
$env: LIBXML_LIBRARY_PATH = " $LibraryRoot /libxml2-2.11.5/usr/lib/windows/$ ( $BuildPlatform.Architecture.LLVMName ) "
2427
2457
$env: LIBXML_INCLUDE_PATH = " $LibraryRoot /libxml2-2.11.5/usr/include/libxml2"
2428
2458
$env: ZLIB_LIBRARY_PATH = " $LibraryRoot /zlib-1.3.1/usr/lib/windows/$ ( $BuildPlatform.Architecture.LLVMName ) "
2459
+ $env: BROTLI_LIBRARY_PATH = " $LibraryRoot /brotli/usr/lib"
2429
2460
$env: CURL_LIBRARY_PATH = " $LibraryRoot /curl-8.9.1/usr/lib/windows/$ ( $BuildPlatform.Architecture.LLVMName ) "
2430
2461
$env: CURL_INCLUDE_PATH = " $LibraryRoot /curl-8.9.1/usr/include"
2431
2462
Build-SPMProject `
@@ -2566,6 +2597,7 @@ function Build-SDK([Hashtable] $Platform, [switch] $IncludeMacros = $false) {
2566
2597
2567
2598
# Third Party Dependencies
2568
2599
Invoke-BuildStep Build-ZLib $Platform
2600
+ Invoke-BuildStep Build-Brotli $Platform
2569
2601
Invoke-BuildStep Build-XML2 $Platform
2570
2602
Invoke-BuildStep Build-CURL $Platform
2571
2603
Invoke-BuildStep Build-LLVM $Platform
0 commit comments