fix windows CI (disable gdb stub)

This commit is contained in:
CocoSimone
2023-02-11 18:04:28 +01:00
parent 90fd566e92
commit 8f01f6c679
9 changed files with 43 additions and 33 deletions

View File

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

View File

@@ -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)
endif()

View File

@@ -1,4 +1,8 @@
file(GLOB SOURCES *.cpp)
file(GLOB HEADERS *.hpp)
add_library(backend ${SOURCES} ${HEADERS})
add_library(backend ${SOURCES} ${HEADERS})
if(WIN32)
target_compile_definitions(backend PUBLIC DISABLE_GDB_STUB)
endif()

View File

@@ -6,7 +6,7 @@
#include <backend/core/Dynarec.hpp>
#include <backend/core/registers/Registers.hpp>
#include <Debugger.hpp>
#include <SDL_timer.h>
#include <SDL2/SDL_timer.h>
struct Window;

View File

@@ -1,4 +1,6 @@
#include <Debugger.hpp>
#ifndef DISABLE_GDB_STUB
#define GDBSTUB_IMPLEMENTATION
#include <gdbstub.h>
#include <log.hpp>
@@ -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

View File

@@ -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();
};

View File

@@ -1,5 +1,5 @@
#include <Audio.hpp>
#include <SDL_audio.h>
#include <SDL2/SDL_audio.h>
#include <log.hpp>
namespace n64 {

View File

@@ -3,7 +3,8 @@
#include <nfd.hpp>
#include <Core.hpp>
#include <Audio.hpp>
#include <SDL.h>
#define SDL_MAIN_HANDLED
#include <SDL2/SDL.h>
#include <iostream>
#include <fstream>
#include <Discord.hpp>

View File

@@ -1,5 +1,4 @@
#pragma once
#define SDL_MAIN_HANDLED
#include <ParallelRDPWrapper.hpp>
#include <imgui.h>
#include <imgui_impl_sdl.h>