@@ -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,25 @@ function Build-Sanitizers([Hashtable] $Platform) {
1996
1997
})
1997
1998
}
1998
1999
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
+
1999
2019
function Build-ZLib ([Hashtable ] $Platform ) {
2000
2020
$ArchName = $Platform.Architecture.LLVMName
2001
2021
@@ -2095,7 +2115,7 @@ function Build-CURL([Hashtable] $Platform) {
2095
2115
CURL_CA_BUNDLE = " none" ;
2096
2116
CURL_CA_FALLBACK = " NO" ;
2097
2117
CURL_CA_PATH = " none" ;
2098
- CURL_BROTLI = " NO " ;
2118
+ CURL_BROTLI = " YES " ;
2099
2119
CURL_DISABLE_ALTSVC = " NO" ;
2100
2120
CURL_DISABLE_AWS = " YES" ;
2101
2121
CURL_DISABLE_BASIC_AUTH = " NO" ;
@@ -2173,6 +2193,9 @@ function Build-CURL([Hashtable] $Platform) {
2173
2193
USE_WIN32_LDAP = " NO" ;
2174
2194
ZLIB_ROOT = " $LibraryRoot \zlib-1.3.1\usr" ;
2175
2195
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" ;
2176
2199
})
2177
2200
}
2178
2201
@@ -2404,6 +2427,17 @@ function Build-Foundation {
2404
2427
" $LibraryRoot \zlib-1.3.1\usr\lib\$ ( $Platform.OS.ToString ()) \$ ( $Platform.Architecture.LLVMName ) \libz.a"
2405
2428
};
2406
2429
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" ;
2407
2441
dispatch_DIR = (Get-ProjectCMakeModules $Platform Dispatch);
2408
2442
SwiftSyntax_DIR = (Get-ProjectBinaryCache $HostPlatform Compilers);
2409
2443
_SwiftFoundation_SourceDIR = " $SourceCache \swift-foundation" ;
@@ -2426,6 +2460,7 @@ function Test-Foundation {
2426
2460
$env: LIBXML_LIBRARY_PATH = " $LibraryRoot /libxml2-2.11.5/usr/lib/windows/$ ( $BuildPlatform.Architecture.LLVMName ) "
2427
2461
$env: LIBXML_INCLUDE_PATH = " $LibraryRoot /libxml2-2.11.5/usr/include/libxml2"
2428
2462
$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 ) "
2429
2464
$env: CURL_LIBRARY_PATH = " $LibraryRoot /curl-8.9.1/usr/lib/windows/$ ( $BuildPlatform.Architecture.LLVMName ) "
2430
2465
$env: CURL_INCLUDE_PATH = " $LibraryRoot /curl-8.9.1/usr/include"
2431
2466
Build-SPMProject `
@@ -2566,6 +2601,7 @@ function Build-SDK([Hashtable] $Platform, [switch] $IncludeMacros = $false) {
2566
2601
2567
2602
# Third Party Dependencies
2568
2603
Invoke-BuildStep Build-ZLib $Platform
2604
+ Invoke-BuildStep Build-Brotli $Platform
2569
2605
Invoke-BuildStep Build-XML2 $Platform
2570
2606
Invoke-BuildStep Build-CURL $Platform
2571
2607
Invoke-BuildStep Build-LLVM $Platform
0 commit comments