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:
@@ -64,8 +64,12 @@ elseif(APPLE)
|
||||
set(CPACK_PACKAGE_FILE_NAME "yaze-${CPACK_PACKAGE_VERSION}-macos")
|
||||
|
||||
# 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")
|
||||
endif()
|
||||
if(EXISTS "${CMAKE_SOURCE_DIR}/cmake/dmg_setup.scpt")
|
||||
set(CPACK_DMG_DS_STORE_SETUP_SCRIPT "${CMAKE_SOURCE_DIR}/cmake/dmg_setup.scpt")
|
||||
endif()
|
||||
|
||||
elseif(UNIX)
|
||||
# Linux DEB/RPM configuration
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# Yaze Emulator Standalone Application
|
||||
if (APPLE)
|
||||
# Yaze Emulator Standalone Application (skip in minimal builds)
|
||||
if (NOT YAZE_MINIMAL_BUILD AND APPLE)
|
||||
add_executable(
|
||||
yaze_emu
|
||||
MACOSX_BUNDLE
|
||||
@@ -16,7 +16,7 @@ if (APPLE)
|
||||
${IMGUI_SRC}
|
||||
)
|
||||
target_link_libraries(yaze_emu PUBLIC ${COCOA_LIBRARY})
|
||||
else()
|
||||
elseif(NOT YAZE_MINIMAL_BUILD)
|
||||
add_executable(
|
||||
yaze_emu
|
||||
app/rom.cc
|
||||
@@ -32,6 +32,8 @@ else()
|
||||
)
|
||||
endif()
|
||||
|
||||
# Only configure emulator target if it was created
|
||||
if(NOT YAZE_MINIMAL_BUILD)
|
||||
target_include_directories(
|
||||
yaze_emu PUBLIC
|
||||
${CMAKE_SOURCE_DIR}/src/lib/
|
||||
@@ -63,3 +65,4 @@ if(YAZE_ENABLE_UI_TESTS)
|
||||
else()
|
||||
target_compile_definitions(yaze_emu PRIVATE YAZE_ENABLE_IMGUI_TEST_ENGINE=0)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
Reference in New Issue
Block a user