mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-05-02 00:47:45 +00:00
commit
c1fdf38587
7 changed files with 17 additions and 40 deletions
|
@ -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}")
|
||||
|
|
6
deps/watchdog/Watchdog.h
vendored
6
deps/watchdog/Watchdog.h
vendored
|
@ -32,14 +32,8 @@
|
|||
|
||||
#include <functional>
|
||||
|
||||
// fucking filesystem
|
||||
#if _MSC_VER >= 1925
|
||||
#include <filesystem>
|
||||
namespace ci { namespace fs = std::filesystem; }
|
||||
#else
|
||||
#include <experimental/filesystem>
|
||||
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 {
|
||||
|
|
|
@ -31,14 +31,8 @@
|
|||
#include <Util/CrashHandler.h>
|
||||
|
||||
|
||||
// fucking filesystem
|
||||
#if _MSC_VER >= 1925
|
||||
#include <filesystem>
|
||||
namespace fs = std::filesystem;
|
||||
#else
|
||||
#include <experimental/filesystem>
|
||||
namespace fs = std::experimental::filesystem;
|
||||
#endif
|
||||
|
||||
|
||||
Sapphire::Common::Util::CrashHandler crashHandler;
|
||||
|
|
|
@ -2,13 +2,8 @@
|
|||
#include <iostream>
|
||||
#include <fstream>
|
||||
|
||||
#if _MSC_VER >= 1925
|
||||
#include <filesystem>
|
||||
namespace fs = std::filesystem;
|
||||
#else
|
||||
#include <experimental/filesystem>
|
||||
namespace fs = std::experimental::filesystem;
|
||||
#endif
|
||||
|
||||
using namespace Sapphire;
|
||||
using namespace Sapphire::Common;
|
||||
|
|
|
@ -8,13 +8,8 @@
|
|||
#include <spdlog/sinks/daily_file_sink.h>
|
||||
|
||||
// #include <iostream>
|
||||
#if _MSC_VER >= 1925
|
||||
#include <filesystem>
|
||||
namespace fs = std::filesystem;
|
||||
#else
|
||||
#include <experimental/filesystem>
|
||||
namespace fs = std::experimental::filesystem;
|
||||
#endif
|
||||
|
||||
|
||||
void Sapphire::Logger::init( const std::string& logPath )
|
||||
|
|
|
@ -11,14 +11,8 @@
|
|||
using namespace Sapphire;
|
||||
using namespace Sapphire::Common;
|
||||
|
||||
// fucking filesystem
|
||||
#if _MSC_VER >= 1925
|
||||
#include <filesystem>
|
||||
namespace fs = std::filesystem;
|
||||
#else
|
||||
#include <experimental/filesystem>
|
||||
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 ) :
|
||||
|
|
|
@ -9,14 +9,8 @@
|
|||
|
||||
Sapphire::Common::Util::CrashHandler crashHandler;
|
||||
|
||||
// fucking filesystem
|
||||
#if _MSC_VER >= 1925
|
||||
#include <filesystem>
|
||||
namespace filesys = std::filesystem;
|
||||
#else
|
||||
#include <experimental/filesystem>
|
||||
namespace filesys = std::experimental::filesystem;
|
||||
#endif
|
||||
|
||||
#include <fstream>
|
||||
#include <streambuf>
|
||||
|
|
Loading…
Add table
Reference in a new issue