Bug 109155

Summary: Update documentation for using custom llvm to build Mesa with Meson
Product: Mesa Reporter: Shmerl <shtetldik>
Component: OtherAssignee: mesa-dev
Status: RESOLVED FIXED QA Contact: mesa-dev
Severity: normal    
Priority: medium    
Version: unspecified   
Hardware: x86-64 (AMD64)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:

Description Shmerl 2018-12-26 20:27:22 UTC
Current documentation at https://www.mesa3d.org/meson.html says:

> LLVM
> Meson includes upstream logic to wrap llvm-config using its standard dependency
> interface. It will search $PATH (or %PATH% on windows) for llvm-config (and
> llvm-config$version and llvm-config-$version), so using an LLVM from a
> non-standard path is as easy as PATH=/path/with/llvm-config:$PATH meson build.

That's really a very inflexible method, for instance you can't use different llvm configs installed in the same directory.

As per https://github.com/mesonbuild/meson/issues/2887#issuecomment-439586787
as of Meson 0.49, it's now possible to override llvm-config using --native-file option.

Here is an example:

    llvm_config=/usr/bin/llvm-config-8 # or whatever you need

    read -r -d '' native_config <<EOF
    [binaries]
    llvm-config = "$llvm_config"
    EOF
    
    meson ... --native-file=<(echo "$native_config") ...

Please update Mesa documentation above, since this option is very obscure and hard to find.
Comment 1 Shmerl 2019-01-16 06:12:34 UTC
Thanks for updating!

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.