+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')