-epoxydep = dependency('epoxy')
-libavcodecdep = dependency('libavcodec')
-libavformatdep = dependency('libavformat')
-libavutildep = dependency('libavutil')
-libjpegdep = dependency('libjpeg')
-libmicrohttpddep = dependency('libmicrohttpd')
-libswscaledep = dependency('libswscale')
-movitdep = dependency('movit')
-protobufdep = dependency('protobuf')
-qt5deps = dependency('qt5', modules: ['Core', 'Gui', 'Widgets', 'OpenGLExtensions', 'OpenGL', 'PrintSupport'])
-sdl2_imagedep = dependency('SDL2_image')
-sdl2dep = dependency('sdl2')
-sqlite3dep = dependency('sqlite3')
-vadrmdep = dependency('libva-drm')
-vax11dep = dependency('libva-x11')
-x11dep = dependency('x11')
+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