@@ -153,6 +153,26 @@ set(NGHTTP2_STATIC_LIB ${NGHTTP2_INSTALL_DIR}/lib/libnghttp2.a)
153
153
# Ensure zlib and openssl are built before nghttp2
154
154
add_dependencies (nghttp2_external ${OPENSSL_DEP} zlib_external )
155
155
156
+ # Install libidn2
157
+ #
158
+ # renovate: datasource=github-tags depName=libidn/libidn2
159
+ set (LIBIDN2_VERSION 2.3.8 )
160
+ set (LIBIDN2_URL https://ftp.gnu.org/gnu/libidn/libidn2-${LIBIDN2_VERSION}.tar.gz )
161
+ set (LIBIDN2_INSTALL_DIR ${CMAKE_BINARY_DIR} /libidn2-install )
162
+
163
+ ExternalProject_Add (
164
+ libidn2_external
165
+ URL ${LIBIDN2_URL}
166
+ PREFIX ${CMAKE_BINARY_DIR} /libidn2
167
+ SOURCE_SUBDIR .
168
+ CONFIGURE_COMMAND ./configure --prefix=${LIBIDN2_INSTALL_DIR} --disable-shared --enable-static
169
+ BUILD_COMMAND $ (MAKE )
170
+ INSTALL_COMMAND $ (MAKE ) install
171
+ BUILD_IN_SOURCE 1
172
+ DOWNLOAD_EXTRACT_TIMESTAMP TRUE
173
+ )
174
+ set (LIBIDN2_STATIC_LIB ${LIBIDN2_INSTALL_DIR} /lib/libidn2.a )
175
+
156
176
# Install GDB if GDBMODE is set
157
177
set (GDB_VERSION 13.2 )
158
178
set (GDB_URL https://ftp.gnu.org/gnu/gdb/gdb-${GDB_VERSION}.tar.gz )
@@ -214,6 +234,7 @@ set(CURL_CONFIGURE_COMMAND
214
234
--with-zlib=${ZLIB_INSTALL_DIR}
215
235
--with-nghttp2=${NGHTTP2_INSTALL_DIR}
216
236
--with-zstd=${ZSTD_INSTALL_DIR}
237
+ --with-libidn2=${LIBIDN2_INSTALL_DIR}
217
238
)
218
239
219
240
set (CURL_POST_INSTALL_COMMAND
@@ -259,7 +280,12 @@ endif()
259
280
set (CURL_STATIC_LIB ${CURL_INSTALL_DIR} /lib/libcurl.a )
260
281
261
282
# Add dependencies for curl
262
- add_dependencies (curl_external nghttp2_external ${OPENSSL_DEP} zlib_external zstd_external )
283
+ add_dependencies (curl_external
284
+ nghttp2_external
285
+ ${OPENSSL_DEP}
286
+ zlib_external
287
+ zstd_external
288
+ libidn2_external )
263
289
264
290
# Now it's time for the main targets!
265
291
#
@@ -304,6 +330,7 @@ set(COMMON_LINK_LIBS
304
330
${OPENSSL_STATIC_LIB}
305
331
${ZLIB_STATIC_LIB}
306
332
${ZSTD_STATIC_LIB}
333
+ ${LIBIDN2_STATIC_LIB}
307
334
${LIB_FUZZING_ENGINE}
308
335
pthread
309
336
m
0 commit comments