mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-04-27 14:57:44 +00:00
Merge pull request #864 from takhlaq/ThreePointThree
[draft] fix typo in scripts cmake
This commit is contained in:
commit
54f3ffa063
3 changed files with 8 additions and 7 deletions
|
@ -64,15 +64,15 @@ foreach(_scriptDir ${children})
|
|||
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}.ilk"
|
||||
COMMAND ${CMAKE_COMMAND} -E copy "${SCRIPT_LIB_DIR}/script_${_name}.dll" ${SCRIPT_POSTBUILD_DIR}${ScriptTargetName}.dll_LOCK
|
||||
COMMAND ${CMAKE_COMMAND} -E copy "${SCRIPT_LIB_DIR}/script_${_name}.dll" ${SCRIPT_POSTBUILD_DIR}${ScriptTargetName}_LOCK
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different "${SCRIPT_LIB_DIR}/script_${_name}.dll" ${SCRIPT_POSTBUILD_DIR}${ScriptTargetName}.dll
|
||||
COMMAND ${CMAKE_COMMAND} -E remove ${SCRIPT_POSTBUILD_DIR}${ScriptTargetName}.dll_LOCK
|
||||
COMMAND ${CMAKE_COMMAND} -E remove ${SCRIPT_POSTBUILD_DIR}${ScriptTargetName}_LOCK
|
||||
)
|
||||
else()
|
||||
add_custom_command(TARGET "script_${_name}" POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:${ScriptTargetName}> ${SCRIPT_POSTBUILD_DIR}_LOCK
|
||||
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:${ScriptTargetName}> ${SCRIPT_POSTBUILD_DIR}${ScriptTargetName}_LOCK
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different $<TARGET_FILE:${ScriptTargetName}> ${SCRIPT_POSTBUILD_DIR}
|
||||
COMMAND ${CMAKE_COMMAND} -E remove ${SCRIPT_POSTBUILD_DIR}$<TARGET_FILE_NAME:${ScriptTargetName}>_LOCK
|
||||
COMMAND ${CMAKE_COMMAND} -E remove ${SCRIPT_POSTBUILD_DIR}${ScriptTargetName}_LOCK
|
||||
)
|
||||
endif()
|
||||
|
||||
|
|
|
@ -81,6 +81,8 @@ namespace Sapphire::Scripting
|
|||
|
||||
void NativeScriptMgr::queueScriptReload( const std::string& name )
|
||||
{
|
||||
std::scoped_lock lock( m_mutex );
|
||||
|
||||
auto info = m_loader.getScriptInfo( name );
|
||||
if( !info )
|
||||
return;
|
||||
|
@ -91,7 +93,6 @@ namespace Sapphire::Scripting
|
|||
if( !unloadScript( info ) )
|
||||
return;
|
||||
|
||||
std::scoped_lock lock( m_mutex );
|
||||
m_scriptLoadQueue.push( libPath );
|
||||
}
|
||||
|
||||
|
|
|
@ -75,7 +75,8 @@ Sapphire::Scripting::ScriptInfo* Sapphire::Scripting::ScriptLoader::loadModule(
|
|||
fs::path dest( cacheDir /= f.filename().string() );
|
||||
|
||||
// make sure the module has finished building before trying to copy it
|
||||
if( fs::exists( f.string() + "_LOCK" ) )
|
||||
const std::string readyFile( ( f.parent_path() / f.stem() ).string() + "_LOCK" );
|
||||
if( fs::exists( readyFile ) )
|
||||
return nullptr;
|
||||
|
||||
try
|
||||
|
@ -112,7 +113,6 @@ Sapphire::Scripting::ScriptInfo* Sapphire::Scripting::ScriptLoader::loadModule(
|
|||
info->library_path = f.string();
|
||||
|
||||
m_scriptMap.insert( std::make_pair( f.stem().string(), info ) );
|
||||
|
||||
return info;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue