macOS build: add ad-hoc signature to test program bundles.

Unsigned bundles behave incorrectly when the app calls fl_open_callback()
and a file is dragged on the bundle icon to launch it: a delay of several seconds
occurs before the app shows its GUI.
This commit is contained in:
ManoloFLTK
2026-02-26 16:14:56 +01:00
parent 47b9156ac7
commit d42d9bf73e
+3
View File
@@ -102,6 +102,9 @@ function(fl_create_example NAME SOURCES LIBRARIES)
if(MAC_BUNDLE)
add_executable (${TARGET_NAME} MACOSX_BUNDLE ${srcs} ${ICON_PATH})
# add ad-hoc signature
add_custom_command (TARGET ${TARGET_NAME} POST_BUILD COMMAND
codesign -s - ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/${TARGET_NAME}.app)
else()
add_executable (${TARGET_NAME} WIN32 ${srcs})
endif(MAC_BUNDLE)