mirror of
https://github.com/BeamMP/BeamMP-Server.git
synced 2026-02-16 10:41:01 +00:00
Compare commits
4 Commits
254-imscar
...
static-bui
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5f456584a8 | ||
|
|
b88b64cd0e | ||
|
|
dccdd3f5f2 | ||
|
|
ae38f01fdc |
@@ -90,11 +90,28 @@ add_subdirectory(deps)
|
||||
|
||||
# ------------------------ VARIABLES ---------------------------------
|
||||
|
||||
include(FindLua)
|
||||
option(FIND_OPENSSL "Whether or not to find openssl automatically (keep on unless you know what you're doing)" ON)
|
||||
option(FIND_ZLIB "Whether or not to find zlib automatically (keep on unless you know what you're doing)" ON)
|
||||
|
||||
include(FindOpenSSL)
|
||||
if (${FIND_OPENSSL})
|
||||
set(OPENSSL_CRYPTO OpenSSL::Crypto)
|
||||
set(OPENSSL_SSL OpenSSL::SSL)
|
||||
else()
|
||||
message(STATUS "Using custom openssl libs: ${OPENSSL_CRYPTO} ${OPENSSL_SSL}")
|
||||
endif()
|
||||
|
||||
include(FindLua)
|
||||
include(FindThreads)
|
||||
|
||||
include(FindZLIB)
|
||||
|
||||
if (${FIND_ZLIB})
|
||||
set(ZLIB_ZLIB ZLIB::ZLIB)
|
||||
else()
|
||||
message(STATUS "Using custom zlib: ${ZLIB_ZLIB}")
|
||||
endif()
|
||||
|
||||
set(BeamMP_Sources
|
||||
include/TConsole.h src/TConsole.cpp
|
||||
include/TServer.h src/TServer.cpp
|
||||
@@ -171,12 +188,12 @@ endif()
|
||||
|
||||
set(BeamMP_Libraries
|
||||
doctest::doctest
|
||||
OpenSSL::SSL
|
||||
OpenSSL::Crypto
|
||||
${OPENSSL_SSL}
|
||||
${OPENSSL_CRYPTO}
|
||||
sol2::sol2
|
||||
fmt::fmt
|
||||
Threads::Threads
|
||||
ZLIB::ZLIB
|
||||
${ZLIB_ZLIB}
|
||||
${LUA_LIBRARIES}
|
||||
commandline
|
||||
sentry
|
||||
|
||||
11
Dockerfile
Normal file
11
Dockerfile
Normal file
@@ -0,0 +1,11 @@
|
||||
FROM lionkor/alpine-static-cpp:latest
|
||||
|
||||
ARG LUA_V=5.3.6
|
||||
|
||||
RUN apk update && apk --no-cache add python3 git lua zlib-static openssl curl rapidjson curl-dev wget readline-static
|
||||
RUN apk --no-cache add openssl-libs-static curl-static readline-dev
|
||||
|
||||
RUN wget "https://www.lua.org/ftp/lua-${LUA_V}.tar.gz"; tar xzvf lua-${LUA_V}.tar.gz; mv "lua-${LUA_V}" /lua; rm lua-${LUA_V}.tar.gz
|
||||
|
||||
RUN cd /lua; make all -j linux; cd ..
|
||||
|
||||
22
docker-build.sh
Executable file
22
docker-build.sh
Executable file
@@ -0,0 +1,22 @@
|
||||
#!/bin/sh
|
||||
|
||||
# usage:
|
||||
# ./docker-build.sh
|
||||
# builds the image, and then runs it
|
||||
# ./docker-build.sh run
|
||||
# only runs it
|
||||
|
||||
set -e
|
||||
|
||||
if [ "$1" != "run" ]
|
||||
then
|
||||
git submodule update --init --recursive
|
||||
docker build . --tag beammp-static
|
||||
fi
|
||||
|
||||
|
||||
docker run -v $(pwd):/root -it --rm beammp-static sh -c "cd root; cmake . -B build -DGIT_SUBMODULE=OFF -DLUA_INCLUDE_DIR=/lua/src -DSOL2_SINGLE=ON -DFIND_OPENSSL=OFF -DOPENSSL_CRYPTO=\"/usr/lib/libcrypto.a\" -DOPENSSL_SSL=\"/usr/lib/libssl.a\" -DFIND_ZLIB=OFF -DZLIB_ZLIB=/lib/libz.a -DCURL_FOUND=ON -DCURL_LIBRARIES=\"/usr/lib/libcurl.a\" -DLUA_LIBRARIES=\"/lua/src/liblua.a\" -DSENTRY_BACKEND=none -DSENTRY_TRANSPORT=none; make -C build -j BeamMP-Server"
|
||||
|
||||
# try to chown the build directory afterwards
|
||||
sudo chown -R "$USER":"$USER" build
|
||||
|
||||
Reference in New Issue
Block a user