diff --git a/cmake/presets/os-macos.json b/cmake/presets/os-macos.json index 9cacff7b76..0e089e8f1d 100644 --- a/cmake/presets/os-macos.json +++ b/cmake/presets/os-macos.json @@ -1,6 +1,8 @@ { "version": 6, - "include": [ "common.json" ], + "include": [ + "common.json" + ], "configurePresets": [ { "name": "macos-common", @@ -21,12 +23,18 @@ { "name": "macos-debug", "displayName": "MacOS - Debug", - "inherits": ["macos-common", "debug"] + "inherits": [ + "macos-common", + "debug" + ] }, { "name": "macos-release", "displayName": "MacOS - Release", - "inherits": ["macos-common", "release"] + "inherits": [ + "macos-common", + "release" + ] } ], "buildPresets": [ @@ -45,7 +53,9 @@ { "name": "macos-debug", "configurePreset": "macos-debug", - "output": {"outputOnFailure": true}, + "output": { + "outputOnFailure": true + }, "execution": { "noTestsAction": "error", "stopOnFailure": true @@ -56,7 +66,10 @@ { "name": "macos-release", "configurePreset": "macos-release", - "generators": [ "DragNDrop" ] + "generators": [ + "DragNDrop" + ] } ] } + diff --git a/src/contour/CMakeLists.txt b/src/contour/CMakeLists.txt index 98fd3ae058..a5ea0923a0 100644 --- a/src/contour/CMakeLists.txt +++ b/src/contour/CMakeLists.txt @@ -18,7 +18,7 @@ NumberToHex(${PROJECT_VERSION_PATCH} HEX_PATCH) # {{{ Setup QT_COMPONENTS # QT_COMPONENTS is the list of Qt libraries Contour requires for building. # NB: Widgets is rquired for SystemTrayIcon's fallback implementation -set(QT_COMPONENTS Core Gui Qml Quick QuickControls2 Network Multimedia Widgets OpenGL OpenGLWidgets Core5Compat) +set(QT_COMPONENTS Core Gui DBus Qml Quick QuickControls2 QuickTemplates2 DBus Network Multimedia Widgets OpenGL OpenGLWidgets Core5Compat) # }}} message(STATUS "Qt components: ${QT_COMPONENTS}") @@ -189,12 +189,14 @@ if(CONTOUR_FRONTEND_GUI) vtrasterizer ContourTerminalDisplay Qt6::Core5Compat + Qt6::DBus Qt6::Multimedia Qt6::Network Qt6::OpenGL Qt6::Qml Qt6::QuickControls2 Qt6::Widgets + Qt6::QuickTemplates2 ) if(OPENBSD) @@ -405,7 +407,22 @@ elseif(APPLE) -verbose=1 -no-strip -qmldir=${CMAKE_CURRENT_SOURCE_DIR}/ui - \"-codesign=${CODE_SIGN_CERTIFICATE_ID}\" + ) + # -codesign=\"${CODE_SIGN_CERTIFICATE_ID}\" + # MacDeployQt's -codesign=XXX option is simply executing codesign. + # So we can do it safely ourself as follows: + execute_process( + COMMAND codesign + --force + --verbose + --deep + --options=runtime + --timestamp + --strict + --preserve-metadata=identifier,entitlements + --entitlements \"${PROJECT_SOURCE_DIR}/support/macOS/entitlements.plist\" + --sign \"${CODE_SIGN_CERTIFICATE_ID}\" + \"${CMAKE_INSTALL_PREFIX}/contour.app\" ) ") else() diff --git a/support/macOS/entitlements.plist b/support/macOS/entitlements.plist new file mode 100644 index 0000000000..777b3abd95 --- /dev/null +++ b/support/macOS/entitlements.plist @@ -0,0 +1,10 @@ + + + + + com.apple.security.cs.allow-jit + + com.apple.security.cs.disable-library-validation + + +