From 495886e93d88fd52484c0808424303d0c6a2b1c1 Mon Sep 17 00:00:00 2001 From: scawful Date: Sat, 27 Sep 2025 00:01:33 -0400 Subject: [PATCH] Implement platform-specific file dialog source selection in CMake - Updated z3ed CMake configuration to conditionally set the file dialog source based on the platform (macOS or other). - This change simplifies the build process by using a single variable for the file dialog source, enhancing maintainability and clarity. --- src/cli/z3ed.cmake | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/cli/z3ed.cmake b/src/cli/z3ed.cmake index 37862785..acdfbb27 100644 --- a/src/cli/z3ed.cmake +++ b/src/cli/z3ed.cmake @@ -11,6 +11,13 @@ if(NOT ftxui_POPULATED) add_subdirectory(${ftxui_SOURCE_DIR} ${ftxui_BINARY_DIR} EXCLUDE_FROM_ALL) endif() +# Platform-specific file dialog sources +if(APPLE) + set(FILE_DIALOG_SRC app/core/platform/file_dialog.mm) +else() + set(FILE_DIALOG_SRC app/core/platform/file_dialog.cc) +endif() + add_executable( z3ed cli/cli_main.cc @@ -21,8 +28,7 @@ add_executable( app/rom.cc app/core/project.cc app/core/asar_wrapper.cc - app/core/platform/file_dialog.mm - app/core/platform/file_dialog.cc + ${FILE_DIALOG_SRC} ${YAZE_APP_EMU_SRC} ${YAZE_APP_GFX_SRC} ${YAZE_APP_ZELDA3_SRC}