diff --git a/CMakeLists.txt b/CMakeLists.txt index cf2bf03d..3242602a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,6 +5,7 @@ project(yaze VERSION 0.2.0) # Build Flags set(YAZE_BUILD_APP ON) +set(YAZE_BUILD_EMU ON) set(YAZE_BUILD_Z3ED ON) set(YAZE_BUILD_PYTHON ON) set(YAZE_BUILD_CLIB ON) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 0ca99b15..924a7ae5 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -71,6 +71,10 @@ if (YAZE_BUILD_APP) include(app/app.cmake) endif() +if (YAZE_BUILD_EMU) + include(app/emu/CMakeLists.txt) +endif() + if (YAZE_BUILD_Z3ED) include(cli/z3ed.cmake) endif() diff --git a/src/app/emu/CMakeLists.txt b/src/app/emu/CMakeLists.txt index 844e76f4..f4a3de04 100644 --- a/src/app/emu/CMakeLists.txt +++ b/src/app/emu/CMakeLists.txt @@ -20,4 +20,12 @@ target_include_directories( ${SDL2_INCLUDE_DIR} ) -target_link_libraries(yaze_emu PUBLIC ${ABSL_TARGETS} ${SDL_TARGETS} ${PNG_LIBRARIES} ${CMAKE_DL_LIBS} ImGui) \ No newline at end of file +target_link_libraries( + yaze_emu PUBLIC + ${ABSL_TARGETS} + ${SDL_TARGETS} + ${PNG_LIBRARIES} + ${CMAKE_DL_LIBS} + ImGui + ImGuiTestEngine +) \ No newline at end of file diff --git a/src/app/emu/debug/emu.cc b/src/app/emu/debug/emu.cc index 068db31b..4424fc9e 100644 --- a/src/app/emu/debug/emu.cc +++ b/src/app/emu/debug/emu.cc @@ -28,6 +28,7 @@ #include "imgui_memory_editor.h" using namespace yaze::app; +using yaze::app::core::SDL_Deleter; int main(int argc, char **argv) { absl::InitializeSymbolizer(argv[0]); @@ -37,8 +38,8 @@ int main(int argc, char **argv) { options.alarm_on_failure_secs = true; absl::InstallFailureSignalHandler(options); - std::unique_ptr window_; - std::unique_ptr renderer_; + std::unique_ptr window_; + std::unique_ptr renderer_; if (SDL_Init(SDL_INIT_EVERYTHING) != 0) { return EXIT_FAILURE; } else { @@ -47,23 +48,23 @@ int main(int argc, char **argv) { int screenWidth = displayMode.w * 0.8; int screenHeight = displayMode.h * 0.8; - window_ = std::unique_ptr( + window_ = std::unique_ptr( SDL_CreateWindow("Yaze Emulator", // window title SDL_WINDOWPOS_UNDEFINED, // initial x position SDL_WINDOWPOS_UNDEFINED, // initial y position 512, // width, in pixels 480, // height, in pixels SDL_WINDOW_RESIZABLE | SDL_WINDOW_ALLOW_HIGHDPI), - sdl_deleter()); + SDL_Deleter()); if (window_ == nullptr) { return EXIT_FAILURE; } } - renderer_ = std::unique_ptr( + renderer_ = std::unique_ptr( SDL_CreateRenderer(window_.get(), -1, SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC), - sdl_deleter()); + SDL_Deleter()); if (renderer_ == nullptr) { return EXIT_FAILURE; } else {