summaryrefslogtreecommitdiff
path: root/docs/meson.html
diff options
context:
space:
mode:
Diffstat (limited to 'docs/meson.html')
-rw-r--r--docs/meson.html85
1 files changed, 85 insertions, 0 deletions
diff --git a/docs/meson.html b/docs/meson.html
index 013ed325684..7a5d14bdf38 100644
--- a/docs/meson.html
+++ b/docs/meson.html
@@ -282,6 +282,20 @@ dependency interface.
</p></dd>
<dd><p>
+As of meson 0.51.0 meson can use cmake to find llvm (the cmake finder
+was added in meson 0.49.0, but LLVM cannot be found until 0.51) Due to the
+way LLVM implements its cmake finder it will only find static libraries, it
+will never find libllvm.so.
+
+There is also a <pre>-Dcmake_module_path</pre> option in this meson version,
+which points to the root of an alternative installation (the prefix). For
+example:
+<pre>
+ meson builddir -Dcmake_module_path=/home/user/mycmake/prefix
+</pre>
+</p></dd>
+
+<dd><p>
As of meson 0.49.0 meson also has the concept of a
<a href="https://mesonbuild.com/Native-environments.html">"native file"</a>,
these files provide information about the native build environment (as opposed
@@ -325,8 +339,11 @@ should be used. It uses the same format as the native file above:
[binaries]
...
llvm-config = '/usr/lib/llvm-config-32'
+ cmake = '/usr/bin/cmake-for-my-arch'
</pre>
+<p>Obviously, only cmake or llvm-config is required.</p>
+
<p>Then configure meson:</p>
<pre>
meson builddir/ --cross-file cross-llvm.ini
@@ -335,6 +352,74 @@ should be used. It uses the same format as the native file above:
See the <a href="#cross-compilation">Cross Compilation</a> section for more information.
</dd>
+<dd><p>On windows (and in other cases), using llvm-config or cmake may be
+either undesirable or impossible. Meson's solution for this is a
+<a href="https://mesonbuild.com/Wrap-dependency-system-manual.html">wrap</a>, in
+this case a "binary wrap". Follow the steps below:</p>
+<ul>
+ <li>Install the binaries and headers into the <code>$mesa_src/subprojects/llvm</code></li>
+ <li>Add a meson build.build file to that directory (more on that later)</li>
+</ul>
+
+<p>The wrap file must define the following:</p>
+<ul>
+ <li><code>dep_llvm</code>: a <code>declare_dependency()</code> object with include_directories, dependencies, and version set)</li>
+</ul>
+
+<p>It may also define:</p>
+<ul>
+ <li><code>irbuilder_h</code>: a <code>files()</code> object pointing to llvm/IR/IRBuilder.h (this is requred for SWR)</li>
+ <li><code>has_rtti</code>: a <code>bool</code> that declares whether LLVM was built with RTTI. Defaults to true</li>
+</ul>
+
+<p>such a meson.build file might look like:</p>
+<pre>
+project('llvm', ['cpp'])
+
+cpp = meson.get_compiler('cpp')
+
+_deps = []
+_search = join_paths(meson.current_source_dir(), 'lib')
+foreach d : ['libLLVMCodeGen', 'libLLVMScalarOpts', 'libLLVMAnalysis',
+ 'libLLVMTransformUtils', 'libLLVMCore', 'libLLVMX86CodeGen',
+ 'libLLVMSelectionDAG', 'libLLVMipo', 'libLLVMAsmPrinter',
+ 'libLLVMInstCombine', 'libLLVMInstrumentation', 'libLLVMMC',
+ 'libLLVMGlobalISel', 'libLLVMObjectYAML', 'libLLVMDebugInfoPDB',
+ 'libLLVMVectorize', 'libLLVMPasses', 'libLLVMSupport',
+ 'libLLVMLTO', 'libLLVMObject', 'libLLVMDebugInfoCodeView',
+ 'libLLVMDebugInfoDWARF', 'libLLVMOrcJIT', 'libLLVMProfileData',
+ 'libLLVMObjCARCOpts', 'libLLVMBitReader', 'libLLVMCoroutines',
+ 'libLLVMBitWriter', 'libLLVMRuntimeDyld', 'libLLVMMIRParser',
+ 'libLLVMX86Desc', 'libLLVMAsmParser', 'libLLVMTableGen',
+ 'libLLVMFuzzMutate', 'libLLVMLinker', 'libLLVMMCParser',
+ 'libLLVMExecutionEngine', 'libLLVMCoverage', 'libLLVMInterpreter',
+ 'libLLVMTarget', 'libLLVMX86AsmParser', 'libLLVMSymbolize',
+ 'libLLVMDebugInfoMSF', 'libLLVMMCJIT', 'libLLVMXRay',
+ 'libLLVMX86AsmPrinter', 'libLLVMX86Disassembler',
+ 'libLLVMMCDisassembler', 'libLLVMOption', 'libLLVMIRReader',
+ 'libLLVMLibDriver', 'libLLVMDlltoolDriver', 'libLLVMDemangle',
+ 'libLLVMBinaryFormat', 'libLLVMLineEditor',
+ 'libLLVMWindowsManifest', 'libLLVMX86Info', 'libLLVMX86Utils']
+ _deps += cpp.find_library(d, dirs : _search)
+endforeach
+
+dep_llvm = declare_dependency(
+ include_directories : include_directories('include'),
+ dependencies : _deps,
+ version : '6.0.0',
+)
+
+has_rtti = false
+irbuilder_h = files('include/llvm/IR/IRBuilder.h')
+</pre>
+
+<p>It is very important that version is defined and is accurate, if it is not,
+workarounds for the wrong version of LLVM might be used resulting in build
+failures.</p>
+
+</dd>
+</dl>
+
<dt><code>PKG_CONFIG_PATH</code></dt>
<dd><p>The
<code>pkg-config</code> utility is a hard requirement for configuring and