Qt build improvements and documentation (#277)
* Qt build improvements and documentation * Update include/mbgl/actor/actor_ref.hpp Co-authored-by: Oliver Wipfli <oliver.wipfli@leichteralsluft.ch>
This commit is contained in:
5
.github/actions/qt5-build/Dockerfile
vendored
Normal file
5
.github/actions/qt5-build/Dockerfile
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
FROM ghcr.io/maplibre/linux-builder:centos7
|
||||
|
||||
# Copy and set the entry point
|
||||
COPY entrypoint.sh /entrypoint.sh
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
6
.github/actions/qt5-build/action.yml
vendored
Normal file
6
.github/actions/qt5-build/action.yml
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
# action.yml
|
||||
name: 'Qt5 Linux Builder'
|
||||
description: 'Helper action to build in a specific Docker container'
|
||||
runs:
|
||||
using: 'docker'
|
||||
image: 'Dockerfile'
|
||||
19
.github/actions/qt5-build/entrypoint.sh
vendored
Executable file
19
.github/actions/qt5-build/entrypoint.sh
vendored
Executable file
@@ -0,0 +1,19 @@
|
||||
#!/bin/bash -l
|
||||
|
||||
source scl_source enable devtoolset-8 rh-git218
|
||||
|
||||
set -e
|
||||
set -x
|
||||
|
||||
export CCACHE_DIR="$GITHUB_WORKSPACE/.ccache"
|
||||
export PATH="$Qt5_Dir/bin:$PATH"
|
||||
|
||||
mkdir build && cd build
|
||||
cmake ../source/ \
|
||||
-G Ninja \
|
||||
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
|
||||
-DMBGL_WITH_QT=ON \
|
||||
-DMBGL_QT_LIBRARY_ONLY=ON \
|
||||
-DCMAKE_INSTALL_PREFIX="../install/"
|
||||
ninja
|
||||
ninja install
|
||||
48
.github/workflows/qt-ci.yml
vendored
48
.github/workflows/qt-ci.yml
vendored
@@ -70,6 +70,11 @@ jobs:
|
||||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
- name: Linux
|
||||
os: ubuntu-latest
|
||||
static: OFF
|
||||
qt: 5.15.2
|
||||
qt_target: desktop
|
||||
- name: macOS
|
||||
os: macos-latest
|
||||
static: OFF
|
||||
@@ -80,11 +85,11 @@ jobs:
|
||||
static: ON
|
||||
qt: 5.15.2
|
||||
qt_target: desktop
|
||||
# - name: iOS_static
|
||||
# os: macos-latest
|
||||
# static: ON
|
||||
# qt: 5.15.2
|
||||
# qt_target: ios
|
||||
- name: iOS_static
|
||||
os: macos-latest
|
||||
static: ON
|
||||
qt: 5.15.2
|
||||
qt_target: ios
|
||||
- name: macOS
|
||||
os: macos-latest
|
||||
static: ON
|
||||
@@ -97,7 +102,7 @@ jobs:
|
||||
qt_target: desktop
|
||||
runs-on: ${{ matrix.os }}
|
||||
env:
|
||||
BUILD_TYPE: Debug
|
||||
BUILD_TYPE: RelWithDebInfo
|
||||
BUILD_MODE: ${{ matrix.static }}
|
||||
QT_VERSION: ${{ matrix.qt }}
|
||||
|
||||
@@ -109,7 +114,7 @@ jobs:
|
||||
submodules: recursive
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Install dependencies
|
||||
- name: Install macOS dependencies
|
||||
if: runner.os == 'macOS'
|
||||
env:
|
||||
HOMEBREW_NO_AUTO_UPDATE: 1
|
||||
@@ -120,6 +125,7 @@ jobs:
|
||||
brew list ninja || brew install ninja
|
||||
|
||||
- name: Setup Xcode
|
||||
if: runner.os == 'macOS'
|
||||
uses: maxim-lobanov/setup-xcode@v1
|
||||
with:
|
||||
xcode-version: latest-stable
|
||||
@@ -128,9 +134,11 @@ jobs:
|
||||
uses: jurplel/install-qt-action@v2
|
||||
with:
|
||||
version: ${{ env.QT_VERSION }}
|
||||
dir: ${{ github.workspace }}
|
||||
target: ${{ matrix.qt_target }}
|
||||
|
||||
- name: Prepare ccache
|
||||
if: runner.os == 'macOS'
|
||||
run: |
|
||||
ccache --clear
|
||||
ccache --set-config cache_dir=~/.ccache
|
||||
@@ -148,6 +156,7 @@ jobs:
|
||||
${{ env.cache-name }}-${{ runner.os }}-${{ matrix.name }}-${{ matrix.qt }}-${{ github.job }}
|
||||
|
||||
- name: Clear ccache statistics
|
||||
if: runner.os == 'macOS'
|
||||
run: |
|
||||
ccache --zero-stats
|
||||
ccache --max-size=2G
|
||||
@@ -161,7 +170,6 @@ jobs:
|
||||
-G Ninja \
|
||||
-DMBGL_WITH_QT=ON \
|
||||
-DMBGL_QT_STATIC=${BUILD_MODE} \
|
||||
-DMBGL_QT_WITH_INTERNAL_SQLITE=OFF \
|
||||
-DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
|
||||
-DCMAKE_INSTALL_PREFIX=../install \
|
||||
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
|
||||
@@ -174,22 +182,25 @@ jobs:
|
||||
run: |
|
||||
mkdir build && cd build
|
||||
cmake ../source/ \
|
||||
-DCMAKE_TOOLCHAIN_FILE=../source/platform/ios/platform/ios/toolchain.cmake \
|
||||
-G XCode \
|
||||
-DPLATFORM=OS64COMBINED \
|
||||
-DDEPLOYMENT_TARGET=12.0 \
|
||||
-DENABLE_BITCODE=ON \
|
||||
-G"Ninja Multi-Config" \
|
||||
-DCMAKE_SYSTEM_NAME=iOS \
|
||||
-DCMAKE_CONFIGURATION_TYPES="Release;Debug" \
|
||||
-DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" \
|
||||
-DCMAKE_OSX_DEPLOYMENT_TARGET=12.0 \
|
||||
-DMBGL_WITH_QT=ON \
|
||||
-DMBGL_WITH_WERROR=OFF \
|
||||
-DMBGL_QT_LIBRARY_ONLY=ON \
|
||||
-DMBGL_QT_STATIC=${BUILD_MODE} \
|
||||
-DMBGL_QT_WITH_INTERNAL_SQLITE=OFF \
|
||||
-DMBGL_QT_LIBRARY_ONLY=ON \
|
||||
-DMBGL_QT_WITH_IOS_CCACHE=ON \
|
||||
-DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
|
||||
-DCMAKE_INSTALL_PREFIX=../install
|
||||
-DCMAKE_INSTALL_PREFIX=../install \
|
||||
-DCMAKE_FIND_ROOT_PATH="$Qt5_Dir" \
|
||||
-DCMAKE_PREFIX_PATH="$Qt5_Dir"
|
||||
cmake --build . --config Release
|
||||
cmake --install . --config Release
|
||||
|
||||
- name: Build maplibre-gl-native (Linux)
|
||||
if: runner.os == 'Linux'
|
||||
uses: ./source/.github/actions/qt5-build
|
||||
|
||||
- name: Upload artifacts
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
@@ -197,5 +208,6 @@ jobs:
|
||||
path: install
|
||||
|
||||
- name: Show ccache statistics
|
||||
if: runner.os == 'macOS'
|
||||
run: |
|
||||
ccache --show-stats -v
|
||||
|
||||
Reference in New Issue
Block a user