]> git.sesse.net Git - nageru/blobdiff - meson.build
Make the Nageru version settable from the Meson configuration.
[nageru] / meson.build
index 15184b878e0298c647f8e78b99cb03a2f933567e..9dbfd22648c140dbfded07ed3133bc95fc3e00e4 100644 (file)
@@ -1,3 +1,43 @@
-project('nageru', 'cpp', default_options: ['buildtype=debugoptimized'])
-subdir('nageru')
+project('nageru', 'cpp', default_options: ['buildtype=debugoptimized'], version: '1.8.0-pre')
+
+cxx = meson.get_compiler('cpp')
+
+# Use lld if we can; it links a lot faster than ld.bfd or gold.
+code = '''#include <stdio.h>
+int main() { printf("Hello, world!\n"); return 0; }
+'''
+if cxx.links(code, args: '-fuse-ld=lld', name: 'check for LLD')
+       add_project_link_arguments('-fuse-ld=lld', language: 'cpp')
+endif
+
+# Add the right MOVIT_SHADER_DIR definition.
+r = run_command('pkg-config', '--variable=shaderdir', 'movit')
+if r.returncode() != 0
+       error('Movit pkg-config installation is broken.')
+endif
+add_project_arguments('-DMOVIT_SHADER_DIR="' + r.stdout().strip() + '"', language: 'cpp')
+
+# Make the Nageru version available as a #define.
+add_project_arguments('-DNAGERU_VERSION="' + meson.project_version() + '"', language: 'cpp')
 
+# DeckLink has these issues, and we include it from various places.
+if cxx.has_argument('-Wno-non-virtual-dtor')
+       add_project_arguments('-Wno-non-virtual-dtor', language: 'cpp')
+endif
+
+# FFmpeg has a lot of deprecated APIs whose replacements are not available
+# in Debian stable, so we suppress these warnings.
+if cxx.has_argument('-Wno-deprecated-declarations')
+       add_project_arguments('-Wno-deprecated-declarations', language: 'cpp')
+endif
+
+# This needs to be done before declaring any build targets.
+if get_option('cef_dir') != ''
+       add_project_arguments('-DHAVE_CEF=1', language: 'cpp')
+endif
+
+top_include = include_directories('.')
+
+subdir('shared')
+subdir('nageru')
+subdir('futatabi')