Use the Ninja build system to speed up the build by ~15%

This commit is contained in:
lod 2025-03-18 17:50:03 +01:00
parent 3be4b53424
commit b2d8a4bc43
2 changed files with 7 additions and 4 deletions

View file

@ -17,6 +17,7 @@ pkgbase = edgetx-companion
makedepends = gcc makedepends = gcc
makedepends = git makedepends = git
makedepends = icu makedepends = icu
makedepends = ninja
makedepends = python makedepends = python
makedepends = python-jinja makedepends = python-jinja
makedepends = python-lz4 makedepends = python-lz4

View file

@ -10,7 +10,7 @@ license=('GPL-2.0-only')
depends=('gcc-libs' 'glibc' 'hicolor-icon-theme' 'qt5-base' 'qt5-multimedia' 'qt5-serialport' 'sdl2') depends=('gcc-libs' 'glibc' 'hicolor-icon-theme' 'qt5-base' 'qt5-multimedia' 'qt5-serialport' 'sdl2')
optdepends=('dfu-util: tool for flashing stm32 based radios') optdepends=('dfu-util: tool for flashing stm32 based radios')
makedepends=('arm-none-eabi-binutils' 'arm-none-eabi-gcc' 'arm-none-eabi-newlib' makedepends=('arm-none-eabi-binutils' 'arm-none-eabi-gcc' 'arm-none-eabi-newlib'
'avr-gcc' 'avr-libc' 'bc' 'clang' 'cmake' 'fox' 'gcc' 'git' 'icu' 'python' 'avr-gcc' 'avr-libc' 'bc' 'clang' 'cmake' 'fox' 'gcc' 'git' 'icu' 'ninja' 'python'
'python-jinja' 'python-lz4' 'python-pillow' 'python-pyqt5' 'qt5-svg' 'python-jinja' 'python-lz4' 'python-pillow' 'python-pyqt5' 'qt5-svg'
'qt5-tools' 'qt5-translations' 'sed' 'xsd') 'qt5-tools' 'qt5-translations' 'sed' 'xsd')
options=('!debug') options=('!debug')
@ -43,6 +43,8 @@ prepare() {
sed -i "s/if(${pattern}_FOUND)/if(false)/g" ./edgetx/companion/src/CMakeLists.txt sed -i "s/if(${pattern}_FOUND)/if(false)/g" ./edgetx/companion/src/CMakeLists.txt
done done
sed -i 's/$(MAKE)/ninja/g' ./edgetx/CMakeLists.txt
cd "$srcdir/edgetx/radio/src/thirdparty/" cd "$srcdir/edgetx/radio/src/thirdparty/"
git submodule init git submodule init
git config submodule.AccessDenied.url "$srcdir/AccessDenied" git config submodule.AccessDenied.url "$srcdir/AccessDenied"
@ -98,6 +100,7 @@ build() {
rm -f CMakeCache.txt native/CMakeCache.txt rm -f CMakeCache.txt native/CMakeCache.txt
cmake \ cmake \
-S "$srcdir/edgetx" \ -S "$srcdir/edgetx" \
-G Ninja \
-DCMAKE_MAKE_PROGRAM=/usr/bin/ninja \ -DCMAKE_MAKE_PROGRAM=/usr/bin/ninja \
-DCMAKE_BUILD_TYPE=Release \ -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr \ -DCMAKE_INSTALL_PREFIX=/usr \
@ -115,7 +118,6 @@ build() {
} }
package() { package() {
cd edgetx/build/native DESTDIR="$pkgdir" ninja -C edgetx/build/native install
make DESTDIR="$pkgdir/" install install -Dm644 edgetx/LICENSE "$pkgdir/usr/share/licenses/edgetx-companion/LICENSE"
install -Dm644 "$srcdir/edgetx/LICENSE" "$pkgdir/usr/share/licenses/edgetx-companion/LICENSE"
} }