diff --git a/.github/workflows/qt-ci-windows.yml b/.github/workflows/qt-ci-windows.yml deleted file mode 100644 index 2594b4965..000000000 --- a/.github/workflows/qt-ci-windows.yml +++ /dev/null @@ -1,151 +0,0 @@ -name: qt-ci-windows - -on: - workflow_dispatch: - push: - tags-ignore: - - '**' - paths-ignore: - - ".gitignore" - - "README.md" - # ignore other platforms - - "platform/android/**" - - "platform/darwin/**" - - "platform/glfw/**" - - "platform/ios/**" - - "platform/macos/**" - # ignore CI for other platforms - - ".github/FUNDING.yml" - - ".github/workflows/android-ci.yml" - - ".github/workflows/android-ci-pull.yml" - - ".github/workflows/android-docker-base.yml" - - ".github/workflows/android-docker-ndk-r21b.yml" - - ".github/workflows/android-release.yml" - - ".github/workflows/gh-pages-android-api.yml" - - ".github/workflows/gh-pages-ios-api.yml" - - ".github/workflows/ios-ci.yml" - - ".github/workflows/ios-pre-release.yml" - - ".github/workflows/ios-release.yml" - - ".github/workflows/macos-ci.yml" - - ".github/workflows/macos-release.yml" - - ".github/workflows/node-ci.yml" - - ".github/workflows/qt-ci.yml" - - ".github/workflows/update-gl-js.yml" - branches: - - main - - pull_request: - branches: - - main - paths-ignore: - - ".gitignore" - - "README.md" - # ignore other platforms - - "platform/android/**" - - "platform/darwin/**" - - "platform/glfw/**" - - "platform/ios/**" - - "platform/macos/**" - # ignore CI for other platforms - - ".github/FUNDING.yml" - - ".github/workflows/android-ci.yml" - - ".github/workflows/android-ci-pull.yml" - - ".github/workflows/android-docker-base.yml" - - ".github/workflows/android-docker-ndk-r21b.yml" - - ".github/workflows/gh-pages-android-api.yml" - - ".github/workflows/gh-pages-ios-api.yml" - - ".github/workflows/ios-ci.yml" - - ".github/workflows/ios-pre-release.yml" - - ".github/workflows/ios-release.yml" - - ".github/workflows/macos-ci.yml" - - ".github/workflows/macos-release.yml" - - ".github/workflows/node-ci.yml" - - ".github/workflows/qt-ci.yml" - - ".github/workflows/update-gl-js.yml" - -concurrency: - # cancel jobs on PRs only - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} - -jobs: - build-core: - runs-on: windows-latest - strategy: - matrix: - include: - - name: Windows - static: OFF - qt: 5.15.2 - qtarch: win64_msvc2019_64 - compiler: x64 - - name: Windows_static - static: ON - qt: 5.15.2 - qtarch: win64_msvc2019_64 - compiler: x64 - # - name: Windows - # static: ON - # qt: 6.2.2 - # qtarch: win64_msvc2019_64 - # compiler: x64 - env: - BUILD_TYPE: Debug - BUILD_MODE: ${{ matrix.static }} - COMPILER_TYPE: ${{ matrix.compiler }} - QT_VERSION: ${{ matrix.qt }} - - steps: - - name: Checkout - uses: actions/checkout@v3 - with: - path: source - fetch-depth: 0 - - - name: Setup submodules - shell: bash - run: | - cd source - auth_header="$(git config --local --get http.https://github.com/.extraheader)" - git submodule sync --recursive - git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1 || true - - - name: Download Qt - uses: jurplel/install-qt-action@v2 - with: - version: ${{ env.QT_VERSION }} - arch: ${{ matrix.qtarch }} - - - name: Setup ninja - uses: seanmiddleditch/gha-setup-ninja@v3 - - - name: Setup MSVC - uses: ilammy/msvc-dev-cmd@v1 - with: - arch: ${{ matrix.compiler }} - - - name: Build maplibre-gl-native (MSVC) - run: | - $env:Path = $env:Path -replace "C:\\ProgramData\\Chocolatey\\bin;","" - $env:Path = "$env:IQTA_TOOLS\$env:COMPILER_TYPE\bin;$env:Path" - echo "$env:Path" - mkdir build - cd build - $BuildType = "$env:BUILD_TYPE" - $BuildMode = "$env:BUILD_MODE" - cmake -S ../source/ ` - -G Ninja ` - -DCMAKE_BUILD_TYPE="$BuildType" ` - -DCMAKE_INSTALL_PREFIX="../install" ` - -DMBGL_WITH_QT=ON ` - -DMBGL_QT_LIBRARY_ONLY=ON ` - -DMBGL_QT_STATIC="$BuildMode" ` - -DMBGL_QT_WITH_INTERNAL_SQLITE=OFF - ninja - ninja install - - - name: Upload artifacts - uses: actions/upload-artifact@v3 - with: - name: maplibre-gl-native_${{ matrix.name }}_Qt${{ matrix.qt }} - path: install diff --git a/.github/workflows/qt-ci.yml b/.github/workflows/qt-ci.yml index 7c612d67d..7bea3a3dc 100644 --- a/.github/workflows/qt-ci.yml +++ b/.github/workflows/qt-ci.yml @@ -99,9 +99,46 @@ jobs: qt_target: desktop deployment_target: 10.14 deployment_arch: "x86_64;arm64" + - name: win64_msvc2019 + os: windows-2022 + build_type: "RelWithDebInfo;Debug" + compiler_type: x64 + compiler_version: 14.29 + qt_version: 5.15.2 + qt_target: desktop + qt_arch: win64_msvc2019_64 + qt_tools: '' + - name: win64_msvc2019 + os: windows-2022 + build_type: "RelWithDebInfo;Debug" + compiler_type: x64 + compiler_version: 14.29 + qt_version: 6.3.1 + qt_target: desktop + qt_arch: win64_msvc2019_64 + qt_tools: '' + - name: win64_mingw + os: windows-2022 + build_type: RelWithDebInfo + compiler_type: mingw810_64 + compiler_version: 8.10.0 + qt_version: 5.15.2 + qt_target: desktop + qt_arch: win64_mingw81 + qt_tools: tools_mingw,qt.tools.win64_mingw810 + - name: win64_mingw + os: windows-2022 + build_type: RelWithDebInfo + compiler_type: mingw1120_64 + compiler_version: 11.2.0 + qt_version: 6.3.1 + qt_target: desktop + qt_arch: win64_mingw + qt_tools: tools_mingw90 runs-on: ${{ matrix.os }} env: BUILD_TYPE: ${{ matrix.build_type }} + COMPILER_TYPE: ${{ matrix.compiler_type }} DEPLOYMENT_TARGET: ${{ matrix.deployment_target }} DEPLOYMENT_ARCH: ${{ matrix.deployment_arch }} QT_VERSION: ${{ matrix.qt_version }} @@ -111,14 +148,15 @@ jobs: uses: actions/checkout@v3 with: path: source - submodules: recursive fetch-depth: 0 - - name: Setup Xcode - if: runner.os == 'macOS' - uses: maxim-lobanov/setup-xcode@v1 - with: - xcode-version: latest-stable + - name: Setup submodules + shell: bash + run: | + cd source + auth_header="$(git config --local --get http.https://github.com/.extraheader)" + git submodule sync --recursive + git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1 || true - name: Download Qt uses: jurplel/install-qt-action@v3 @@ -127,14 +165,37 @@ jobs: version: ${{ env.QT_VERSION }} dir: ${{ github.workspace }} target: ${{ matrix.qt_target }} + arch: ${{ matrix.qt_arch }} + tools: ${{ matrix.qt_tools }} - name: Setup ninja uses: seanmiddleditch/gha-setup-ninja@v3 + - name: Setup Xcode + if: runner.os == 'macOS' + uses: maxim-lobanov/setup-xcode@v1 + with: + xcode-version: latest-stable + + - name: Setup MSVC + if: matrix.qt_arch == 'win64_msvc2019_64' + uses: ilammy/msvc-dev-cmd@v1 + with: + arch: ${{ matrix.compiler_type }} + toolset: ${{ matrix.compiler_version }} + + - name: Update ccache + if: runner.os == 'Windows' + shell: bash + run: | + choco.exe upgrade ccache + ccache.exe --version + echo "CCACHE_CONFIGPATH=C:/Users/runneradmin/AppData/Roaming/ccache/ccache.conf" >> $GITHUB_ENV + - name: Set up ccache uses: hendrikmuhs/ccache-action@v1 with: - key: ${{ matrix.name }} + key: ${{ matrix.name }}_${{ matrix.qt_version }} - name: Build maplibre-gl-native (macOS) if: runner.os == 'macOS' && matrix.qt_target == 'desktop' @@ -161,6 +222,24 @@ jobs: if: runner.os == 'Linux' && matrix.qt_version != '5.15.2' uses: ./source/.github/actions/qt6-build + - name: Build maplibre-gl-native (Windows) + if: runner.os == 'Windows' + shell: bash + run: | + export PATH="$IQTA_TOOLS/$COMPILER_TYPE/bin:$PATH" + echo "$PATH" + mkdir build && cd build + cmake.exe ../source/ \ + -G"Ninja Multi-Config" \ + -DCMAKE_CONFIGURATION_TYPES="${BUILD_TYPE}" \ + -DCMAKE_C_COMPILER_LAUNCHER="ccache.exe" \ + -DCMAKE_CXX_COMPILER_LAUNCHER="ccache.exe" \ + -DCMAKE_INSTALL_PREFIX="../install" \ + -DMBGL_WITH_QT=ON \ + -DMBGL_QT_LIBRARY_ONLY=ON + ninja.exe + ninja.exe install + - name: Upload artifacts uses: actions/upload-artifact@v3 with: diff --git a/platform/qt/qt.cmake b/platform/qt/qt.cmake index 426362f9b..d058493f1 100644 --- a/platform/qt/qt.cmake +++ b/platform/qt/qt.cmake @@ -49,11 +49,14 @@ elseif(CMAKE_SYSTEM_NAME STREQUAL "Windows") add_definitions("-D_USE_MATH_DEFINES") endif() -if(CMAKE_SYSTEM_NAME STREQUAL iOS) - option(MBGL_QT_WITH_IOS_CCACHE "Enable ccache for iOS" OFF) - if(MBGL_QT_WITH_IOS_CCACHE) - include(${PROJECT_SOURCE_DIR}/platform/ios/ccache.cmake) - endif() +if (MSVC) + foreach(config DEBUG RELWITHDEBINFO) + foreach(lang C CXX) + set(flags_var "CMAKE_${lang}_FLAGS_${config}") + string(REPLACE "/Zi" "/Z7" ${flags_var} "${${flags_var}}") + set(${flags_var} "${${flags_var}}" PARENT_SCOPE) + endforeach() + endforeach() endif() if(ANDROID)