]> git.sesse.net Git - nageru/blob - meson.build
Make the Nageru version settable from the Meson configuration.
[nageru] / meson.build
1 project('nageru', 'cpp', default_options: ['buildtype=debugoptimized'], version: '1.8.0-pre')
2
3 cxx = meson.get_compiler('cpp')
4
5 # Use lld if we can; it links a lot faster than ld.bfd or gold.
6 code = '''#include <stdio.h>
7 int main() { printf("Hello, world!\n"); return 0; }
8 '''
9 if cxx.links(code, args: '-fuse-ld=lld', name: 'check for LLD')
10         add_project_link_arguments('-fuse-ld=lld', language: 'cpp')
11 endif
12
13 # Add the right MOVIT_SHADER_DIR definition.
14 r = run_command('pkg-config', '--variable=shaderdir', 'movit')
15 if r.returncode() != 0
16         error('Movit pkg-config installation is broken.')
17 endif
18 add_project_arguments('-DMOVIT_SHADER_DIR="' + r.stdout().strip() + '"', language: 'cpp')
19
20 # Make the Nageru version available as a #define.
21 add_project_arguments('-DNAGERU_VERSION="' + meson.project_version() + '"', language: 'cpp')
22
23 # DeckLink has these issues, and we include it from various places.
24 if cxx.has_argument('-Wno-non-virtual-dtor')
25         add_project_arguments('-Wno-non-virtual-dtor', language: 'cpp')
26 endif
27
28 # FFmpeg has a lot of deprecated APIs whose replacements are not available
29 # in Debian stable, so we suppress these warnings.
30 if cxx.has_argument('-Wno-deprecated-declarations')
31         add_project_arguments('-Wno-deprecated-declarations', language: 'cpp')
32 endif
33
34 # This needs to be done before declaring any build targets.
35 if get_option('cef_dir') != ''
36         add_project_arguments('-DHAVE_CEF=1', language: 'cpp')
37 endif
38
39 top_include = include_directories('.')
40
41 subdir('shared')
42 subdir('nageru')
43 subdir('futatabi')