From e54faa38202a9efa743abf6de2524312c4842617 Mon Sep 17 00:00:00 2001 From: David Markowitz <39972741+EmosewaMC@users.noreply.github.com> Date: Sat, 30 Dec 2023 22:26:49 -0800 Subject: [PATCH] chore: organize build flags (#1371) * chore: organize build flags * Remove ambiguous include path Don't be default incluyde bcrypt so you need to specify the folder. Allows pre-processor to find the correct file. * Revert settings * working f --- CMakeLists.txt | 70 ++++++++----------- CMakeVariables.txt | 38 ++++++---- dAuthServer/AuthServer.cpp | 2 +- dAuthServer/CMakeLists.txt | 1 + dChatServer/CMakeLists.txt | 1 + dChatServer/ChatServer.cpp | 2 +- dCommon/Diagnostics.cpp | 8 +-- dCommon/Game.h | 2 + .../CDClientDatabase/CDClientManager.cpp | 4 +- dDatabase/CMakeLists.txt | 4 ++ dGame/dUtilities/VanityUtilities.cpp | 6 +- dMasterServer/CMakeLists.txt | 1 + dMasterServer/MasterServer.cpp | 6 +- dNet/AuthPackets.cpp | 4 -- dWorldServer/CMakeLists.txt | 1 + dWorldServer/WorldServer.cpp | 3 +- docker/Dockerfile | 2 +- tests/dGameTests/GameDependencies.cpp | 1 + thirdparty/CMakeLists.txt | 10 ++- thirdparty/CMakeMariaDBLists.txt | 2 +- 20 files changed, 90 insertions(+), 78 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7e982346..aa7eb9b2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -28,16 +28,13 @@ foreach(variable ${variables}) # Set the variable set(${variable_name} ${variable_value}) - # Add compiler definition - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D${variable_name}=${variable_value}") - message(STATUS "Variable: ${variable_name} = ${variable_value}") endif() endif() endforeach() # Set the version -set(PROJECT_VERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}") +set(PROJECT_VERSION "\"${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}\"") # Echo the version message(STATUS "Version: ${PROJECT_VERSION}") @@ -53,19 +50,21 @@ set(RECASTNAVIGATION_EXAMPLES OFF CACHE BOOL "" FORCE) # Disabled misleading indentation as DL_LinkedList from RakNet has a weird indent. # Disabled no-register # Disabled unknown pragmas because Linux doesn't understand Windows pragmas. -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DPROJECT_VERSION=${PROJECT_VERSION}") if(UNIX) - if(APPLE) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++17 -O2 -Wuninitialized -D_GLIBCXX_USE_CXX11_ABI=0 -D_GLIBCXX_USE_CXX17_ABI=0 -fPIC") - else() - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++17 -O2 -Wuninitialized -D_GLIBCXX_USE_CXX11_ABI=0 -D_GLIBCXX_USE_CXX17_ABI=0 -static-libgcc -fPIC -lstdc++fs") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++17 -O2 -Wuninitialized -fPIC") + add_compile_definitions(_GLIBCXX_USE_CXX11_ABI=0 _GLIBCXX_USE_CXX17_ABI=0) + if(NOT APPLE) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static-libgcc -lstdc++fs") endif() - if (__dynamic AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + + if (${DYNAMIC} AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -rdynamic") endif() - if (__ggdb) + + if (${GGDB}) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ggdb") endif() + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -O2 -fPIC") elseif(MSVC) # Skip warning for invalid conversion from size_t to uint32_t for all targets below for now @@ -154,10 +153,7 @@ if (NOT EXISTS ${PROJECT_BINARY_DIR}/navmeshes) endif() # Copy navmesh data on first build and extract it -configure_file( - ${CMAKE_SOURCE_DIR}/resources/navmeshes.zip ${PROJECT_BINARY_DIR}/navmeshes.zip - COPYONLY -) +configure_file(${CMAKE_SOURCE_DIR}/resources/navmeshes.zip ${PROJECT_BINARY_DIR}/navmeshes.zip COPYONLY) file(ARCHIVE_EXTRACT INPUT ${PROJECT_BINARY_DIR}/navmeshes.zip DESTINATION ${PROJECT_BINARY_DIR}/navmeshes) file(REMOVE ${PROJECT_BINARY_DIR}/navmeshes.zip) @@ -173,24 +169,14 @@ file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/migrations/dlu/) file(GLOB SQL_FILES ${CMAKE_SOURCE_DIR}/migrations/dlu/*.sql) foreach(file ${SQL_FILES}) get_filename_component(file ${file} NAME) - if (NOT EXISTS ${PROJECT_BINARY_DIR}/migrations/dlu/${file}) - configure_file( - ${CMAKE_SOURCE_DIR}/migrations/dlu/${file} ${PROJECT_BINARY_DIR}/migrations/dlu/${file} - COPYONLY - ) - endif() + configure_file(${CMAKE_SOURCE_DIR}/migrations/dlu/${file} ${PROJECT_BINARY_DIR}/migrations/dlu/${file}) endforeach() file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/migrations/cdserver/) file(GLOB SQL_FILES ${CMAKE_SOURCE_DIR}/migrations/cdserver/*.sql) foreach(file ${SQL_FILES}) get_filename_component(file ${file} NAME) - if (NOT EXISTS ${PROJECT_BINARY_DIR}/migrations/cdserver/${file}) - configure_file( - ${CMAKE_SOURCE_DIR}/migrations/cdserver/${file} ${PROJECT_BINARY_DIR}/migrations/cdserver/${file} - COPYONLY - ) - endif() + configure_file(${CMAKE_SOURCE_DIR}/migrations/cdserver/${file} ${PROJECT_BINARY_DIR}/migrations/cdserver/${file}) endforeach() # Create our list of include directories @@ -198,7 +184,9 @@ set(INCLUDED_DIRECTORIES "dCommon" "dCommon/dClient" "dCommon/dEnums" + "dChatFilter" + "dGame" "dGame/dBehaviors" "dGame/dComponents" @@ -209,10 +197,14 @@ set(INCLUDED_DIRECTORIES "dGame/dPropertyBehaviors" "dGame/dPropertyBehaviors/ControlBehaviorMessages" "dGame/dUtilities" + "dPhysics" + "dNavigation" "dNavigation/dTerrain" + "dZoneManager" + "dDatabase" "dDatabase/CDClientDatabase" "dDatabase/CDClientDatabase/CDClientTables" @@ -220,7 +212,9 @@ set(INCLUDED_DIRECTORIES "dDatabase/GameDatabase/ITables" "dDatabase/GameDatabase/MySQL" "dDatabase/GameDatabase/MySQL/Tables" + "dNet" + "dScripts" "dScripts/02_server" "dScripts/ai" @@ -304,28 +298,24 @@ set(INCLUDED_DIRECTORIES "tests/dCommonTests" "tests/dGameTests" "tests/dGameTests/dComponentsTests" - ) +) # Add system specfic includes for Apple, Windows and Other Unix OS' (including Linux) if (APPLE) include_directories("/usr/local/include/") endif() -if (WIN32) - set(INCLUDED_DIRECTORIES ${INCLUDED_DIRECTORIES} "thirdparty/libbcrypt/include") -elseif (UNIX) - set(INCLUDED_DIRECTORIES ${INCLUDED_DIRECTORIES} "thirdparty/libbcrypt") - set(INCLUDED_DIRECTORIES ${INCLUDED_DIRECTORIES} "thirdparty/libbcrypt/include/bcrypt") -endif() - -# Add binary directory as an include directory -include_directories(${PROJECT_BINARY_DIR}) - # Actually include the directories from our list foreach (dir ${INCLUDED_DIRECTORIES}) include_directories(${PROJECT_SOURCE_DIR}/${dir}) endforeach() +if (NOT WIN32) + include_directories("${PROJECT_SOURCE_DIR}/thirdparty/libbcrypt/include/bcrypt") +endif() +include_directories("${PROJECT_SOURCE_DIR}/thirdparty/libbcrypt/include") + + # Add linking directories: link_directories(${PROJECT_BINARY_DIR}) @@ -381,7 +371,7 @@ set(COMMON_LIBRARIES "dCommon" "dDatabase" "dNet" "raknet" "mariadbConnCpp" "mag if (UNIX) set(COMMON_LIBRARIES ${COMMON_LIBRARIES} "dl" "pthread") - if (NOT APPLE AND __include_backtrace__) + if (NOT APPLE AND ${INCLUDE_BACKTRACE}) set(COMMON_LIBRARIES ${COMMON_LIBRARIES} "backtrace") endif() endif() @@ -419,6 +409,6 @@ target_precompile_headers( "$<$:${PROJECT_SOURCE_DIR}/thirdparty/tinyxml2/tinyxml2.h>" ) -if (${__enable_testing__} MATCHES "1") +if (${ENABLE_TESTING}) add_subdirectory(tests) endif() diff --git a/CMakeVariables.txt b/CMakeVariables.txt index abfe9e15..d9430d9d 100644 --- a/CMakeVariables.txt +++ b/CMakeVariables.txt @@ -1,22 +1,32 @@ PROJECT_VERSION_MAJOR=1 PROJECT_VERSION_MINOR=1 PROJECT_VERSION_PATCH=1 -# LICENSE -LICENSE=AGPL-3.0 + # Debugging -# Set __dynamic to 1 to enable the -rdynamic flag for the linker, yielding some symbols in crashlogs. -__dynamic=1 -# Set __ggdb to 1 to enable the -ggdb flag for the linker, including more debug info. -# __ggdb=1 -# Set __include_backtrace__ to 1 to includes the backtrace library for better crashlogs. -# __include_backtrace__=1 -# Set __compile_backtrace__ to 1 to compile the backtrace library instead of using system libraries. -# __compile_backtrace__=1 +# Set DYNAMIC to 1 to enable the -rdynamic flag for the linker, yielding some symbols in crashlogs. +DYNAMIC=1 + +# Set GGDB to 1 to enable the -ggdb flag for the linker, including more debug info. +# Do note, changing this will re-build the whole server +GGDB=0 + +# Set INCLUDE_BACKTRACE to 1 to includes the backtrace library for better crashlogs. +# Do note, changing this will re-build the whole server +INCLUDE_BACKTRACE=0 + +# Set COMPILE_BACKTRACE to 1 to compile the backtrace library instead of using system libraries. +# Do note, changing this will re-build the whole server +COMPILE_BACKTRACE=0 + # Set to the number of jobs (make -j equivalent) to compile the mariadbconn files with. -__maria_db_connector_compile_jobs__=1 +MARIADB_CONNECTOR_COMPILE_JOBS=1 + # When set to 1 and uncommented, compiling and linking testing folders and libraries will be done. -__enable_testing__=1 +ENABLE_TESTING=1 + # The path to OpenSSL. Change this if your OpenSSL install path is different than the default. OPENSSL_ROOT_DIR=/usr/local/opt/openssl@3/ -# Uncomment the below line to cache the entire CDClient into memory -# CDCLIENT_CACHE_ALL=1 + +# Whether or not to cache the entire CDClient Database into memory instead of lazy loading. +# 0 means to lazy load, all other values mean load the entire database. +CDCLIENT_CACHE_ALL=0 diff --git a/dAuthServer/AuthServer.cpp b/dAuthServer/AuthServer.cpp index 8f1b2e76..52b35678 100644 --- a/dAuthServer/AuthServer.cpp +++ b/dAuthServer/AuthServer.cpp @@ -52,7 +52,7 @@ int main(int argc, char** argv) { Game::logger->SetLogDebugStatements(Game::config->GetValue("log_debug_statements") == "1"); LOG("Starting Auth server..."); - LOG("Version: %i.%i", PROJECT_VERSION_MAJOR, PROJECT_VERSION_MINOR); + LOG("Version: %s", PROJECT_VERSION); LOG("Compiled on: %s", __TIMESTAMP__); try { diff --git a/dAuthServer/CMakeLists.txt b/dAuthServer/CMakeLists.txt index 00fa6e7a..ebcbccad 100644 --- a/dAuthServer/CMakeLists.txt +++ b/dAuthServer/CMakeLists.txt @@ -1,2 +1,3 @@ add_executable(AuthServer "AuthServer.cpp") target_link_libraries(AuthServer ${COMMON_LIBRARIES}) +add_compile_definitions(AuthServer PRIVATE PROJECT_VERSION="\"${PROJECT_VERSION}\"") diff --git a/dChatServer/CMakeLists.txt b/dChatServer/CMakeLists.txt index 34d58a3a..b6a3efb8 100644 --- a/dChatServer/CMakeLists.txt +++ b/dChatServer/CMakeLists.txt @@ -6,6 +6,7 @@ set(DCHATSERVER_SOURCES add_executable(ChatServer "ChatServer.cpp") add_library(dChatServer ${DCHATSERVER_SOURCES}) +add_compile_definitions(ChatServer PRIVATE PROJECT_VERSION="\"${PROJECT_VERSION}\"") target_link_libraries(dChatServer ${COMMON_LIBRARIES} dChatFilter) target_link_libraries(ChatServer ${COMMON_LIBRARIES} dChatFilter dChatServer) diff --git a/dChatServer/ChatServer.cpp b/dChatServer/ChatServer.cpp index 49e427c8..c9bdcd9c 100644 --- a/dChatServer/ChatServer.cpp +++ b/dChatServer/ChatServer.cpp @@ -58,7 +58,7 @@ int main(int argc, char** argv) { Game::logger->SetLogDebugStatements(Game::config->GetValue("log_debug_statements") == "1"); LOG("Starting Chat server..."); - LOG("Version: %i.%i", PROJECT_VERSION_MAJOR, PROJECT_VERSION_MINOR); + LOG("Version: %s", PROJECT_VERSION); LOG("Compiled on: %s", __TIMESTAMP__); try { diff --git a/dCommon/Diagnostics.cpp b/dCommon/Diagnostics.cpp index a4055086..46c17e43 100644 --- a/dCommon/Diagnostics.cpp +++ b/dCommon/Diagnostics.cpp @@ -71,7 +71,7 @@ LONG CALLBACK unhandled_handler(EXCEPTION_POINTERS* e) { #include #include -#if defined(__include_backtrace__) +#if defined(INCLUDE_BACKTRACE) #include #include @@ -122,7 +122,7 @@ void CatchUnhandled(int sig) { LOG("Caught exception: '%s'", e.what()); } -#ifndef __include_backtrace__ +#ifndef INCLUDE_BACKTRACE std::string fileName = Diagnostics::GetOutDirectory() + "crash_" + Diagnostics::GetProcessName() + "_" + std::to_string(getpid()) + ".log"; LOG("Encountered signal %i, creating crash dump %s", sig, fileName.c_str()); @@ -174,7 +174,7 @@ void CatchUnhandled(int sig) { backtrace_symbols_fd(array, size, STDOUT_FILENO); # endif // defined(__GNUG__) -#else // __include_backtrace__ +#else // INCLUDE_BACKTRACE struct backtrace_state* state = backtrace_create_state( Diagnostics::GetProcessFileName().c_str(), @@ -185,7 +185,7 @@ void CatchUnhandled(int sig) { struct bt_ctx ctx = { state, 0 }; Bt(state); -#endif // __include_backtrace__ +#endif // INCLUDE_BACKTRACE exit(EXIT_FAILURE); } diff --git a/dCommon/Game.h b/dCommon/Game.h index 305b4f7a..972eea46 100644 --- a/dCommon/Game.h +++ b/dCommon/Game.h @@ -1,5 +1,6 @@ #pragma once +#include #include class dServer; @@ -28,4 +29,5 @@ namespace Game { extern EntityManager* entityManager; extern dZoneManager* zoneManager; extern PlayerContainer playerContainer; + extern std::string projectVersion; } diff --git a/dDatabase/CDClientDatabase/CDClientManager.cpp b/dDatabase/CDClientDatabase/CDClientManager.cpp index 7c2f3953..74c5c975 100644 --- a/dDatabase/CDClientDatabase/CDClientManager.cpp +++ b/dDatabase/CDClientDatabase/CDClientManager.cpp @@ -39,9 +39,11 @@ #include "CDRailActivatorComponent.h" #include "CDRewardCodesTable.h" +#ifndef CDCLIENT_CACHE_ALL // Uncomment this to cache the full cdclient database into memory. This will make the server load faster, but will use more memory. // A vanilla CDClient takes about 46MB of memory + the regular world data. -// #define CDCLIENT_CACHE_ALL +// # define CDCLIENT_CACHE_ALL +#endif // CDCLIENT_CACHE_ALL #ifdef CDCLIENT_CACHE_ALL #define CDCLIENT_DONT_CACHE_TABLE(x) x diff --git a/dDatabase/CMakeLists.txt b/dDatabase/CMakeLists.txt index 20f37bec..f0fe54b4 100644 --- a/dDatabase/CMakeLists.txt +++ b/dDatabase/CMakeLists.txt @@ -14,3 +14,7 @@ endforeach() add_library(dDatabase STATIC ${DDATABASE_SOURCES}) target_link_libraries(dDatabase sqlite3 mariadbConnCpp) + +if (${CDCLIENT_CACHE_ALL}) + add_compile_definitions(dDatabase CDCLIENT_CACHE_ALL=${CDCLIENT_CACHE_ALL}) +endif() diff --git a/dGame/dUtilities/VanityUtilities.cpp b/dGame/dUtilities/VanityUtilities.cpp index 6c008524..99087365 100644 --- a/dGame/dUtilities/VanityUtilities.cpp +++ b/dGame/dUtilities/VanityUtilities.cpp @@ -525,12 +525,12 @@ std::string VanityUtilities::ParseMarkdown(const std::string& file) { #endif // Replace "__TIMESTAMP__" with the __TIMESTAMP__ GeneralUtils::ReplaceInString(line, "__TIMESTAMP__", __TIMESTAMP__); - // Replace "__VERSION__" wit'h the PROJECT_VERSION - GeneralUtils::ReplaceInString(line, "__VERSION__", STRINGIFY(PROJECT_VERSION)); + // Replace "__VERSION__" with the PROJECT_VERSION + GeneralUtils::ReplaceInString(line, "__VERSION__", Game::projectVersion); // Replace "__SOURCE__" with SOURCE GeneralUtils::ReplaceInString(line, "__SOURCE__", Game::config->GetValue("source")); // Replace "__LICENSE__" with LICENSE - GeneralUtils::ReplaceInString(line, "__LICENSE__", STRINGIFY(LICENSE)); + GeneralUtils::ReplaceInString(line, "__LICENSE__", "AGPL-3.0"); if (line.find("##") != std::string::npos) { // Add "<font size='18' color='#000000'>" before the header diff --git a/dMasterServer/CMakeLists.txt b/dMasterServer/CMakeLists.txt index 656a026a..2ebdee37 100644 --- a/dMasterServer/CMakeLists.txt +++ b/dMasterServer/CMakeLists.txt @@ -6,6 +6,7 @@ set(DMASTERSERVER_SOURCES add_library(dMasterServer ${DMASTERSERVER_SOURCES}) add_executable(MasterServer "MasterServer.cpp") +add_compile_definitions(MasterServer PRIVATE PROJECT_VERSION="\"${PROJECT_VERSION}\"") target_link_libraries(dMasterServer ${COMMON_LIBRARIES}) target_link_libraries(MasterServer ${COMMON_LIBRARIES} dMasterServer) diff --git a/dMasterServer/MasterServer.cpp b/dMasterServer/MasterServer.cpp index 39cf2495..2de212a0 100644 --- a/dMasterServer/MasterServer.cpp +++ b/dMasterServer/MasterServer.cpp @@ -7,11 +7,7 @@ #include #include -#ifdef _WIN32 #include -#else -#include -#endif #include @@ -125,7 +121,7 @@ int main(int argc, char** argv) { LOG("Using net version %s", Game::config->GetValue("client_net_version").c_str()); LOG("Starting Master server..."); - LOG("Version: %i.%i", PROJECT_VERSION_MAJOR, PROJECT_VERSION_MINOR); + LOG("Version: %s", PROJECT_VERSION); LOG("Compiled on: %s", __TIMESTAMP__); //Connect to the MySQL Database diff --git a/dNet/AuthPackets.cpp b/dNet/AuthPackets.cpp index 83c1f58e..8f0542cc 100644 --- a/dNet/AuthPackets.cpp +++ b/dNet/AuthPackets.cpp @@ -11,11 +11,7 @@ #include "SHA512.h" #include "GeneralUtils.h" -#ifdef _WIN32 #include -#else -#include -#endif #include #include diff --git a/dWorldServer/CMakeLists.txt b/dWorldServer/CMakeLists.txt index c616da87..a790487e 100644 --- a/dWorldServer/CMakeLists.txt +++ b/dWorldServer/CMakeLists.txt @@ -5,6 +5,7 @@ set(DWORLDSERVER_SOURCES add_library(dWorldServer ${DWORLDSERVER_SOURCES}) add_executable(WorldServer "WorldServer.cpp") +add_compile_definitions(WorldServer PRIVATE PROJECT_VERSION="\"${PROJECT_VERSION}\"") target_link_libraries(dWorldServer ${COMMON_LIBRARIES}) target_link_libraries(WorldServer ${COMMON_LIBRARIES} dChatFilter dGame dZoneManager dPhysics Detour Recast tinyxml2 dWorldServer dNavigation) diff --git a/dWorldServer/WorldServer.cpp b/dWorldServer/WorldServer.cpp index c42486e0..cbab98d0 100644 --- a/dWorldServer/WorldServer.cpp +++ b/dWorldServer/WorldServer.cpp @@ -91,6 +91,7 @@ namespace Game { bool shouldShutdown = false; EntityManager* entityManager = nullptr; dZoneManager* zoneManager = nullptr; + std::string projectVersion = PROJECT_VERSION; } // namespace Game bool chatDisabled = false; @@ -152,7 +153,7 @@ int main(int argc, char** argv) { Game::logger->SetLogDebugStatements(Game::config->GetValue("log_debug_statements") == "1"); LOG("Starting World server..."); - LOG("Version: %i.%i", PROJECT_VERSION_MAJOR, PROJECT_VERSION_MINOR); + LOG("Version: %s", Game::projectVersion.c_str()); LOG("Compiled on: %s", __TIMESTAMP__); if (Game::config->GetValue("disable_chat") == "1") chatDisabled = true; diff --git a/docker/Dockerfile b/docker/Dockerfile index 39153110..fd211291 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -33,7 +33,7 @@ ARG BUILD_THREADS=1 ARG BUILD_VERSION=171022 RUN echo "Build server" -RUN sed -i -e "s/__maria_db_connector_compile_jobs__=.*/__maria_db_connector_compile_jobs__=${BUILD_THREADS}/g" CMakeVariables.txt +RUN sed -i -e "s/MARIADB_CONNECTOR_COMPILE_JOBS=.*/MARIADB_CONNECTOR_COMPILE_JOBS=${BUILD_THREADS}/g" CMakeVariables.txt RUN mkdir -p cmake_build RUN cd cmake_build && \ cmake .. -DCMAKE_BUILD_RPATH_USE_ORIGIN=TRUE && \ diff --git a/tests/dGameTests/GameDependencies.cpp b/tests/dGameTests/GameDependencies.cpp index 32563209..ef58e367 100644 --- a/tests/dGameTests/GameDependencies.cpp +++ b/tests/dGameTests/GameDependencies.cpp @@ -11,4 +11,5 @@ namespace Game { AssetManager* assetManager = nullptr; SystemAddress chatSysAddr; EntityManager* entityManager = nullptr; + std::string projectVersion; } diff --git a/thirdparty/CMakeLists.txt b/thirdparty/CMakeLists.txt index 7b694b14..11d278c0 100644 --- a/thirdparty/CMakeLists.txt +++ b/thirdparty/CMakeLists.txt @@ -11,11 +11,17 @@ file( GLOB SOURCES_LIBBCRYPT LIST_DIRECTORIES false RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" - ${CMAKE_CURRENT_SOURCE_DIR}/libbcrypt/*.c ${CMAKE_CURRENT_SOURCE_DIR}/libbcrypt/src/*.c ) + add_library(bcrypt ${SOURCES_LIBBCRYPT}) +# Because we are not using the libbcrypt CMakeLists.txt, we need to include these headers for the library to use. +# fortunately they are only needed for building the libbcrypt directory and nothing else, so these are marked private. + +target_include_directories(bcrypt PRIVATE "libbcrypt/include") +target_include_directories(bcrypt PRIVATE "libbcrypt/src") + # Source code for sqlite add_subdirectory(SQLite) @@ -31,7 +37,7 @@ add_subdirectory(raknet) # Download Backtrace if configured if(UNIX AND NOT APPLE) include(FetchContent) - if (__include_backtrace__ AND __compile_backtrace__) + if (${INCLUDE_BACKTRACE} AND ${COMPILE_BACKTRACE}) FetchContent_Declare( backtrace GIT_REPOSITORY https://github.com/ianlancetaylor/libbacktrace.git diff --git a/thirdparty/CMakeMariaDBLists.txt b/thirdparty/CMakeMariaDBLists.txt index 81b15a6f..d7a17f28 100644 --- a/thirdparty/CMakeMariaDBLists.txt +++ b/thirdparty/CMakeMariaDBLists.txt @@ -93,7 +93,7 @@ else() # Build from source -DINSTALL_PLUGINDIR=plugin ${MARIADB_EXTRA_CMAKE_ARGS} PREFIX "${PROJECT_BINARY_DIR}/mariadbcpp" - BUILD_COMMAND cmake --build . --config RelWithDebInfo -j${__maria_db_connector_compile_jobs__} + BUILD_COMMAND cmake --build . --config RelWithDebInfo -j${MARIADB_CONNECTOR_COMPILE_JOBS} INSTALL_COMMAND "") ExternalProject_Get_Property(mariadb_connector_cpp BINARY_DIR)