|
1 |
| -project('passthrough-gtk4', 'c', |
| 1 | +# Copyright (C) 2022 Alexandros Theodotou <alex at zrythm dot org> |
| 2 | +# |
| 3 | +# This program is free software: you can redistribute it and/or modify |
| 4 | +# it under the terms of the GNU Affero General Public License as published by |
| 5 | +# the Free Software Foundation, either version 3 of the License, or |
| 6 | +# (at your option) any later version. |
| 7 | +# |
| 8 | +# This program is distributed in the hope that it will be useful, |
| 9 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 10 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 11 | +# GNU Affero General Public License for more details. |
| 12 | +# |
| 13 | +# You should have received a copy of the GNU Affero General Public License |
| 14 | +# along with this program. If not, see <https://www.gnu.org/licenses/>. |
| 15 | + |
| 16 | +project ( |
| 17 | + 'passthrough-gtk4', 'c', |
2 | 18 | version : '0.1',
|
3 |
| - default_options : ['warning_level=3']) |
| 19 | + default_options : ['warning_level=2']) |
| 20 | + |
| 21 | +# === Options === |
| 22 | +prefix = get_option('prefix') |
| 23 | +lv2dir = prefix / get_option('lv2dir') |
| 24 | + |
| 25 | +# === Detect OS === |
| 26 | +os_darwin = false |
| 27 | +os_linux = false |
| 28 | +os_freebsd = false |
| 29 | +os_windows = false |
| 30 | + |
| 31 | +if host_machine.system() == 'darwin' |
| 32 | + os_darwin = true |
| 33 | +elif host_machine.system() == 'linux' |
| 34 | + os_linux = true |
| 35 | +elif host_machine.system() == 'freebsd' |
| 36 | + os_freebsd = true |
| 37 | +elif host_machine.system() == 'windows' |
| 38 | + os_windows = true |
| 39 | +endif |
| 40 | + |
| 41 | +# === Dependencies === |
| 42 | +lv2_dep = dependency ( |
| 43 | + 'lv2', version: '>=1.16.0') |
| 44 | +gtk_dep = dependency ( |
| 45 | + 'gtk4', version: '>=4', |
| 46 | + fallback: ['gtk4', 'libgtk_dep'], |
| 47 | + default_options: [ |
| 48 | + 'demos=false', 'build-examples=false', |
| 49 | + 'build-tests=false', |
| 50 | + 'media-gstreamer=disabled', |
| 51 | + 'introspection=disabled']) |
| 52 | + |
| 53 | +# === CFlags === |
| 54 | +cc = meson.get_compiler ('c') |
4 | 55 |
|
5 |
| -exe = executable('passthrough_gtk4', 'passthrough_gtk4.c', |
6 |
| - install : true) |
| 56 | +common_cflags = cc.get_supported_arguments ([ |
| 57 | + '-fvisibility=hidden', |
| 58 | + '-Wformat=2', |
| 59 | + '-Wno-missing-field-initializers', |
| 60 | + '-Wno-unused-parameter', |
| 61 | + '-Wno-sequence-point', |
| 62 | + '-Wignored-qualifiers', |
| 63 | + '-Wno-cast-function-type', |
| 64 | + ]) |
| 65 | +if get_option ('strict_flags') |
| 66 | + common_cflags += cc.get_supported_arguments([ |
| 67 | + '-Werror=clobbered', |
| 68 | + '-Werror=disabled-optimization', |
| 69 | + '-Werror=double-promotion', |
| 70 | + '-Werror=float-equal', |
| 71 | + '-Werror=logical-op', |
| 72 | + '-Werror=pointer-arith', |
| 73 | + '-Werror=sign-conversion', |
| 74 | + '-Werror=overlength-strings', |
| 75 | + '-Werror=stringop-truncation', |
| 76 | + '-Werror=missing-declarations', |
| 77 | + '-Werror=shadow', |
| 78 | + '-Werror=undef', |
| 79 | + '-Werror=unused', |
| 80 | + '-Werror=strict-aliasing', |
| 81 | + '-fstrict-aliasing', |
| 82 | + '-Wstrict-overflow=2', |
| 83 | + '-fstrict-overflow', |
| 84 | + '-Werror=duplicated-branches', |
| 85 | + '-Werror=duplicated-cond', |
| 86 | + '-Werror=null-dereference', |
| 87 | + '-Werror=init-self', |
| 88 | + '-Werror=jump-misses-init', |
| 89 | + '-Werror=missing-prototypes', |
| 90 | + '-Werror=nested-externs', |
| 91 | + '-Werror=write-strings', |
| 92 | + '-Werror=implicit-fallthrough', |
| 93 | + '-Werror=sign-compare', |
| 94 | + '-Werror=discarded-qualifiers', |
| 95 | + '-Werror=float-conversion', |
| 96 | + '-Werror=implicit-function-declaration', |
| 97 | + '-Werror=uninitialized', |
| 98 | + '-Werror=maybe-uninitialized', |
| 99 | + '-Werror=return-type', |
| 100 | + '-Werror=int-conversion', |
| 101 | + '-Werror=format-security', |
| 102 | + '-Werror=incompatible-pointer-types', |
| 103 | + '-Werror=implicit-int', |
| 104 | + '-Werror=multistatement-macros', |
| 105 | + '-Werror=switch', |
| 106 | + '-Werror=overflow', |
| 107 | + '-Werror=array-bounds', |
| 108 | + '-Werror=enum-compare', |
| 109 | + '-Werror=misleading-indentation', |
| 110 | + '-Werror=int-in-bool-context', |
| 111 | + '-Werror=type-limits', |
| 112 | + '-Werror=deprecated-declarations', |
| 113 | + '-Werror=format-extra-args', |
| 114 | + '-Werror=format', |
| 115 | + ]) |
| 116 | + if cc.get_id() == 'gcc' |
| 117 | + common_cflags += cc.get_supported_arguments([ |
| 118 | + '-Wextra', |
| 119 | + '-Weverything', |
| 120 | + ]) |
| 121 | + endif |
| 122 | +endif |
7 | 123 |
|
8 |
| -test('basic', exe) |
| 124 | +subdir ('src') |
0 commit comments