build: Ensure bundled libraries are properly signed on macOS. (#6527)

This commit is contained in:
Steveice10 2023-05-11 12:47:18 -07:00 committed by GitHub
parent 7677ace5ea
commit dc39eac916
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -26,6 +26,10 @@ if ("${TYPE}" STREQUAL "qt")
find_program(MACDEPLOYQT_EXECUTABLE macdeployqt) find_program(MACDEPLOYQT_EXECUTABLE macdeployqt)
execute_process(COMMAND ${MACDEPLOYQT_EXECUTABLE} ${bundle_dir} -executable=${EXECUTABLE_PATH} -always-overwrite) execute_process(COMMAND ${MACDEPLOYQT_EXECUTABLE} ${bundle_dir} -executable=${EXECUTABLE_PATH} -always-overwrite)
# Bundling libraries can rewrite path information and break code signatures of system libraries.
# Perform an ad-hoc re-signing on the whole app bundle to fix this.
execute_process(COMMAND codesign --deep -fs - ${bundle_dir})
else() else()
message(FATAL_ERROR "Unsupported OS for Qt-based library bundling.") message(FATAL_ERROR "Unsupported OS for Qt-based library bundling.")
endif() endif()