X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=meson.build;h=2efead5c8d85f48979a0a68eaa9bed50feb2f54d;hb=147a2d38463d983ec7c66ef5c4c9c6cce7d52787;hp=83570057d161a75573e691062b4c372cba7e2b5e;hpb=9b7d691b4cc5db7dbfc18c82e86c1207fcac4722;p=nageru diff --git a/meson.build b/meson.build index 8357005..2efead5 100644 --- a/meson.build +++ b/meson.build @@ -1,5 +1,15 @@ project('nageru', 'cpp', default_options: ['buildtype=debugoptimized']) +cxx = meson.get_compiler('cpp') + +# Use lld if we can; it links a lot faster than ld.bfd or gold. +code = '''#include +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 @@ -7,5 +17,24 @@ if r.returncode() != 0 endif add_project_arguments('-DMOVIT_SHADER_DIR="' + r.stdout().strip() + '"', 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')