From f260a422165ed4471a5c7660c9501b7bdb98437a Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Tue, 28 Nov 2017 17:12:45 -0800 Subject: [PATCH 1/2] Don't warn for optional_modules LLVM can have optional modules, modules that will make the code faster but are not required. --- mesonbuild/interpreter.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mesonbuild/interpreter.py b/mesonbuild/interpreter.py index b301feef7..3e8930554 100644 --- a/mesonbuild/interpreter.py +++ b/mesonbuild/interpreter.py @@ -1368,7 +1368,7 @@ permitted_kwargs = {'add_global_arguments': {'language'}, 'build_target': build_target_kwargs, 'configure_file': {'input', 'output', 'configuration', 'command', 'install_dir', 'capture', 'install'}, 'custom_target': {'input', 'output', 'command', 'install', 'install_dir', 'build_always', 'capture', 'depends', 'depend_files', 'depfile', 'build_by_default'}, - 'dependency': {'default_options', 'fallback', 'language', 'method', 'modules', 'native', 'required', 'static', 'version'}, + 'dependency': {'default_options', 'fallback', 'language', 'method', 'modules', 'optional_modules', 'native', 'required', 'static', 'version'}, 'declare_dependency': {'include_directories', 'link_with', 'sources', 'dependencies', 'compile_args', 'link_args', 'version'}, 'executable': exe_kwargs, 'find_program': {'required', 'native'}, From 549e5928fbc8195f881fbef91708f6126f032ae9 Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Tue, 28 Nov 2017 17:34:48 -0800 Subject: [PATCH 2/2] docs: Add better documentation of the LLVM dependency --- docs/markdown/Dependencies.md | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/docs/markdown/Dependencies.md b/docs/markdown/Dependencies.md index dbd21aa61..bae3edc5e 100644 --- a/docs/markdown/Dependencies.md +++ b/docs/markdown/Dependencies.md @@ -197,3 +197,32 @@ tools support. You can force one or another via the method keyword: ```meson wmf_dep = dependency('wmf', method : 'config-tool') ``` + +## LLVM + +Meson has native support for LLVM going back to version LLVM version 3.5. +It supports a few additional features compared to other config-tool based +dependencies. + +As of 0.44.0 Meson supports the `static` keyword argument for LLVM. Before this +LLVM >= 3.9 would always dynamically link, while older versions would +statically link, due to a quirk in `llvm-config`. + +### Modules, a.k.a. Components + +Meson wraps LLVM's concept of components in it's own modules concept. +When you need specific components you add them as modules as meson will do the +right thing: + +```meson +llvm_dep = dependency('llvm', version : '>= 4.0', modules : ['amdgpu']) +``` + +As of 0.44.0 it can also take optional modules (these will affect the arguments +generated for a static link): + +```meson +llvm_dep = dependency( + 'llvm', version : '>= 4.0', modules : ['amdgpu'], optional_modules : ['inteljitevents'], +) +```