docs: update meson docs for windows
Reviewed-by: Adam Jackson <ajax@redhat.com>
This commit is contained in:
parent
821cf6942a
commit
41b3eb08d9
|
@ -133,6 +133,18 @@ Please read the <a href="meson.html">detailed meson instructions</a>
|
|||
for more information
|
||||
</p>
|
||||
|
||||
<p>On windows you can also use the visual studio backend</p>
|
||||
<pre>
|
||||
meson builddir --backend=vs
|
||||
cd builddir
|
||||
msbuild mesa.sln /m
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
Please read the <a href="meson.html">detailed meson instructions</a>
|
||||
for more information
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
<h2 id="scons">3. Building with SCons (Windows/Linux)</h2>
|
||||
|
|
|
@ -281,6 +281,20 @@ the popular compilers, a complete list is available
|
|||
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>,
|
||||
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue