Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

merge libcurl_vendor build instructions #81

Merged
merged 5 commits into from
Oct 19, 2022
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 14 additions & 45 deletions libcurl_vendor/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,64 +14,33 @@ if (POLICY CMP0135)
endif()

macro(build_libcurl)
set(extra_cxx_flags)

set(extra_c_flags)
if(NOT WIN32)
list(APPEND extra_cxx_flags "-std=c++14 -w")
list(APPEND extra_c_flags "-w")
endif()

set(PKGCONFIG_FOR_OPENSSL)
if(APPLE)
set(PKGCONFIG_FOR_OPENSSL "/usr/local/opt/openssl/lib/pkgconfig")
endif()

if(WIN32 AND NOT ${CMAKE_VERBOSE_MAKEFILE})
set(should_log ON) # prevent warnings in Windows CI
else()
set(should_log OFF)
endif()

include(ExternalProject)
if(WIN32)
ExternalProject_Add(curl-7.81.0
URL https://github.com/curl/curl/releases/download/curl-7_81_0/curl-7.81.0.tar.gz
URL_MD5 9e5e81fc7657eea8dc66672768082c46
LOG_CONFIGURE ${should_log}
LOG_BUILD ${should_log}
CMAKE_ARGS
-DENABLE_MANUAL=OFF
-DBUILD_TESTING=OFF
-DCMAKE_INSTALL_PREFIX=${CMAKE_CURRENT_BINARY_DIR}/libcurl_install
-Wno-dev
TIMEOUT 600
)
else()
ExternalProject_Add(curl-7.81.0
URL https://github.com/curl/curl/releases/download/curl-7_81_0/curl-7.81.0.tar.gz
URL_MD5 9e5e81fc7657eea8dc66672768082c46
CONFIGURE_COMMAND
<SOURCE_DIR>/configure
CFLAGS=${extra_c_flags}
CXXFLAGS=${extra_cxx_flags}
PKG_CONFIG_PATH=$PKG_CONFIG_PATH:${PKGCONFIG_FOR_OPENSSL}
--prefix=${CMAKE_CURRENT_BINARY_DIR}/libcurl_install
--with-ssl
--without-libgsasl
--without-libpsl
--without-libidn2
BUILD_COMMAND $(MAKE)
INSTALL_COMMAND $(MAKE) install
TIMEOUT 600
)
endif()

# The external project will install to the build folder, but we'll install that on make install.
install(
DIRECTORY
${CMAKE_CURRENT_BINARY_DIR}/libcurl_install/
DESTINATION
${CMAKE_INSTALL_PREFIX}/opt/libcurl_vendor
ExternalProject_Add(curl-7.81.0
URL https://github.com/curl/curl/releases/download/curl-7_81_0/curl-7.81.0.tar.gz
URL_MD5 9e5e81fc7657eea8dc66672768082c46
LOG_CONFIGURE ${should_log}
LOG_BUILD ${should_log}
CMAKE_ARGS
-DCMAKE_C_FLAGS=${extra_c_flags}
-DENABLE_MANUAL=OFF
-DBUILD_TESTING=OFF
-DCURL_ENABLE_SSL=ON # default, but just to make clear
-DUSE_LIBIDN2=OFF
-DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}
jasonbeach marked this conversation as resolved.
Show resolved Hide resolved
TIMEOUT 600
)
endmacro()

Expand Down