Compare commits

...

5 Commits

Author SHA1 Message Date
Deukhoofd 71d77350d5
Fixes Windows build
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/tag Build is passing Details
2022-03-12 14:04:45 +01:00
Deukhoofd 2e9248ff18
Only add angelscript debugger to non windows platforms
continuous-integration/drone/push Build is failing Details
2022-03-12 13:26:49 +01:00
Deukhoofd 0c82ff9e82
Only add angelscript debugger to non windows platforms
continuous-integration/drone/push Build is failing Details
continuous-integration/drone/tag Build was killed Details
2022-03-12 13:06:54 +01:00
Deukhoofd 44e850cfc7
Update builddata
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/tag Build is failing Details
2022-02-19 15:08:38 +01:00
Deukhoofd 810968354e
Use newer BuildData
continuous-integration/drone/push Build is failing Details
continuous-integration/drone Build is passing Details
continuous-integration/drone/tag Build is passing Details
2022-02-12 19:15:52 +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)
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)
CPMAddPackage(
NAME PkmnLib
@ -17,7 +23,7 @@ CPMAddPackage(
OPTIONS
"SHARED=${SHARED}"
"WINDOWS=${WINDOWS}"
"ANGELSCRIPT_DEBUGGER ON"
"ANGELSCRIPT_DEBUGGER=${ANGELSCRIPT_DEBUGGER}"
)
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(${CMAKE_CURRENT_BINARY_DIR}/include/)
include_directories(${PkmnLib_BINARY_DIR}/include/)
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
add_compile_options(-fconcepts)
@ -42,13 +46,27 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
add_link_options(-fuse-ld=lld)
endif ()
file(GLOB_RECURSE SRC_FILES src/*.cpp src/*.hpp extern/AngelscriptDebugger/src/*.cpp)
set(SRC_FILES_PATTERN src/*.cpp src/*.hpp)
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_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)
SET(_LINKS ${_LINKS} -Wl,-Bstatic -lgcc -lstdc++ -lpthread -Wl,-Bdynamic)

@ -1 +1 @@
Subproject commit e2edf6129dd3c2feb44bf5ce98644b26da9609f8
Subproject commit fd24ce63c1113eef37d6153ad295928b700545fa

View File

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