diff --git a/cmake/FindMySQL.cmake b/cmake/FindMySQL.cmake index e629b8ae32..d15f7abdec 100644 --- a/cmake/FindMySQL.cmake +++ b/cmake/FindMySQL.cmake @@ -18,28 +18,39 @@ if( UNIX ) "preferred path to MySQL (mysql_config)" ) - find_program(MYSQL_CONFIG mysql_config + # try mariadb first + find_program(MYSQL_CONFIG mariadb_config ${MYSQL_CONFIG_PREFER_PATH} /usr/local/mysql/bin/ /usr/local/bin/ /usr/bin/ ) + if( NOT MYSQL_CONFIG ) + # fallback to mysql + find_program(MYSQL_CONFIG mysql_config + ${MYSQL_CONFIG_PREFER_PATH} + /usr/local/mysql/bin/ + /usr/local/bin/ + /usr/bin/ + ) + endif() + if( MYSQL_CONFIG ) message(STATUS "Using mysql-config: ${MYSQL_CONFIG}") # set INCLUDE_DIR - exec_program(${MYSQL_CONFIG} - ARGS --include + execute_process(COMMAND ${MYSQL_CONFIG} --include OUTPUT_VARIABLE MY_TMP + OUTPUT_STRIP_TRAILING_WHITESPACE ) string(REGEX REPLACE "-I([^ ]*)( .*)?" "\\1" MY_TMP "${MY_TMP}") set(MYSQL_ADD_INCLUDE_PATH ${MY_TMP} CACHE FILEPATH INTERNAL) #message("[DEBUG] MYSQL ADD_INCLUDE_PATH : ${MYSQL_ADD_INCLUDE_PATH}") # set LIBRARY_DIR - exec_program(${MYSQL_CONFIG} - ARGS --libs_r + execute_process(COMMAND ${MYSQL_CONFIG} --libs_r OUTPUT_VARIABLE MY_TMP + OUTPUT_STRIP_TRAILING_WHITESPACE ) set(MYSQL_ADD_LIBRARIES "") string(REGEX MATCHALL "-l[^ ]*" MYSQL_LIB_LIST "${MY_TMP}") diff --git a/deps/watchdog/Watchdog.h b/deps/watchdog/Watchdog.h index 08cc067881..7d5e980374 100644 --- a/deps/watchdog/Watchdog.h +++ b/deps/watchdog/Watchdog.h @@ -32,14 +32,8 @@ #include - // fucking filesystem -#if _MSC_VER >= 1925 #include namespace ci { namespace fs = std::filesystem; } -#else -#include -namespace ci { namespace fs = std::experimental::filesystem; } -#endif //! Exception for when Watchdog can't locate a file or parse the wildcard class WatchedFileSystemExc : public std::exception { diff --git a/src/api/main.cpp b/src/api/main.cpp index c21f0ddd0a..c1697b23bc 100644 --- a/src/api/main.cpp +++ b/src/api/main.cpp @@ -31,14 +31,8 @@ #include -// fucking filesystem -#if _MSC_VER >= 1925 #include namespace fs = std::filesystem; -#else -#include -namespace fs = std::experimental::filesystem; -#endif Sapphire::Common::Util::CrashHandler crashHandler; diff --git a/src/common/Config/ConfigMgr.cpp b/src/common/Config/ConfigMgr.cpp index 5d95e17f78..52808aac8b 100644 --- a/src/common/Config/ConfigMgr.cpp +++ b/src/common/Config/ConfigMgr.cpp @@ -2,13 +2,8 @@ #include #include -#if _MSC_VER >= 1925 #include namespace fs = std::filesystem; -#else -#include -namespace fs = std::experimental::filesystem; -#endif using namespace Sapphire; using namespace Sapphire::Common; @@ -94,4 +89,4 @@ bool ConfigMgr::copyDefaultConfig( const std::string& configName ) fs::copy_file( configPath.string() + m_configDefaultSuffix, configPath ); return true; -} \ No newline at end of file +} diff --git a/src/common/Logging/Logger.cpp b/src/common/Logging/Logger.cpp index 828671992d..9fc6b37bc7 100644 --- a/src/common/Logging/Logger.cpp +++ b/src/common/Logging/Logger.cpp @@ -8,13 +8,8 @@ #include // #include -#if _MSC_VER >= 1925 #include namespace fs = std::filesystem; -#else -#include -namespace fs = std::experimental::filesystem; -#endif void Sapphire::Logger::init( const std::string& logPath ) diff --git a/src/dbm/DbManager.cpp b/src/dbm/DbManager.cpp index 0f70621273..31ef313c3b 100644 --- a/src/dbm/DbManager.cpp +++ b/src/dbm/DbManager.cpp @@ -11,14 +11,8 @@ using namespace Sapphire; using namespace Sapphire::Common; -// fucking filesystem -#if _MSC_VER >= 1925 #include namespace fs = std::filesystem; -#else -#include -namespace fs = std::experimental::filesystem; -#endif DbManager::DbManager( const std::string& host, const std::string& database, const std::string& user, const std::string& pw, uint16_t port ) : diff --git a/src/dbm/main.cpp b/src/dbm/main.cpp index 7eaff90312..dd28ef9f05 100644 --- a/src/dbm/main.cpp +++ b/src/dbm/main.cpp @@ -9,14 +9,8 @@ Sapphire::Common::Util::CrashHandler crashHandler; -// fucking filesystem -#if _MSC_VER >= 1925 #include namespace filesys = std::filesystem; -#else -#include -namespace filesys = std::experimental::filesystem; -#endif #include #include