From f3bb4e2358ef8026ba5bb07d69e244c875b3bb37 Mon Sep 17 00:00:00 2001 From: scawful Date: Sat, 5 Apr 2025 14:06:45 -0400 Subject: [PATCH] Refactor CMake configuration for yaze_emu: add macOS support and restructure executable definition --- src/app/emu/emu.cmake | 51 ++++++++++++++++++++++++++----------------- 1 file changed, 31 insertions(+), 20 deletions(-) diff --git a/src/app/emu/emu.cmake b/src/app/emu/emu.cmake index 6ea187dc..b7e3814c 100644 --- a/src/app/emu/emu.cmake +++ b/src/app/emu/emu.cmake @@ -1,20 +1,35 @@ -add_executable( - yaze_emu - app/rom.cc - app/emu/emu.cc - ${YAZE_APP_EMU_SRC} - ${YAZE_APP_CORE_SRC} - ${YAZE_APP_EDITOR_SRC} - ${YAZE_APP_GFX_SRC} - ${YAZE_APP_ZELDA3_SRC} - ${YAZE_UTIL_SRC} - ${YAZE_GUI_SRC} - ${IMGUI_SRC} -) - +# Yaze Emulator Standalone Application if (APPLE) - list(APPEND YAZE_APP_CORE_SRC - app/core/platform/app_delegate.mm) + add_executable( + yaze_emu + MACOSX_BUNDLE + app/main.cc + app/rom.cc + app/core/platform/app_delegate.mm + ${YAZE_APP_EMU_SRC} + ${YAZE_APP_CORE_SRC} + ${YAZE_APP_EDITOR_SRC} + ${YAZE_APP_GFX_SRC} + ${YAZE_APP_ZELDA3_SRC} + ${YAZE_UTIL_SRC} + ${YAZE_GUI_SRC} + ${IMGUI_SRC} + ) + target_link_libraries(yaze_emu PUBLIC ${COCOA_LIBRARY}) +else() + add_executable( + yaze_emu + app/rom.cc + app/emu/emu.cc + ${YAZE_APP_EMU_SRC} + ${YAZE_APP_CORE_SRC} + ${YAZE_APP_EDITOR_SRC} + ${YAZE_APP_GFX_SRC} + ${YAZE_APP_ZELDA3_SRC} + ${YAZE_UTIL_SRC} + ${YAZE_GUI_SRC} + ${IMGUI_SRC} + ) endif() target_include_directories( @@ -37,7 +52,3 @@ target_link_libraries( ImGui ImGuiTestEngine ) - -if (APPLE) - target_link_libraries(yaze_emu PUBLIC ${COCOA_LIBRARY}) -endif() \ No newline at end of file