Embed bundled resources without compiling large C++ arrays [skip ci] (#7730)

This commit is contained in:
Bryce! 2026-11-04 09:27:44 -05:00 • committed by GitHub
parent 7ca697348b
commit 67330ead5a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -495,7 +495,15 @@ if(APPLE)
set(cockatrice_SOURCES ${cockatrice_SOURCES} ${CMAKE_CURRENT_SOURCE_DIR}/resources/appicon.icns)
endif(APPLE)
# The fonts and card artwork produce a large C++ byte array with qt_add_resources.
# Embed the data in the compiled resource object instead, keeping compiler memory
# independent of that payload. Qt's two-pass resource build is unsupported on iOS.
if(IOS)
qt_add_resources(cockatrice_RESOURCES_RCC ${cockatrice_RESOURCES})
else()
qt_add_big_resources(cockatrice_RESOURCES_RCC ${cockatrice_RESOURCES})
endif()
set_source_files_properties(${cockatrice_RESOURCES} PROPERTIES SKIP_AUTORCC ON)
# Declare path variables
set(ICONDIR
@ -521,6 +529,7 @@ qt_add_executable(
WIN32
MACOSX_BUNDLE
${cockatrice_SOURCES}
${cockatrice_RESOURCES}
${cockatrice_RESOURCES_RCC}
${cockatrice_MOC_SRCS}
MANUAL_FINALIZATION