From b8bd939bd773f6aa634e1310ab27ddf3bbc27639 Mon Sep 17 00:00:00 2001 From: root Date: Sun, 8 Nov 2020 06:54:59 -0500 Subject: [PATCH] Add build instructions for linux, fix some cmake issues --- CMakeLists.txt | 3 +-- README.md | 37 ++++++++++++++++++++++++++++++++++++- 2 files changed, 37 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index af49455..76c55b3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -24,15 +24,14 @@ file(GLOB source_files "src/*.cpp" "src/*/*.cpp" "include/*.h" "include/*/*.h" " add_executable(BeamMP-Server ${source_files}) target_include_directories(BeamMP-Server SYSTEM PUBLIC $) +find_package(Lua 5.3 REQUIRED) target_include_directories(BeamMP-Server SYSTEM PUBLIC ${LUA_INCLUDE_DIR} ${Boost_INCLUDE_DIRS}) if (UNIX) - find_package(Lua 5.3 REQUIRED) target_link_libraries(BeamMP-Server curl z pthread stdc++fs ${Boost_LINK_DIRS} ${LUA_LIBRARIES}) elseif (WIN32) include(FindLua) find_package(CURL CONFIG REQUIRED) find_package(ZLIB REQUIRED) - find_package(Lua REQUIRED) target_link_libraries(BeamMP-Server PRIVATE urlmon ws2_32 CURL::libcurl ZLIB::ZLIB ${Boost_LINK_DIRS} ${LUA_LIBRARIES}) endif () diff --git a/README.md b/README.md index 44a6131..66754b3 100644 --- a/README.md +++ b/README.md @@ -1 +1,36 @@ -# BeamNG-MP-Server \ No newline at end of file +# BeamNG-MP-Server + +## Unix specific build instructions + +1. You need boost >= 1.70.0 + +Check with your ditro's package manager whether it provides this. If it does, you should use that. + + +If it doesnt provide it or you want to link it statically (like we do with our releases), then you have to do this: + +download the latest boost source code. +Then, go to the downloaded directory and run +```sh +b2 link=static runtime-link=static threading=multi +``` +And then either symlink, edit CMakeLists to find it, or simply run +```sh +b2 link=static runtime-link=static threading=multi install +``` +(warning: installs boost into your system, you might not want this). + +Then on invocation of cmake, ensure that you define `Boost_USE_STATIC_RUNTIME=ON`. + + +2. Building + +Run cmake, and then make. + +Example: + +```bash +~/src/Server $ cmake -S . -B bin -DCMAKE_BUILD_TYPE=Release +... +~/src/Server $ make -C bin -j 5 +```