Enhance CMake configuration for macOS and emulator build

- Added checks to conditionally set the DMG background image and DS Store setup script only if the files exist, improving robustness in packaging.
- Updated the emulator build configuration to skip unnecessary steps in minimal builds, ensuring cleaner builds and better resource management.
- Streamlined target include directories and linking for the emulator, maintaining modularity and clarity in the CMake setup.
This commit is contained in:
scawful
2025-09-26 17:37:49 -04:00
parent a53e759043
commit 9e3a5778aa
2 changed files with 40 additions and 33 deletions

View File

@@ -64,8 +64,12 @@ elseif(APPLE)
set(CPACK_PACKAGE_FILE_NAME "yaze-${CPACK_PACKAGE_VERSION}-macos") set(CPACK_PACKAGE_FILE_NAME "yaze-${CPACK_PACKAGE_VERSION}-macos")
# macOS app bundle configuration # macOS app bundle configuration
if(EXISTS "${CMAKE_SOURCE_DIR}/assets/dmg_background.png")
set(CPACK_DMG_BACKGROUND_IMAGE "${CMAKE_SOURCE_DIR}/assets/dmg_background.png") set(CPACK_DMG_BACKGROUND_IMAGE "${CMAKE_SOURCE_DIR}/assets/dmg_background.png")
endif()
if(EXISTS "${CMAKE_SOURCE_DIR}/cmake/dmg_setup.scpt")
set(CPACK_DMG_DS_STORE_SETUP_SCRIPT "${CMAKE_SOURCE_DIR}/cmake/dmg_setup.scpt") set(CPACK_DMG_DS_STORE_SETUP_SCRIPT "${CMAKE_SOURCE_DIR}/cmake/dmg_setup.scpt")
endif()
elseif(UNIX) elseif(UNIX)
# Linux DEB/RPM configuration # Linux DEB/RPM configuration

View File

@@ -1,5 +1,5 @@
# Yaze Emulator Standalone Application # Yaze Emulator Standalone Application (skip in minimal builds)
if (APPLE) if (NOT YAZE_MINIMAL_BUILD AND APPLE)
add_executable( add_executable(
yaze_emu yaze_emu
MACOSX_BUNDLE MACOSX_BUNDLE
@@ -16,7 +16,7 @@ if (APPLE)
${IMGUI_SRC} ${IMGUI_SRC}
) )
target_link_libraries(yaze_emu PUBLIC ${COCOA_LIBRARY}) target_link_libraries(yaze_emu PUBLIC ${COCOA_LIBRARY})
else() elseif(NOT YAZE_MINIMAL_BUILD)
add_executable( add_executable(
yaze_emu yaze_emu
app/rom.cc app/rom.cc
@@ -32,6 +32,8 @@ else()
) )
endif() endif()
# Only configure emulator target if it was created
if(NOT YAZE_MINIMAL_BUILD)
target_include_directories( target_include_directories(
yaze_emu PUBLIC yaze_emu PUBLIC
${CMAKE_SOURCE_DIR}/src/lib/ ${CMAKE_SOURCE_DIR}/src/lib/
@@ -63,3 +65,4 @@ if(YAZE_ENABLE_UI_TESTS)
else() else()
target_compile_definitions(yaze_emu PRIVATE YAZE_ENABLE_IMGUI_TEST_ENGINE=0) target_compile_definitions(yaze_emu PRIVATE YAZE_ENABLE_IMGUI_TEST_ENGINE=0)
endif() endif()
endif()