@@ -37,6 +37,18 @@ function(_foundation_setup_windows_swiftpm_dependencies_target)
37
37
EXCLUDE_FROM_ALL YES
38
38
)
39
39
40
+ ExternalProject_Add (brotli
41
+ GIT_REPOSITORY https://github.com/google/brotli
42
+ GIT_TAG v1.1.0
43
+ CMAKE_ARGS
44
+ -DCMAKE_INSTALL_PREFIX=${DEST_DIR}/brotli
45
+ -DCMAKE_C_COMPILER=cl
46
+ -DBUILD_SHARED_LIBS=NO
47
+ -DCMAKE_POSITION_INDEPENDENT_CODE=YES
48
+ -DCMAKE_BUILD_TYPE=Release
49
+ EXCLUDE_FROM_ALL YES
50
+ )
51
+
40
52
ExternalProject_Add (libxml
41
53
GIT_REPOSITORY https://github.com/gnome/libxml2.git
42
54
GIT_TAG v2.11.5
@@ -63,6 +75,15 @@ function(_foundation_setup_windows_swiftpm_dependencies_target)
63
75
# Add a custom target for zlib's install step that curl can depend on
64
76
ExternalProject_Add_StepTargets (zlib install )
65
77
78
+ set (BROTLI_ROOT "${DEST_DIR} /brotli" )
79
+ set (BROTLI_LIBRARY_DIR "${BROTLI_ROOT} /lib" )
80
+ set (BROTLI_INCLUDE_DIR "${BROTLI_ROOT} /include" )
81
+ set (BROTLICOMMON_LIBRARY_PATH "${BROTLI_LIBRARY_DIR} /brotlicommon.lib" )
82
+ set (BROTLIDEC_LIBRARY_PATH "${BROTLI_LIBRARY_DIR} /brotlidec.lib" )
83
+
84
+ # Add a custom target for brotli's install step that curl can depend on
85
+ ExternalProject_Add_StepTargets (brotli install )
86
+
66
87
ExternalProject_Add (curl
67
88
GIT_REPOSITORY https://github.com/curl/curl.git
68
89
GIT_TAG curl-8_9_1
@@ -75,7 +96,7 @@ function(_foundation_setup_windows_swiftpm_dependencies_target)
75
96
-DCURL_CA_BUNDLE=none
76
97
-DCURL_CA_FALLBACK=NO
77
98
-DCURL_CA_PATH=none
78
- -DCURL_BROTLI=NO
99
+ -DCURL_BROTLI=YES
79
100
-DCURL_DISABLE_ALTSVC=NO
80
101
-DCURL_DISABLE_AWS=YES
81
102
-DCURL_DISABLE_BASIC_AUTH=NO
@@ -150,7 +171,10 @@ function(_foundation_setup_windows_swiftpm_dependencies_target)
150
171
-DZLIB_ROOT=${ZLIB_ROOT}
151
172
-DZLIB_LIBRARY=${ZLIB_LIBRARY_PATH}
152
173
-DZLIB_INCLUDE_DIR=${ZLIB_INCLUDE_DIR}
153
- DEPENDS zlib-install
174
+ -DBROTLIDEC_LIBRARY=${BROTLIDEC_LIBRARY_PATH}
175
+ -DBROTLICOMMON_LIBRARY=${BROTLICOMMON_LIBRARY_PATH}
176
+ -DBROTLI_INCLUDE_DIR=${BROTLI_INCLUDE_DIR}
177
+ DEPENDS zlib-install brotli-install
154
178
EXCLUDE_FROM_ALL YES
155
179
)
156
180
@@ -166,6 +190,7 @@ function(_foundation_setup_windows_swiftpm_dependencies_target)
166
190
message (STATUS "CURL_INCLUDE_PATH=${CURL_INCLUDE_DIR} " )
167
191
message (STATUS "CURL_LIBRARY_PATH=${CURL_LIBRARY_DIR} " )
168
192
message (STATUS "ZLIB_LIBRARY_PATH=${ZLIB_LIBRARY_DIR} " )
193
+ message (STATUS "BROTLI_LIBRARY_PATH=${BROTLI_LIBRARY_DIR} " )
169
194
170
195
ExternalProject_Add_StepTargets (libxml install )
171
196
ExternalProject_Add_StepTargets (curl install )
@@ -186,5 +211,7 @@ function(_foundation_setup_windows_swiftpm_dependencies_target)
186
211
COMMAND echo CURL_LIBRARY_PATH=${CURL_LIBRARY_DIR} )
187
212
add_custom_command (TARGET WindowsSwiftPMDependencies POST_BUILD
188
213
COMMAND echo ZLIB_LIBRARY_PATH=${ZLIB_LIBRARY_DIR} )
214
+ add_custom_command (TARGET WindowsSwiftPMDependencies POST_BUILD
215
+ COMMAND echo BROTLI_LIBRARY_PATH=${BROTLI_LIBRARY_DIR} )
189
216
190
217
endfunction ()
0 commit comments