-
Notifications
You must be signed in to change notification settings - Fork 644
130 lines (124 loc) · 5.59 KB
/
cpp_package.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
# Copyright © SixtyFPS GmbH <info@slint.dev>
# SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0
name: Build the C++ binary package
on:
workflow_dispatch:
workflow_call:
env:
MACOSX_DEPLOYMENT_TARGET: "11.0"
# Keep in sync with features in nightly_snapshot.yaml, slint_tool_binary.yaml, api/node/Cargo.toml, and api/python/Cargo.toml
SLINT_BINARY_FEATURES: "-DSLINT_FEATURE_BACKEND_LINUXKMS_NOSEAT=ON -DSLINT_FEATURE_BACKEND_WINIT=ON -DSLINT_FEATURE_RENDERER_FEMTOVG=ON -DSLINT_FEATURE_RENDERER_SKIA=ON -DSLINT_FEATURE_RENDERER_SOFTWARE=ON"
SLINT_MCU_FEATURES: "-DSLINT_FEATURE_FREESTANDING=ON -DSLINT_FEATURE_RENDERER_SOFTWARE=ON"
jobs:
# cmake_package_desktop:
# env:
# DYLD_FRAMEWORK_PATH: /Users/runner/work/slint/Qt/6.5.1/clang_64/lib
# QT_QPA_PLATFORM: offscreen
# CARGO_INCREMENTAL: false
# strategy:
# matrix:
# os: [ubuntu-20.04, macOS-12, windows-2022]
# include:
# - os: ubuntu-20.04
# package_suffix: linux
# - os: macOS-12
# package_suffix: macos
# - os: windows-2022
# package_suffix: windows
#
# runs-on: ${{ matrix.os }}
# steps:
# - uses: actions/checkout@v4
# - uses: ./.github/actions/install-linux-dependencies
# with:
# old-ubuntu: true
# - name: Install Qt (Ubuntu)
# uses: jurplel/install-qt-action@v3
# if: matrix.os == 'ubuntu-20.04'
# with:
# version: 5.15.2
# cache: true
# - uses: ./.github/actions/setup-rust
# - uses: baptiste0928/cargo-install@v3
# with:
# crate: cargo-about
# - name: Prepare licenses
# run: bash -x ../../scripts/prepare_binary_package.sh ../..
# working-directory: api/cpp/
# - uses: ilammy/msvc-dev-cmd@v1
# - name: Select MSVC (windows)
# run: |
# echo "CC=cl.exe" >> $GITHUB_ENV
# echo "CXX=cl.exe" >> $GITHUB_ENV
# if: matrix.os == 'windows-2022'
# - name: C++ Build
# uses: lukka/run-cmake@v3.4
# with:
# cmakeListsOrSettingsJson: CMakeListsTxtAdvanced
# cmakeListsTxtPath: CMakeLists.txt
# cmakeAppendedArgs: "-DCMAKE_BUILD_TYPE=RelWithDebInfo ${{ env.SLINT_BINARY_FEATURES }}"
# buildDirectory: ${{ runner.workspace }}/cppbuild
# buildWithCMakeArgs: "--config Release"
# - name: cpack
# working-directory: ${{ runner.workspace }}/cppbuild
# run: cmake --build . --config Release --target package
# - name: "Upload C++ packages"
# uses: actions/upload-artifact@v4
# with:
# name: cpp_bin-${{ matrix.package_suffix }}
# path: ${{ runner.workspace }}/cppbuild/Slint-cpp-*
cmake_package_mcu:
env:
CARGO_INCREMENTAL: false
strategy:
matrix:
target: [thumbv7em-none-eabihf, riscv32imafc-esp-espidf]
host: [ubuntu-20.04, windows-2022, macOS-12]
include:
- os: ubuntu-20.04
- os: macOS-12
- os: windows-2022
- target: thumbv7em-none-eabihf
toolchain: stable
- target: riscv32imafc-esp-espidf
toolchain: nightly
build_flags: -DSLINT_CARGO_LIBRARY_FLAGS="-Zbuild-std=core,alloc"
runs-on: ${{ matrix.host }}
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/install-linux-dependencies
with:
old-ubuntu: true
- uses: ./.github/actions/setup-rust
with:
target: ${{ matrix.target }}
toolchain: ${{ matrix.toolchain }}
components: rust-src
# - uses: baptiste0928/cargo-install@v3
# with:
# crate: cargo-about
# - name: Prepare licenses
# run: bash -x ../../scripts/prepare_binary_package.sh ../..
# working-directory: api/cpp/
- uses: ilammy/msvc-dev-cmd@v1
- name: Select MSVC (windows)
run: |
echo "CC=cl.exe" >> $GITHUB_ENV
echo "CXX=cl.exe" >> $GITHUB_ENV
if: matrix.host == 'windows-2022'
- name: C++ Build
uses: lukka/run-cmake@v3.4
with:
cmakeListsOrSettingsJson: CMakeListsTxtAdvanced
cmakeListsTxtPath: CMakeLists.txt
cmakeAppendedArgs: "-DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF -DRust_CARGO_TARGET=${{ matrix.target }} ${{ env.SLINT_MCU_FEATURES }} ${{ matrix.build_flags }}"
buildDirectory: ${{ runner.workspace }}/cppbuild
buildWithCMakeArgs: "--config Release"
- name: cpack
working-directory: ${{ runner.workspace }}/cppbuild
run: cpack -G TGZ
- name: "Upload C++ packages"
uses: actions/upload-artifact@v4
with:
name: cpp_mcu_bin-${{ runner.os }}-${{ runner.arch }}-${{ matrix.target }}
path: ${{ runner.workspace }}/cppbuild/Slint-cpp-*