| 1 |
# Copyright 2022 Collabora Ltd. |
| 2 |
# SPDX-License-Identifier: LGPL-2.0-or-later |
| 3 |
|
| 4 |
project( |
| 5 |
'use-libglnx-as-subproject', |
| 6 |
'c', |
| 7 |
default_options : [ |
| 8 |
'c_std=gnu99', |
| 9 |
'warning_level=3', |
| 10 |
], |
| 11 |
version : '0', |
| 12 |
meson_version : '>=0.49.0', |
| 13 |
) |
| 14 |
|
| 15 |
configure_file( |
| 16 |
copy : true, |
| 17 |
input : 'dummy-config.h.in', |
| 18 |
output : 'config.h', |
| 19 |
) |
| 20 |
|
| 21 |
glib_dep = dependency('glib-2.0') |
| 22 |
|
| 23 |
libglnx = subproject('libglnx') |
| 24 |
libglnx_dep = libglnx.get_variable('libglnx_dep') |
| 25 |
libglnx_testlib_dep = libglnx.get_variable('libglnx_testlib_dep') |
| 26 |
|
| 27 |
# This executable is compiled at warning_level=3 by default |
| 28 |
executable( |
| 29 |
'trivial', |
| 30 |
'trivial.c', |
| 31 |
dependencies : [glib_dep], |
| 32 |
) |
| 33 |
|
| 34 |
# These can't be compiled at warning_level=3 because they use non-ISO |
| 35 |
# compiler features in the libglnx headers, which would be warnings or |
| 36 |
# errors with -Wpedantic |
| 37 |
executable( |
| 38 |
'use-libglnx', |
| 39 |
'use-libglnx.c', |
| 40 |
dependencies : [libglnx_dep, glib_dep], |
| 41 |
override_options : ['warning_level=2'], |
| 42 |
) |
| 43 |
executable( |
| 44 |
'use-testlib', |
| 45 |
'use-testlib.c', |
| 46 |
dependencies : [libglnx_testlib_dep, glib_dep], |
| 47 |
override_options : ['warning_level=2'], |
| 48 |
) |