@@ -153,6 +153,26 @@ set(NGHTTP2_STATIC_LIB ${NGHTTP2_INSTALL_DIR}/lib/libnghttp2.a)
153153# Ensure zlib and openssl are built before nghttp2
154154add_dependencies (nghttp2_external ${OPENSSL_DEP} zlib_external)
155155
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+
156176# Install GDB if GDBMODE is set
157177set (GDB_VERSION 13.2)
158178set (GDB_URL https://ftp.gnu.org/gnu/gdb/gdb-${GDB_VERSION} .tar.gz)
@@ -214,6 +234,7 @@ set(CURL_CONFIGURE_COMMAND
214234 --with-zlib=${ZLIB_INSTALL_DIR}
215235 --with-nghttp2=${NGHTTP2_INSTALL_DIR}
216236 --with-zstd=${ZSTD_INSTALL_DIR}
237+ --with-libidn2=${LIBIDN2_INSTALL_DIR}
217238)
218239
219240set (CURL_POST_INSTALL_COMMAND
@@ -259,7 +280,12 @@ endif()
259280set (CURL_STATIC_LIB ${CURL_INSTALL_DIR} /lib/libcurl.a)
260281
261282# 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)
263289
264290# Now it's time for the main targets!
265291#
@@ -304,6 +330,7 @@ set(COMMON_LINK_LIBS
304330 ${OPENSSL_STATIC_LIB}
305331 ${ZLIB_STATIC_LIB}
306332 ${ZSTD_STATIC_LIB}
333+ ${LIBIDN2_STATIC_LIB}
307334 ${LIB_FUZZING_ENGINE}
308335 pthread
309336 m
0 commit comments