Fixes Windows build
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/tag Build is passing Details

This commit is contained in:
Deukhoofd 2022-03-12 14:04:45 +01:00
parent 2e9248ff18
commit 71d77350d5
Signed by: Deukhoofd
GPG Key ID: F63E044490819F6F
2 changed files with 16 additions and 6 deletions

View File

@ -37,8 +37,6 @@ include_directories(${Angelscript_SOURCE_DIR}/angelscript/include)
include_directories(${Angelscript_SOURCE_DIR}/add_on) include_directories(${Angelscript_SOURCE_DIR}/add_on)
include_directories(${CMAKE_CURRENT_BINARY_DIR}/include/)
include_directories(${PkmnLib_BINARY_DIR}/include/)
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
add_compile_options(-fconcepts) add_compile_options(-fconcepts)
@ -48,11 +46,21 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
add_link_options(-fuse-ld=lld) add_link_options(-fuse-ld=lld)
endif () endif ()
set(SRC_FILES_PATTERN src/*.cpp src/*.hpp)
file(GLOB_RECURSE SRC_FILES src/*.cpp src/*.hpp extern/AngelscriptDebugger/src/*.cpp) if (NOT WINDOWS)
set(SRC_FILES_PATTERN ${SRC_FILES_PATTERN} extern/AngelscriptDebugger/src/*.cpp)
endif()
file(GLOB_RECURSE SRC_FILES ${SRC_FILES_PATTERN})
add_executable(PokemonScriptTester ${SRC_FILES}) add_executable(PokemonScriptTester ${SRC_FILES})
target_include_directories(PokemonScriptTester PUBLIC ${CMAKE_CURRENT_BINARY_DIR}/include/)
target_include_directories(PokemonScriptTester PUBLIC ${PkmnLib_BINARY_DIR}/include/)
target_link_directories(PokemonScriptTester PUBLIC ${Angelscript_BINARY_DIR})
add_definitions(-DLEVEL_U8) add_definitions(-DLEVEL_U8)
ADD_DEFINITIONS(-DANGELSCRIPT_DEBUGGER) if (NOT WINDOWS)
ADD_DEFINITIONS(-DANGELSCRIPT_DEBUGGER)
endif()
SET(_LINKS -static pkmnLib Arbutils) SET(_LINKS -static pkmnLib Arbutils)

View File

@ -34,9 +34,10 @@ public:
} }
} }
i32 RunAll(bool waitForDebugger) { i32 RunAll([[maybe_unused]]bool waitForDebugger) {
auto ctx = _scriptResolver->GetContextPool()->RequestContext(); auto ctx = _scriptResolver->GetContextPool()->RequestContext();
ctx->SetUserData(_scriptResolver->GetUserdata()); ctx->SetUserData(_scriptResolver->GetUserdata());
#if ANGELSCRIPT_DEBUGGER
_scriptResolver->SetDebugger(new AngelscriptDebugger()); _scriptResolver->SetDebugger(new AngelscriptDebugger());
auto& debugger = *_scriptResolver->GetDebugger().GetValue(); auto& debugger = *_scriptResolver->GetDebugger().GetValue();
debugger.Run(8684); debugger.Run(8684);
@ -48,6 +49,7 @@ public:
} }
std::this_thread::sleep_for(std::chrono::milliseconds(500)); std::this_thread::sleep_for(std::chrono::milliseconds(500));
} }
#endif
for (auto& test : _tests) { for (auto& test : _tests) {
test.second->Run(ctx); test.second->Run(ctx);