mirror of
https://github.com/linux-msm/cdba.git
synced 2026-02-25 13:11:56 -08:00
Add meson build to CI
Add x86_64 only meson build for now, meson requires some cross-compile files to be passed. Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
This commit is contained in:
10
.github/workflows/ci.yml
vendored
10
.github/workflows/ci.yml
vendored
@@ -187,6 +187,16 @@ jobs:
|
||||
echo "############################################"
|
||||
printenv
|
||||
|
||||
- name: Meson init
|
||||
if: ${{ matrix.arch == 'x86-64' && matrix.container != 'ubuntu:xenial' }}
|
||||
run: |
|
||||
mkdir build
|
||||
meson . build
|
||||
|
||||
- name: Ninja build
|
||||
if: ${{ matrix.arch == 'x86-64' && matrix.container != 'ubuntu:xenial' }}
|
||||
run: ninja -C build
|
||||
|
||||
- name: Compile
|
||||
run: make -j$(nproc)
|
||||
|
||||
|
||||
@@ -22,6 +22,7 @@ pacman -Syu --noconfirm \
|
||||
systemd-libs \
|
||||
make \
|
||||
pkgconf \
|
||||
meson \
|
||||
$PKGS_CC
|
||||
|
||||
echo "Install finished: $0"
|
||||
|
||||
@@ -33,6 +33,7 @@ apt install -y --no-install-recommends \
|
||||
libudev-dev \
|
||||
libyaml-dev \
|
||||
make \
|
||||
meson \
|
||||
$PKGS_CC
|
||||
|
||||
echo "Install finished: $0"
|
||||
|
||||
@@ -21,6 +21,7 @@ dnf -y install \
|
||||
libudev-devel \
|
||||
libyaml-devel \
|
||||
make \
|
||||
meson \
|
||||
$PKGS_CC
|
||||
|
||||
echo "Install finished: $0"
|
||||
|
||||
61
meson.build
61
meson.build
@@ -2,48 +2,45 @@
|
||||
|
||||
project('cdba',
|
||||
'c',
|
||||
license : [ 'BSD-3-Clause'],
|
||||
meson_version : '>= 0.43.0', # for compiler.get_supported_arguments()
|
||||
default_options: [
|
||||
'warning_level=2', # sets -Wextra
|
||||
'buildtype=release',
|
||||
])
|
||||
|
||||
# Set advanced compiler flags
|
||||
compiler = meson.get_compiler('c')
|
||||
|
||||
# If compiler variables are detectable, add some selected ones
|
||||
if meson.version().version_compare('>=0.43.0')
|
||||
base_cflags = ['-Wno-unused-parameter',
|
||||
'-Wno-unused-result',
|
||||
'-Wno-missing-field-initializers',
|
||||
'-Wno-sign-compare',
|
||||
'-Wundef',
|
||||
'-Wnull-dereference',
|
||||
'-Wdouble-promotion',
|
||||
'-Wshadow',
|
||||
'-Wpointer-arith',
|
||||
'-Wwrite-strings',
|
||||
'-Wstrict-overflow=4']
|
||||
compiler_cflags = ['-Wno-unused-parameter',
|
||||
'-Wno-unused-result',
|
||||
'-Wno-missing-field-initializers',
|
||||
'-Wno-sign-compare',
|
||||
'-Wundef',
|
||||
'-Wnull-dereference',
|
||||
'-Wdouble-promotion',
|
||||
'-Wshadow',
|
||||
'-Wpointer-arith',
|
||||
'-Wwrite-strings',
|
||||
'-Wstrict-overflow=4']
|
||||
|
||||
if compiler.get_id() == 'gcc'
|
||||
compiler_cflags = ['-Werror', # Only set it on GCC
|
||||
'-Wformat-signedness',
|
||||
'-Wduplicated-cond',
|
||||
'-Wduplicated-branches',
|
||||
'-Wvla-larger-than=1',
|
||||
'-Walloc-zero',
|
||||
'-Wunsafe-loop-optimizations',
|
||||
'-Wcast-align',
|
||||
'-Wlogical-op',
|
||||
'-Wjump-misses-init']
|
||||
elif compiler.get_id() == 'clang'
|
||||
# TODO add clang specific options
|
||||
compiler_cflags = []
|
||||
endif
|
||||
|
||||
add_global_arguments(compiler.get_supported_arguments(base_cflags),
|
||||
compiler.get_supported_arguments(compiler_cflags),
|
||||
language: 'c')
|
||||
# TODO add clang specific options
|
||||
if compiler.get_id() == 'gcc'
|
||||
compiler_cflags += ['-Werror', # Only set it on GCC
|
||||
'-Wformat-signedness',
|
||||
'-Wduplicated-cond',
|
||||
'-Wduplicated-branches',
|
||||
'-Wvla-larger-than=1',
|
||||
'-Walloc-zero',
|
||||
'-Wunsafe-loop-optimizations',
|
||||
'-Wcast-align',
|
||||
'-Wlogical-op',
|
||||
'-Wjump-misses-init']
|
||||
endif
|
||||
|
||||
add_global_arguments(compiler.get_supported_arguments(compiler_cflags),
|
||||
language: 'c')
|
||||
|
||||
client_srcs = ['cdba.c',
|
||||
'circ_buf.c']
|
||||
executable('cdba',
|
||||
|
||||
Reference in New Issue
Block a user