mirror of
https://github.com/BeamMP/BeamMP-Server.git
synced 2026-06-17 14:12:25 +00:00
Actions fix (#11)
* update workflows to accomodate new requirements * add boost to vkpkg * try without boost again * use boost just boost * might cache vcpkg or might not idk * dont pull everything in boost * clean up includes * fix 1 * fix 2 * fix 3 * fix 4 * fix id 6 * remove libssl again * move to boost 1.71 * add boost to windows cmake * change from boost 1.71 to 1.70 * fix cmake again * remove version because f cmake * remove stuff again * fix my mistakes * fix linker args for unix * openssl * add openssl to vcpkg * uhh change whats linked * rename OpenSSL to OPENSSL????
This commit is contained in:
@@ -13,7 +13,11 @@ jobs:
|
|||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
- name: Install Dependencies
|
- name: Install Dependencies
|
||||||
run: sudo apt-get update && sudo apt-get install -y libz-dev rapidjson-dev libcurl4-openssl-dev liblua5.3
|
run: |
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install -y libz-dev rapidjson-dev liblua5.3 libssl-dev
|
||||||
|
sudo add-apt-repository ppa:mhier/libboost-latest
|
||||||
|
sudo apt-get install -y libboost1.70-dev libboost1.70
|
||||||
|
|
||||||
- name: Create Build Environment
|
- name: Create Build Environment
|
||||||
run: cmake -E make_directory ${{github.workspace}}/build-linux
|
run: cmake -E make_directory ${{github.workspace}}/build-linux
|
||||||
|
|||||||
@@ -17,15 +17,16 @@ jobs:
|
|||||||
uses: lukka/run-vcpkg@main
|
uses: lukka/run-vcpkg@main
|
||||||
id: runvcpkg
|
id: runvcpkg
|
||||||
with:
|
with:
|
||||||
vcpkgArguments: 'lua zlib rapidjson curl'
|
vcpkgArguments: 'lua zlib rapidjson boost-beast boost-asio openssl'
|
||||||
vcpkgDirectory: '${{ runner.workspace }}/b/vcpkg'
|
vcpkgDirectory: '${{ runner.workspace }}/b/vcpkg'
|
||||||
vcpkgGitCommitId: '30124253eecff36bc90f73341edbfb4f845e2a1e'
|
vcpkgGitCommitId: '30124253eecff36bc90f73341edbfb4f845e2a1e'
|
||||||
vcpkgTriplet: 'x64-windows-static'
|
vcpkgTriplet: 'x64-windows-static'
|
||||||
|
appendedCacheKey: ${{ hashFiles( '**/vcpkg_manifest/vcpkg.json' ) }}
|
||||||
|
additionalCachedPaths: ${{ env.buildDir }}/vcpkg_installed
|
||||||
|
|
||||||
- name: Create Build Environment
|
- name: Create Build Environment
|
||||||
run: cmake -E make_directory ${{github.workspace}}/build-windows
|
run: cmake -E make_directory ${{github.workspace}}/build-windows
|
||||||
|
|
||||||
#
|
|
||||||
- name: Configure CMake
|
- name: Configure CMake
|
||||||
shell: bash
|
shell: bash
|
||||||
working-directory: ${{github.workspace}}/build-windows
|
working-directory: ${{github.workspace}}/build-windows
|
||||||
|
|||||||
+7
-7
@@ -20,7 +20,7 @@ elseif (WIN32)
|
|||||||
#-DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-windows-static
|
#-DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-windows-static
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
#find_package(Boost 1.70.0 REQUIRED COMPONENTS system thread)
|
find_package(Boost REQUIRED COMPONENTS system thread)
|
||||||
|
|
||||||
file(GLOB source_files "src/*.cpp" "include/*.h" "include/*/*.h" "include/*/*/*.h" "include/*.hpp" "include/*/*.hpp" "src/*/*.cpp")
|
file(GLOB source_files "src/*.cpp" "include/*.h" "include/*/*.h" "include/*/*/*.h" "include/*.hpp" "include/*/*.hpp" "src/*/*.cpp")
|
||||||
add_executable(BeamMP-Server ${source_files})
|
add_executable(BeamMP-Server ${source_files})
|
||||||
@@ -28,16 +28,16 @@ add_executable(BeamMP-Server ${source_files})
|
|||||||
target_include_directories(BeamMP-Server PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>)
|
target_include_directories(BeamMP-Server PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>)
|
||||||
|
|
||||||
find_package(Lua REQUIRED)
|
find_package(Lua REQUIRED)
|
||||||
target_include_directories(BeamMP-Server PUBLIC ${LUA_INCLUDE_DIR})
|
target_include_directories(BeamMP-Server PUBLIC ${Boost_INCLUDE_DIRS} ${LUA_INCLUDE_DIR})
|
||||||
|
|
||||||
|
find_package(OpenSSL REQUIRED)
|
||||||
|
|
||||||
if (UNIX)
|
if (UNIX)
|
||||||
target_link_libraries(BeamMP-Server z pthread stdc++fs ${Boost_LINK_DIRS} ${LUA_LIBRARIES} curl dl crypto ssl)
|
target_link_libraries(BeamMP-Server z pthread stdc++fs ${Boost_LINK_DIRS} ${LUA_LIBRARIES} dl crypto ${OPENSSL_LIBRARIES} ${Boost_LIBRARIES})
|
||||||
elseif (WIN32)
|
elseif (WIN32)
|
||||||
include(FindLua)
|
include(FindLua)
|
||||||
find_package(ZLIB REQUIRED)
|
find_package(ZLIB REQUIRED)
|
||||||
find_package(CURL CONFIG REQUIRED)
|
|
||||||
find_package(RapidJSON CONFIG REQUIRED)
|
find_package(RapidJSON CONFIG REQUIRED)
|
||||||
target_include_directories(BeamMP-Server PRIVATE ${RAPIDJSON_INCLUDE_DIRS})
|
target_include_directories(BeamMP-Server PRIVATE ${RAPIDJSON_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS})
|
||||||
target_link_libraries(BeamMP-Server PRIVATE ws2_32 CURL::libcurl ZLIB::ZLIB ${LUA_LIBRARIES})
|
target_link_libraries(BeamMP-Server PRIVATE ws2_32 ZLIB::ZLIB ${LUA_LIBRARIES} ${Boost_LIBRARIES} ${OPENSSL_LIBRARIES})
|
||||||
#${Boost_LINK_DIRS}
|
|
||||||
endif ()
|
endif ()
|
||||||
|
|||||||
@@ -11,13 +11,8 @@
|
|||||||
|
|
||||||
#include <boost/asio/connect.hpp>
|
#include <boost/asio/connect.hpp>
|
||||||
#include <boost/asio/ip/tcp.hpp>
|
#include <boost/asio/ip/tcp.hpp>
|
||||||
#include <boost/asio/ssl/error.hpp>
|
#include <boost/beast.hpp>
|
||||||
#include <boost/asio/ssl/stream.hpp>
|
|
||||||
#include <boost/beast/core.hpp>
|
|
||||||
#include <boost/beast/http.hpp>
|
|
||||||
#include <boost/beast/ssl.hpp>
|
#include <boost/beast/ssl.hpp>
|
||||||
#include <boost/beast/version.hpp>
|
|
||||||
#include <boost/lexical_cast.hpp>
|
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
@@ -118,7 +113,7 @@ std::string PostHTTP(const std::string& host, const std::string& target, const s
|
|||||||
} else {
|
} else {
|
||||||
req.set(http::field::content_type, "application/x-www-form-urlencoded");
|
req.set(http::field::content_type, "application/x-www-form-urlencoded");
|
||||||
}
|
}
|
||||||
req.set(http::field::content_length, boost::lexical_cast<std::string>(body.size()));
|
req.set(http::field::content_length, std::to_string(body.size()));
|
||||||
req.body() = body;
|
req.body() = body;
|
||||||
// info("body is " + body + " (" + req.body() + ")");
|
// info("body is " + body + " (" + req.body() + ")");
|
||||||
// info("content size is " + std::to_string(body.size()) + " (" + boost::lexical_cast<std::string>(body.size()) + ")");
|
// info("content size is " + std::to_string(body.size()) + " (" + boost::lexical_cast<std::string>(body.size()) + ")");
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
#include "CustomAssert.h"
|
#include "CustomAssert.h"
|
||||||
|
|
||||||
#include "Startup.h"
|
#include "Startup.h"
|
||||||
#include <curl/curl.h>
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <thread>
|
#include <thread>
|
||||||
#ifndef WIN32
|
#ifndef WIN32
|
||||||
@@ -33,9 +32,6 @@ int main(int argc, char* argv[]) {
|
|||||||
signal(SIGPIPE, UnixSignalHandler);
|
signal(SIGPIPE, UnixSignalHandler);
|
||||||
#endif // WIN32
|
#endif // WIN32
|
||||||
DebugPrintTID();
|
DebugPrintTID();
|
||||||
// curl needs to be initialized to properly deallocate its resources later
|
|
||||||
[[maybe_unused]] auto ret = curl_global_init(CURL_GLOBAL_DEFAULT);
|
|
||||||
Assert(ret == CURLE_OK);
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
std::thread t1(loop);
|
std::thread t1(loop);
|
||||||
t1.detach();
|
t1.detach();
|
||||||
@@ -48,7 +44,5 @@ int main(int argc, char* argv[]) {
|
|||||||
HBInit();
|
HBInit();
|
||||||
StatInit();
|
StatInit();
|
||||||
NetMain();
|
NetMain();
|
||||||
// clean up curl at the end to be sure
|
|
||||||
curl_global_cleanup();
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user