bullshit for windows and openssl with CPR

* windows static cross compile is wonky af so we add some hacks to make it work
pull/1576/head
Jeff Becker 3 years ago
parent ebdb9699c0
commit 3d87dbff91
No known key found for this signature in database
GPG Key ID: F357B3B42F6F9B05

@ -0,0 +1,21 @@
if(BUILD_STATIC_DEPS)
set(OPENSSL_ROOT_DIR ${CMAKE_BINARY_DIR}/static-deps)
set(OPENSSL_CRYPTO_LIBRARY ${OPENSSL_ROOT_DIR}/lib/libcrypto.a)
set(OPENSSL_INCLUDE_DIR ${OPENSSL_ROOT_DIR}/include)
else()
find_package(PkgConfig)
if (PKG_CONFIG_FOUND)
pkg_check_modules(PC_OPENSSL QUIET openssl)
set(OPENSSL_CRYPTO_LIBRARY ${PC_OPENSSL_LIBRARIES})
set(OPENSSL_INCLUDE_DIR ${PC_OPENSSL_INCLUDE_DIRS})
endif()
endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(OpenSSL DEFAULT_MSG
OPENSSL_CRYPTO_LIBRARY
OPENSSL_INCLUDE_DIR)
mark_as_advanced(OPENSSL_INCLUDE_DIR OPENSSL_CRYPTO_LIBRARY)

@ -1,6 +1,7 @@
#include <cpr/cpr.h>
#include <llarp/constants/files.hpp>
#include <llarp/constants/version.hpp>
#include <llarp/util/buffer.hpp>
#include <llarp/util/fs.hpp>
#include <fstream>
@ -13,6 +14,8 @@
#include <openssl/x509.h>
#endif
#include <sstream>
namespace
{
int

@ -86,4 +86,11 @@ add_definitions(-D_GNU_SOURCE)
add_subdirectory(ngtcp2 EXCLUDE_FROM_ALL)
set(CPR_BUILD_TESTS OFF)
add_subdirectory(cpr)
set(CPR_FORCE_OPENSSL_BACKEND ON)
if(OPENSSL_ROOT_DIR)
message("openssl root: ${OPENSSL_ROOT_DIR}")
message("openssl headers: ${OPENSSL_INCLUDE_DIR}")
message("openssl crypto library: ${OPENSSL_CRYPTO_LIBRARY}")
endif()
add_subdirectory(cpr EXCLUDE_FROM_ALL)

Loading…
Cancel
Save