From 250bb25d6cf288eb22d56558c27d49da1915fada Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Thu, 25 May 2023 11:43:39 +0200 Subject: [PATCH] Try to build on macOS and see what explodes --- .github/workflows/ci.yml | 83 ++++++++++++++++++++++++++++++++++++++-- CMakeLists.txt | 6 +-- 2 files changed, 81 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d8568791..27196f64 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,7 +26,7 @@ jobs: cd build cmake \ -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_INSTALL_PREFIX:PATH=../install/Launcher \ + -DCMAKE_INSTALL_PREFIX:PATH=../install/DevLauncher \ -DLauncher_VERSION_BUILD="$GITHUB_RUN_NUMBER" \ -DLauncher_BUILD_PLATFORM=lin64 \ -DLauncher_EMBED_SECRETS=Off \ @@ -55,10 +55,85 @@ jobs: APP_VERSION: ${{ steps.getversion.outputs.version }} run: | cd install - zip -r Launcher-${APP_VERSION}-linux-amd64.zip Launcher + zip -r DevLauncher-${APP_VERSION}-linux-amd64.zip DevLauncher - name: "Upload Artifacts" uses: actions/upload-artifact@v2.2.4 with: - name: Launcher-linux-amd64 - path: install/Launcher-*.zip + name: DevLauncher-linux-amd64 + path: install/DevLauncher-*.zip + + build-mac: + name: build-macos-amd64 + runs-on: macos-11 + + steps: + - uses: actions/checkout@v3 + with: + submodules: 'recursive' + + - name: "Cache Qt" + id: cache-qt + uses: actions/cache@v1 # not v2! + with: + path: ../Qt + key: ${{ runner.os }}-QtCache + + - name: Install Qt + uses: jurplel/install-qt-action@v3 + with: + aqtversion: '==3.1.*' + version: '6.5.1' + host: 'mac' + target: 'desktop' + arch: 'clang_64' + modules: 'qt5compat' + cached: ${{ steps.cache-qt.outputs.cache-hit }} + + - name: "Configure" + run: | + mkdir -p build + cd build + cmake \ + -DCMAKE_C_COMPILER=/usr/bin/clang \ + -DCMAKE_CXX_COMPILER=/usr/bin/clang++ \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX:PATH=../install/DevLauncher \ + -DLauncher_VERSION_BUILD="$GITHUB_RUN_NUMBER" \ + -DLauncher_BUILD_PLATFORM=macos \ + -DLauncher_EMBED_SECRETS=Off \ + .. + + # This uses https://docs.github.com/en/actions/learn-github-actions/workflow-commands-for-github-actions#setting-an-output-parameter + # ::set-output name=version::1.2.3.4 + - name: "Get Version" + id: getversion + run: | + cd build + make ga_version + + - name: "Build" + run: | + cd build + make -j$(sysctl -n hw.logicalcpu) + + - name: "Install" + run: | + cd build + make install + + - name: "Generate bundle" + run: | + cd install + macdeployqt DevLauncher.app + + - name: "Package" + env: + APP_VERSION: ${{ steps.getversion.outputs.version }} + run: ditto -V -c -k --keepParent "install/DevLauncher.app" "install/DevLauncher-${APP_VERSION}-macos.zip" + + - name: "Upload Artifacts" + uses: actions/upload-artifact@v2.2.4 + with: + name: DevLauncher-macos + path: install/DevLauncher-*.zip diff --git a/CMakeLists.txt b/CMakeLists.txt index 9c0f13b1..e3859b01 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,10 +11,8 @@ set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") # See: https://cmake.org/cmake/help/latest/variable/CMAKE_OSX_ARCHITECTURES.html # See: https://cmake.org/cmake/help/latest/variable/CMAKE_OSX_DEPLOYMENT_TARGET.html if(APPLE) - # No M1 build with Qt 5 - set(CMAKE_OSX_ARCHITECTURES "x86_64" CACHE STRING "macOS architecture(s) to build for.") - # Target 10.14 for the improved theming support - set(CMAKE_OSX_DEPLOYMENT_TARGET "10.14" CACHE STRING "minimum macOS versions to build for.") + set(CMAKE_OSX_ARCHITECTURES "x86_64;arm64" CACHE STRING "macOS architecture(s) to build for.") + set(CMAKE_OSX_DEPLOYMENT_TARGET "11.0" CACHE STRING "minimum macOS versions to build for.") endif() set(CMAKE_CXX_STANDARD_REQUIRED true)