mirror of
https://github.com/BeamMP/BeamMP-Server.git
synced 2025-07-03 16:25:35 +00:00
fix github actions
Possible fix for sentry url not showing up in windows build possible fix for sentry, again add static_assert in attempt to fix issue with sentry use target_compile_definitions instead of add_compile_definitions
This commit is contained in:
parent
7d137eb496
commit
fe36191baf
2
.github/workflows/cmake-linux.yml
vendored
2
.github/workflows/cmake-linux.yml
vendored
@ -29,7 +29,7 @@ jobs:
|
|||||||
working-directory: ${{github.workspace}}/build-linux
|
working-directory: ${{github.workspace}}/build-linux
|
||||||
env:
|
env:
|
||||||
beammp_sentry_url: ${{ secrets.BEAMMP_SECRET_SENTRY_URL }}
|
beammp_sentry_url: ${{ secrets.BEAMMP_SECRET_SENTRY_URL }}
|
||||||
run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_CXX_COMPILER=g++-10 -DBEAMMP_SECRET_SENTRY_URL=$beammp_sentry_url
|
run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_CXX_COMPILER=g++-10 -DBEAMMP_SECRET_SENTRY_URL="$beammp_sentry_url"
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
working-directory: ${{github.workspace}}/build-linux
|
working-directory: ${{github.workspace}}/build-linux
|
||||||
|
4
.github/workflows/cmake-windows.yml
vendored
4
.github/workflows/cmake-windows.yml
vendored
@ -29,7 +29,9 @@ jobs:
|
|||||||
- name: Configure CMake
|
- name: Configure CMake
|
||||||
shell: bash
|
shell: bash
|
||||||
working-directory: ${{github.workspace}}/build-windows
|
working-directory: ${{github.workspace}}/build-windows
|
||||||
run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_TOOLCHAIN_FILE='${{ runner.workspace }}/b/vcpkg/scripts/buildsystems/vcpkg.cmake' -DVCPKG_TARGET_TRIPLET=x64-windows-static
|
env:
|
||||||
|
beammp_sentry_url: ${{ secrets.BEAMMP_SECRET_SENTRY_URL }}
|
||||||
|
run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_TOOLCHAIN_FILE='${{ runner.workspace }}/b/vcpkg/scripts/buildsystems/vcpkg.cmake' -DVCPKG_TARGET_TRIPLET=x64-windows-static -DBEAMMP_SECRET_SENTRY_URL="$beammp_sentry_url"
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
working-directory: ${{github.workspace}}/build-windows
|
working-directory: ${{github.workspace}}/build-windows
|
||||||
|
@ -3,7 +3,6 @@ cmake_minimum_required(VERSION 3.0)
|
|||||||
message(STATUS "You can find build instructions and a list of dependencies in the README at \
|
message(STATUS "You can find build instructions and a list of dependencies in the README at \
|
||||||
https://github.com/BeamMP/BeamMP-Server")
|
https://github.com/BeamMP/BeamMP-Server")
|
||||||
|
|
||||||
# ---- start of CXX section -----
|
|
||||||
project(BeamMP-Server
|
project(BeamMP-Server
|
||||||
DESCRIPTION "Server for BeamMP - The Multiplayer Mod for BeamNG.drive"
|
DESCRIPTION "Server for BeamMP - The Multiplayer Mod for BeamNG.drive"
|
||||||
HOMEPAGE_URL https://beammp.com
|
HOMEPAGE_URL https://beammp.com
|
||||||
@ -84,6 +83,8 @@ add_executable(BeamMP-Server
|
|||||||
include/TPPSMonitor.h src/TPPSMonitor.cpp
|
include/TPPSMonitor.h src/TPPSMonitor.cpp
|
||||||
include/TNetwork.h src/TNetwork.cpp)
|
include/TNetwork.h src/TNetwork.cpp)
|
||||||
|
|
||||||
|
target_compile_definitions(BeamMP-Server PRIVATE SECRET_SENTRY_URL="${BEAMMP_SECRET_SENTRY_URL}")
|
||||||
|
|
||||||
target_include_directories(BeamMP-Server PUBLIC
|
target_include_directories(BeamMP-Server PUBLIC
|
||||||
"${CMAKE_CURRENT_SOURCE_DIR}/include"
|
"${CMAKE_CURRENT_SOURCE_DIR}/include"
|
||||||
"${CMAKE_CURRENT_SOURCE_DIR}/commandline")
|
"${CMAKE_CURRENT_SOURCE_DIR}/commandline")
|
||||||
@ -105,7 +106,6 @@ find_package(OpenSSL REQUIRED)
|
|||||||
message(STATUS "CURL IS ${CURL_LIBRARIES}")
|
message(STATUS "CURL IS ${CURL_LIBRARIES}")
|
||||||
|
|
||||||
if (UNIX)
|
if (UNIX)
|
||||||
add_definitions(-DSECRET_SENTRY_URL="${BEAMMP_SECRET_SENTRY_URL}")
|
|
||||||
target_link_libraries(BeamMP-Server
|
target_link_libraries(BeamMP-Server
|
||||||
z
|
z
|
||||||
pthread
|
pthread
|
||||||
@ -117,7 +117,6 @@ if (UNIX)
|
|||||||
sioclient_tls
|
sioclient_tls
|
||||||
sentry)
|
sentry)
|
||||||
elseif (WIN32)
|
elseif (WIN32)
|
||||||
add_definitions(/DSECRET_SENTRY_URL="${BEAMMP_SECRET_SENTRY_URL}")
|
|
||||||
include(FindLua)
|
include(FindLua)
|
||||||
message(STATUS "Looking for libz")
|
message(STATUS "Looking for libz")
|
||||||
find_package(ZLIB REQUIRED)
|
find_package(ZLIB REQUIRED)
|
||||||
|
@ -36,6 +36,10 @@ void UnixSignalHandler(int sig) {
|
|||||||
}
|
}
|
||||||
#endif // __unix
|
#endif // __unix
|
||||||
|
|
||||||
|
int constexpr length(const char* str) {
|
||||||
|
return *str ? 1 + length(str + 1) : 0;
|
||||||
|
}
|
||||||
|
|
||||||
// this is provided by the build system, leave empty for source builds
|
// this is provided by the build system, leave empty for source builds
|
||||||
// global, yes, this is ugly, no, it cant be done another way
|
// global, yes, this is ugly, no, it cant be done another way
|
||||||
TSentry Sentry { SECRET_SENTRY_URL };
|
TSentry Sentry { SECRET_SENTRY_URL };
|
||||||
@ -55,6 +59,8 @@ int main(int argc, char** argv) try {
|
|||||||
#endif // __unix
|
#endif // __unix
|
||||||
setlocale(LC_ALL, "C");
|
setlocale(LC_ALL, "C");
|
||||||
|
|
||||||
|
static_assert(length(SECRET_SENTRY_URL) != 0);
|
||||||
|
|
||||||
bool Shutdown = false;
|
bool Shutdown = false;
|
||||||
Application::RegisterShutdownHandler([&Shutdown] { Shutdown = true; });
|
Application::RegisterShutdownHandler([&Shutdown] { Shutdown = true; });
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user