From dc39eac91677e793e248d60ae01d2735f601751e Mon Sep 17 00:00:00 2001 From: Steveice10 <1269164+Steveice10@users.noreply.github.com> Date: Thu, 11 May 2023 12:47:18 -0700 Subject: [PATCH] build: Ensure bundled libraries are properly signed on macOS. (#6527) --- CMakeModules/BundleLibraries.cmake | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CMakeModules/BundleLibraries.cmake b/CMakeModules/BundleLibraries.cmake index aa407e12c..c2f852b24 100644 --- a/CMakeModules/BundleLibraries.cmake +++ b/CMakeModules/BundleLibraries.cmake @@ -26,6 +26,10 @@ if ("${TYPE}" STREQUAL "qt") find_program(MACDEPLOYQT_EXECUTABLE macdeployqt) 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() message(FATAL_ERROR "Unsupported OS for Qt-based library bundling.") endif()