From b0475f262fe743f5afb4cf846a266cbad4edfb35 Mon Sep 17 00:00:00 2001 From: Lion Kortlepel Date: Mon, 9 Aug 2021 13:28:44 +0200 Subject: [PATCH] remove curl submodule, add it as an external dependency --- .gitmodules | 3 --- CMakeLists.txt | 21 +++++---------------- src/Http.cpp | 5 +++++ 3 files changed, 10 insertions(+), 19 deletions(-) diff --git a/.gitmodules b/.gitmodules index eff1e56..e0dfe36 100644 --- a/.gitmodules +++ b/.gitmodules @@ -16,6 +16,3 @@ [submodule "include/sentry-native"] path = include/sentry-native url = https://github.com/getsentry/sentry-native -[submodule "include/curl"] - path = include/curl - url = https://github.com/curl/curl diff --git a/CMakeLists.txt b/CMakeLists.txt index 315e2c4..a32ae00 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,26 +3,14 @@ cmake_minimum_required(VERSION 3.0) message(STATUS "You can find build instructions and a list of dependencies in the README at \ https://github.com/BeamMP/BeamMP-Server") -set(BUILD_CURL_EXE OFF) -set(BUILD_SHARED_LIBS ON) -set(CURL_WERROR OFF) -if (WIN32) - set(CURL_STATIC_CRT ON) -endif() -add_subdirectory("include/curl") - -set(CURL_LIBRARY CURL::libcurl) -set(CURL_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/include/curl/include) - -add_subdirectory("include/sentry-native") - - # ---- start of CXX section ----- project(BeamMP-Server DESCRIPTION "Server for BeamMP - The Multiplayer Mod for BeamNG.drive" HOMEPAGE_URL https://beammp.com LANGUAGES CXX) +add_subdirectory("include/sentry-native") + message(STATUS "Setting compiler flags") if (WIN32) message(STATUS "MSVC -> forcing use of statically-linked runtime.") @@ -92,6 +80,7 @@ find_package(Lua REQUIRED) target_include_directories(BeamMP-Server PUBLIC ${Boost_INCLUDE_DIRS} ${LUA_INCLUDE_DIR} + ${CURL_INCLUDE_DIRS} "socket.io-client-cpp/src" "include/tomlplusplus" "include/sentry-native" @@ -100,6 +89,8 @@ target_include_directories(BeamMP-Server PUBLIC message(STATUS "Looking for SSL") find_package(OpenSSL REQUIRED) +message(STATUS "CURL IS ${CURL_LIBRARIES}") + if (UNIX) add_definitions(-DSECRET_SENTRY_URL="${BEAMMP_SECRET_SENTRY_URL}") target_link_libraries(BeamMP-Server @@ -108,7 +99,6 @@ if (UNIX) stdc++fs ${LUA_LIBRARIES} crypto - CURL::libcurl ${OPENSSL_LIBRARIES} commandline sioclient_tls @@ -126,7 +116,6 @@ elseif (WIN32) ZLIB::ZLIB ${LUA_LIBRARIES} ${OPENSSL_LIBRARIES} - CURL::libcurl commandline sioclient_tls) endif () diff --git a/src/Http.cpp b/src/Http.cpp index d6ce399..155b557 100644 --- a/src/Http.cpp +++ b/src/Http.cpp @@ -123,6 +123,11 @@ std::string Http::POST(const std::string& host, const std::string& target, const beast::flat_buffer buffer; http::response response; + auto BackendName = response.base().find("Date"); + if (BackendName != response.base().end()) { + Application::Console().Write("HTTP POST: Date is " + std::string(BackendName->value())); + } + http::read(stream, buffer, response); std::stringstream result;