4 Commits

Author SHA1 Message Date
71d77350d5 Fixes Windows build
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
2022-03-12 14:04:45 +01:00
2e9248ff18 Only add angelscript debugger to non windows platforms
Some checks failed
continuous-integration/drone/push Build is failing
2022-03-12 13:26:49 +01:00
0c82ff9e82 Only add angelscript debugger to non windows platforms
Some checks reported errors
continuous-integration/drone/push Build is failing
continuous-integration/drone/tag Build was killed
2022-03-12 13:06:54 +01:00
44e850cfc7 Update builddata
Some checks failed
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is failing
2022-02-19 15:08:38 +01:00
3 changed files with 30 additions and 10 deletions

View File

@@ -9,6 +9,12 @@ set(BUILD_SHARED_LIBS OFF)
option(WINDOWS "Whether the build target is Windows or not." OFF) option(WINDOWS "Whether the build target is Windows or not." OFF)
set(SHARED OFF) set(SHARED OFF)
if (WINDOWS)
SET(ANGELSCRIPT_DEBUGGER OFF)
else()
SET(ANGELSCRIPT_DEBUGGER ON)
endif()
execute_process(COMMAND mkdir -p ${CMAKE_CURRENT_BINARY_DIR}/include) execute_process(COMMAND mkdir -p ${CMAKE_CURRENT_BINARY_DIR}/include)
CPMAddPackage( CPMAddPackage(
NAME PkmnLib NAME PkmnLib
@@ -17,7 +23,7 @@ CPMAddPackage(
OPTIONS OPTIONS
"SHARED=${SHARED}" "SHARED=${SHARED}"
"WINDOWS=${WINDOWS}" "WINDOWS=${WINDOWS}"
"ANGELSCRIPT_DEBUGGER ON" "ANGELSCRIPT_DEBUGGER=${ANGELSCRIPT_DEBUGGER}"
) )
execute_process(COMMAND ln -sf ${PkmnLib_SOURCE_DIR}/src ${CMAKE_CURRENT_BINARY_DIR}/include/PkmnLib) execute_process(COMMAND ln -sf ${PkmnLib_SOURCE_DIR}/src ${CMAKE_CURRENT_BINARY_DIR}/include/PkmnLib)
@@ -31,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)
@@ -42,13 +46,27 @@ 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})
add_definitions(-DLEVEL_U8)
ADD_DEFINITIONS(-DANGELSCRIPT_DEBUGGER)
SET(_LINKS -static pkmnLib Arbutils AngelscriptDebugger) 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)
if (NOT WINDOWS)
ADD_DEFINITIONS(-DANGELSCRIPT_DEBUGGER)
endif()
SET(_LINKS -static pkmnLib Arbutils)
if (NOT WINDOWS)
SET(_LINKS ${_LINKS} AngelscriptDebugger)
endif()
if (WINDOWS) if (WINDOWS)
SET(_LINKS ${_LINKS} -Wl,-Bstatic -lgcc -lstdc++ -lpthread -Wl,-Bdynamic) SET(_LINKS ${_LINKS} -Wl,-Bstatic -lgcc -lstdc++ -lpthread -Wl,-Bdynamic)

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);