diff --git a/CMakeLists.txt b/CMakeLists.txt index e0dcdb8..90c449a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,6 +7,15 @@ project(BeamMP-Server 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") + + add_subdirectory("include/sentry-native") message(STATUS "Setting compiler flags") @@ -18,7 +27,6 @@ if (WIN32) set(VcpkgRoot ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}) include_directories(${VcpkgRoot}/include) link_directories(${VcpkgRoot}/lib) - set(CURL_STATIC_CRT ON) elseif (UNIX) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wpedantic -static-libstdc++") set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O0 -g") @@ -29,11 +37,6 @@ elseif (UNIX) endif (SANITIZE) endif () -set(BUILD_CURL_EXE OFF) -set(BUILD_SHARED_LIBS ON) -set(CURL_WERROR OFF) -add_subdirectory("include/curl") - message(STATUS "Checking for Sentry URL") # this is set by the build system. # IMPORTANT: if you're building from source, just leave this empty diff --git a/include/Sentry.h b/include/Sentry.h index 1c259a7..3080430 100644 --- a/include/Sentry.h +++ b/include/Sentry.h @@ -12,6 +12,7 @@ public: TSentry(const std::string& SentryUrl); ~TSentry(); + void PrintWelcome(); void Log(sentry_level_t level, const std::string& logger, const std::string& text); void AddExtra(const std::string& key, const sentry_value_t& value); void AddExtra(const std::string& key, const std::string& value); diff --git a/src/Sentry.cpp b/src/Sentry.cpp index 660daf4..413ff03 100644 --- a/src/Sentry.cpp +++ b/src/Sentry.cpp @@ -4,7 +4,6 @@ TSentry::TSentry(const std::string& SentryUrl) { if (SentryUrl.empty()) { mValid = false; - info("Sentry disabled in unofficial build"); } else { mValid = true; sentry_options_t* options = sentry_options_new(); @@ -13,7 +12,6 @@ TSentry::TSentry(const std::string& SentryUrl) { sentry_options_set_release(options, ReleaseString.c_str()); sentry_options_set_max_breadcrumbs(options, 10); sentry_init(options); - info("Sentry started"); } } @@ -23,6 +21,14 @@ TSentry::~TSentry() { } } +void TSentry::PrintWelcome() { + if (mValid) { + info("Sentry started"); + } else { + info("Sentry disabled in unofficial build"); + } +} + void TSentry::Log(sentry_level_t level, const std::string& logger, const std::string& text) { if (!mValid) { return; diff --git a/src/main.cpp b/src/main.cpp index af7edd6..2baa96a 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -55,7 +55,6 @@ int main(int argc, char** argv) try { bool Shutdown = false; Application::RegisterShutdownHandler([&Shutdown] { Shutdown = true; }); - TServer Server(argc, argv); TConfig Config;