From 8f01f6c679c0dfdc123b076778659faf1db871a3 Mon Sep 17 00:00:00 2001 From: CocoSimone Date: Sat, 11 Feb 2023 18:04:28 +0100 Subject: [PATCH] fix windows CI (disable gdb stub) --- external/imgui/CMakeLists.txt | 8 ++++---- src/CMakeLists.txt | 25 ++++--------------------- src/backend/CMakeLists.txt | 6 +++++- src/backend/Core.hpp | 2 +- src/backend/Debugger.cpp | 21 ++++++++++++++++++++- src/backend/Debugger.hpp | 8 ++++++-- src/backend/core/Audio.cpp | 2 +- src/frontend/imgui/Window.cpp | 3 ++- src/frontend/imgui/Window.hpp | 1 - 9 files changed, 43 insertions(+), 33 deletions(-) diff --git a/external/imgui/CMakeLists.txt b/external/imgui/CMakeLists.txt index 64f65664..c656c4fc 100644 --- a/external/imgui/CMakeLists.txt +++ b/external/imgui/CMakeLists.txt @@ -12,10 +12,10 @@ add_library(imgui imgui/backends/imgui_impl_vulkan.h imgui/backends/imgui_impl_vulkan.cpp) -if(WIN32) - target_compile_definitions(imgui PUBLIC NOMINMAX _CRT_SECURE_NO_WARNINGS) - target_compile_options(imgui PUBLIC /EHa) -endif() +#if(WIN32) +# target_compile_definitions(imgui PUBLIC NOMINMAX _CRT_SECURE_NO_WARNINGS) +# target_compile_options(imgui PUBLIC /EHa) +#endif() target_include_directories(imgui PUBLIC ../parallel-rdp/parallel-rdp-standalone/volk ../parallel-rdp/parallel-rdp-standalone/vulkan-headers/include) \ No newline at end of file diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 62563454..da04a693 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -61,28 +61,11 @@ file(REMOVE ${PROJECT_BINARY_DIR}/resources/shader.frag ${PROJECT_BINARY_DIR}/resources/shader.vert) +target_link_libraries(gadolinium PUBLIC frontend frontend-imgui + discord-rpc imgui nfd parallel-rdp backend fmt::fmt nlohmann_json::nlohmann_json core dynarec registers interpreter mmio rsp SDL2::SDL2main SDL2::SDL2) + if(WIN32) target_compile_definitions(gadolinium PUBLIC NOMINMAX _CRT_SECURE_NO_WARNINGS) target_compile_options(gadolinium PUBLIC /EHa) target_link_libraries(gadolinium PUBLIC ws2_32) -endif() - -if(${CMAKE_BUILD_TYPE} MATCHES Release) - set_property(TARGET gadolinium PROPERTY INTERPROCEDURAL_OPTIMIZATION TRUE) - if(WIN32) - target_compile_options(gadolinium PRIVATE /O2) - else() - target_compile_options(gadolinium PRIVATE -O3) - endif() -else() - if(WIN32) - target_compile_options(gadolinium PRIVATE /Od) - else() - #target_compile_options(gadolinium PRIVATE -fsanitize=address) - #target_link_options(gadolinium PRIVATE -fsanitize=address) - target_compile_options(gadolinium PRIVATE -g) - endif() -endif() - -target_link_libraries(gadolinium PUBLIC SDL2::SDL2main SDL2::SDL2 frontend frontend-imgui - discord-rpc imgui nfd parallel-rdp backend fmt::fmt nlohmann_json::nlohmann_json core dynarec registers interpreter mmio rsp) \ No newline at end of file +endif() \ No newline at end of file diff --git a/src/backend/CMakeLists.txt b/src/backend/CMakeLists.txt index 5206b441..ee2d2391 100644 --- a/src/backend/CMakeLists.txt +++ b/src/backend/CMakeLists.txt @@ -1,4 +1,8 @@ file(GLOB SOURCES *.cpp) file(GLOB HEADERS *.hpp) -add_library(backend ${SOURCES} ${HEADERS}) \ No newline at end of file +add_library(backend ${SOURCES} ${HEADERS}) + +if(WIN32) + target_compile_definitions(backend PUBLIC DISABLE_GDB_STUB) +endif() \ No newline at end of file diff --git a/src/backend/Core.hpp b/src/backend/Core.hpp index d7bd651c..fb0b2304 100644 --- a/src/backend/Core.hpp +++ b/src/backend/Core.hpp @@ -6,7 +6,7 @@ #include #include #include -#include +#include struct Window; diff --git a/src/backend/Debugger.cpp b/src/backend/Debugger.cpp index ef32eed6..959222e9 100644 --- a/src/backend/Debugger.cpp +++ b/src/backend/Debugger.cpp @@ -1,4 +1,6 @@ #include + +#ifndef DISABLE_GDB_STUB #define GDBSTUB_IMPLEMENTATION #include #include @@ -254,7 +256,7 @@ Debugger::Debugger(n64::Core& core) : core(core) { gdb = gdbstub_init(config); if (!gdb) { - Util::panic("Failed to initialize GDB stub!"); + Util::panic("Failed to initialize GDB stub!\n"); } } @@ -272,3 +274,20 @@ void Debugger::breakpointHit() { broken = true; gdbstub_breakpoint_hit(gdb); } +#else +Debugger::Debugger(n64::Core& core) { + +} + +Debugger::~Debugger() { + +} + +void Debugger::tick() const { + +} + +void Debugger::breakpointHit() { + +} +#endif \ No newline at end of file diff --git a/src/backend/Debugger.hpp b/src/backend/Debugger.hpp index 53d99728..7016db7c 100644 --- a/src/backend/Debugger.hpp +++ b/src/backend/Debugger.hpp @@ -12,7 +12,9 @@ namespace n64 { struct Core; } struct Debugger { Debugger(n64::Core& core); ~Debugger(); - bool broken = false, enabled = true; + + bool broken = false, enabled = true; +#ifndef DISABLE_GDB_STUB int steps = 0; gdbstub_t* gdb; Breakpoint* breakpoints = nullptr; @@ -28,7 +30,9 @@ struct Debugger { } return false; } - +#else + inline bool checkBreakpoint(u32 address) const { return false; } +#endif void tick() const; void breakpointHit(); }; \ No newline at end of file diff --git a/src/backend/core/Audio.cpp b/src/backend/core/Audio.cpp index 54c81ef5..33269541 100644 --- a/src/backend/core/Audio.cpp +++ b/src/backend/core/Audio.cpp @@ -1,5 +1,5 @@ #include -#include +#include #include namespace n64 { diff --git a/src/frontend/imgui/Window.cpp b/src/frontend/imgui/Window.cpp index 2483a8de..546a0b27 100644 --- a/src/frontend/imgui/Window.cpp +++ b/src/frontend/imgui/Window.cpp @@ -3,7 +3,8 @@ #include #include #include -#include +#define SDL_MAIN_HANDLED +#include #include #include #include diff --git a/src/frontend/imgui/Window.hpp b/src/frontend/imgui/Window.hpp index 63ba357a..bf1551a8 100644 --- a/src/frontend/imgui/Window.hpp +++ b/src/frontend/imgui/Window.hpp @@ -1,5 +1,4 @@ #pragma once -#define SDL_MAIN_HANDLED #include #include #include