Skip to content

Commit

Permalink
Fix compilation on macOS CI
Browse files Browse the repository at this point in the history
  • Loading branch information
oclero committed May 5, 2024
1 parent d335dbb commit 64c0a3e
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ jobs:
- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
version: "5.15.2"
version: '5.15.2'
host: mac
target: desktop
arch: clang_64

- name: Configure CMake
run: cmake --preset macos -DCMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED=OFF -DCMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY=""
run: cmake --preset macos -DCMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED=OFF -DCMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY="" -DCMAKE_XCODE_ATTRIBUTE_CODE_SIGN_STYLE="Manual"

- name: Build the library.
run: cmake --build --preset macos
Expand Down
2 changes: 1 addition & 1 deletion CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"generator": "Xcode",
"binaryDir": "${sourceDir}/_build",
"cacheVariables": {
"QT_DIR": "/opt/homebrew/opt/qt/lib/cmake/Qt6"
"QT_DIR": "/opt/homebrew/opt/qt/lib/cmake/Qt5"
},
"condition": {
"type": "equals",
Expand Down
4 changes: 4 additions & 0 deletions cmake/DeployQt.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ function(target_deploy_qt TARGET_NAME)
COMMAND ${CMAKE_COMMAND} -E echo "Deploying Qt..."
COMMAND ${QTDEPLOY_TARGET_NAME} "$<TARGET_BUNDLE_DIR:${TARGET_NAME}>" -verbose=0
)
add_custom_command(TARGET ${TARGET_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E echo "Removing unwanted codesigning made by macdeployqt..."
COMMAND codesign --remove-signature "$<TARGET_BUNDLE_DIR:${TARGET_NAME}>"
)
endif()
endif()
endif()
Expand Down
6 changes: 4 additions & 2 deletions sandbox/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,10 @@ set_target_properties(${SANDBOX_NAME} PROPERTIES
MACOSX_BUNDLE_ICON_FILE "icon.icns"
MACOSX_BUNDLE_COPYRIGHT ${PROJECT_COPYRIGHT}

XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED OFF
XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "-"
XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED "${XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED}"
XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "${XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY}"
XCODE_ATTRIBUTE_CODE_SIGN_STYLE "${XCODE_ATTRIBUTE_CODE_SIGN_STYLE}"
XCODE_ATTRIBUTE_CODE_SIGN_INJECT_BASE_ENTITLEMENTS OFF
)

target_deploy_qt(sandbox)
Expand Down

0 comments on commit 64c0a3e

Please sign in to comment.