1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-04-27 22:57:45 +00:00

Merge pull request #249 from GokuWeedLord/feature/wsl

fix script builds and logging issues on WSL
This commit is contained in:
Mordred 2018-02-09 12:31:18 +01:00 committed by GitHub
commit 8573bfa7db
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 13 additions and 10 deletions

View file

@ -739,7 +739,7 @@ void defaultGet( shared_ptr<HttpServer::Response> response, shared_ptr<HttpServe
int main( int argc, char* argv[] ) int main( int argc, char* argv[] )
{ {
g_log.setLogPath( "log\\SapphireAPI" ); g_log.setLogPath( "log/SapphireAPI" );
g_log.init(); g_log.init();
g_log.info( "===========================================================" ); g_log.info( "===========================================================" );

View file

@ -54,7 +54,7 @@ namespace Core {
void ServerLobby::run( int32_t argc, char* argv[] ) void ServerLobby::run( int32_t argc, char* argv[] )
{ {
g_log.setLogPath( "log\\SapphireLobby" ); g_log.setLogPath( "log/SapphireLobby" );
g_log.init(); g_log.init();
g_log.info( "===========================================================" ); g_log.info( "===========================================================" );

View file

@ -21,7 +21,8 @@ foreach(_scriptDir ${children})
if(IS_DIRECTORY ${_scriptDir} AND NOT ${_name} MATCHES "CMakeFiles") if(IS_DIRECTORY ${_scriptDir} AND NOT ${_name} MATCHES "CMakeFiles")
message("discovered plugin lib: ${_scriptDir} (${_name})") message("discovered plugin lib: ${_scriptDir} (${_name})")
file(GLOB_RECURSE SCRIPT_FILES "${_scriptDir}/*.cpp") file(GLOB_RECURSE SCRIPT_BUILD_FILES "${_scriptDir}/*.cpp")
file(GLOB_RECURSE SCRIPT_FILES RELATIVE "${_scriptDir}" "${_name}/*.cpp")
# build file list # build file list
foreach(_script ${SCRIPT_FILES}) foreach(_script ${SCRIPT_FILES})
@ -38,7 +39,7 @@ foreach(_scriptDir ${children})
endif() endif()
endforeach() endforeach()
add_library("script_${_name}" MODULE "${SCRIPT_FILES}" "${SCRIPT_INCLUDE_FILES}" "${_scriptDir}/ScriptLoader.cpp") add_library("script_${_name}" MODULE "${SCRIPT_BUILD_FILES}" "${SCRIPT_INCLUDE_FILES}" "${_scriptDir}/ScriptLoader.cpp")
target_link_libraries("script_${_name}" sapphire_zone) target_link_libraries("script_${_name}" sapphire_zone)
if(MSVC) if(MSVC)
@ -55,11 +56,13 @@ foreach(_scriptDir ${children})
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/ScriptLoader.cpp.in" "${_scriptDir}/ScriptLoader.cpp") configure_file("${CMAKE_CURRENT_SOURCE_DIR}/ScriptLoader.cpp.in" "${_scriptDir}/ScriptLoader.cpp")
if(MSVC)
add_custom_command(TARGET "script_${_name}" POST_BUILD add_custom_command(TARGET "script_${_name}" POST_BUILD
COMMAND ${CMAKE_COMMAND} -E remove "${SCRIPT_LIB_DIR}/script_${_name}.exp" COMMAND ${CMAKE_COMMAND} -E remove "${SCRIPT_LIB_DIR}/script_${_name}.exp"
COMMAND ${CMAKE_COMMAND} -E remove "${SCRIPT_LIB_DIR}/script_${_name}.lib" COMMAND ${CMAKE_COMMAND} -E remove "${SCRIPT_LIB_DIR}/script_${_name}.lib"
COMMAND ${CMAKE_COMMAND} -E remove "${SCRIPT_LIB_DIR}/script_${_name}.ilk" COMMAND ${CMAKE_COMMAND} -E remove "${SCRIPT_LIB_DIR}/script_${_name}.ilk"
) )
endif()
unset(ScriptIncludes) unset(ScriptIncludes)
unset(ScriptNames) unset(ScriptNames)

View file

@ -193,7 +193,7 @@ bool Core::ServerZone::loadSettings( int32_t argc, char* argv[] )
void Core::ServerZone::run( int32_t argc, char* argv[] ) void Core::ServerZone::run( int32_t argc, char* argv[] )
{ {
// TODO: add more error checks for the entire initialisation // TODO: add more error checks for the entire initialisation
g_log.setLogPath( "log\\SapphireZone_" ); g_log.setLogPath( "log/SapphireZone_" );
g_log.init(); g_log.init();
printBanner(); printBanner();