Skip to content

Commit

Permalink
Repair build of different type (debug, release)
Browse files Browse the repository at this point in the history
Refs: #25
  • Loading branch information
orontee committed Oct 4, 2023
1 parent cb7f44f commit 25cc8f4
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 23 deletions.
10 changes: 6 additions & 4 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,14 @@ jobs:
- name: Build application
run: |
meson setup builddir . --cross-file crossfile_arm.ini --buildtype=release
cd builddir
meson compile
meson setup builddir . \
--cross-file crossfile_arm.ini \
--buildtype=release \
--strip
DESTDIR=artifact ninja -C builddir install
- name: Upload archive
uses: actions/upload-artifact@v3
with:
path: builddir/taranis.app
path: builddir/artifact
if-no-files-found: error
17 changes: 11 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,14 @@ and installed manually, see instructions below.
### Using a container

To build the application *for a given version*, one can build a Docker
image and export the ELF file from that image::
image and export an archive containing the ELF file from that image. For example, for a debug build of the most recent version::
```sh
VERSION=v$(meson version | grep 'Project version: ' | cut -d':' -f 2 | tr -d '[:space:]')
buildah bud -t taranis-build:$VERSION --build-arg VERSION=${VERSION} .
VERSION=$(git tag --list 'v*' | sort --version-sort --reverse | head -n 1)
buildah bud -t taranis-build:${VERSION} \
--build-arg="VERSION=${VERSION}" \
--build-arg="MESON_ARGS=--buildtype=debug --strip=false" .
podman run --rm -v ${PWD}:/opt/taranis \
taranis-build:$VERSION bash -c "cp builddir/taranis.app /opt/taranis"
taranis-build:$VERSION bash -c "cp builddir/artifact.zip /opt/artifact.zip"
```

### Cross-compile on a Debian host
Expand Down Expand Up @@ -75,8 +77,11 @@ dependencies.

4. Finally build the application:
```sh
meson setup builddir . --cross-file crossfile_arm.ini
pushd builddir && meson compile; popd
meson setup builddir . \
--cross-file crossfile_arm.ini \
--buildtype=debug \
--strip=false
DESTDIR=artifact ninja -C builddir install
```

## Tooling
Expand Down
10 changes: 6 additions & 4 deletions Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ RUN apt-get update -y && apt-get upgrade -y && \
git \
libtinfo5 \
meson \
wget && \
wget \
zip && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

Expand Down Expand Up @@ -47,6 +48,7 @@ RUN mkdir 3rd-parties && \
make -j4 && \
make install

RUN meson setup builddir . --cross-file crossfile_arm.ini && \
cd builddir && \
meson compile
ARG MESON_ARGS
RUN meson setup builddir . --cross-file crossfile_arm.ini ${MESON_ARGS} && \
DESTDIR=artifact ninja -C builddir install
RUN cd builddir; zip -r artifact.zip artifact/
14 changes: 6 additions & 8 deletions crossfile_arm.ini.in
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,12 @@ pkgconfig = '@pwd@/SDK_6.3.0/SDK-B288/usr/bin/pkg-config'

[built-in options]
cpp_args = ['-fsigned-char',
'-Werror-return-type',
'-O3',
'-pipe',
'-fomit-frame-pointer',
'-march=armv7-a',
'-mtune=cortex-a8',
'-mfpu=neon',
'-mfloat-abi=softfp']
'-fPIC',
'-Werror-return-type',
'-march=armv7-a',
'-mtune=cortex-a8',
'-mfpu=neon',
'-mfloat-abi=softfp']

[host_machine]
system = 'linux'
Expand Down
2 changes: 2 additions & 0 deletions icons/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@ icons = files(
'icon_menu.bmp',
'icon_warning.bmp'
)

install_data(sources: ['taranis.bmp', 'taranis_f.bmp'], install_dir: '/icons')
4 changes: 3 additions & 1 deletion meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,7 @@ sources += [icons_cc]
executable(
'taranis.app',
sources,
dependencies: taranis_deps
dependencies: taranis_deps,
install: true,
install_dir: '/',
)

0 comments on commit 25cc8f4

Please sign in to comment.