From 41b3eb08d9feac97ac1be1802093ad4cc4c6ecaf Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Thu, 17 Oct 2019 10:07:44 -0700 Subject: [PATCH] docs: update meson docs for windows Reviewed-by: Adam Jackson --- docs/install.html | 12 +++++++ docs/meson.html | 85 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 97 insertions(+) diff --git a/docs/install.html b/docs/install.html index 83c5ebfb115..ec186fb84af 100644 --- a/docs/install.html +++ b/docs/install.html @@ -133,6 +133,18 @@ Please read the detailed meson instructions for more information

+

On windows you can also use the visual studio backend

+
+  meson builddir --backend=vs
+  cd builddir
+  msbuild mesa.sln /m
+
+ +

+Please read the detailed meson instructions +for more information +

+

3. Building with SCons (Windows/Linux)

diff --git a/docs/meson.html b/docs/meson.html index 013ed325684..7a5d14bdf38 100644 --- a/docs/meson.html +++ b/docs/meson.html @@ -281,6 +281,20 @@ the popular compilers, a complete list is available dependency interface.

+

+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

-Dcmake_module_path
option in this meson version, +which points to the root of an alternative installation (the prefix). For +example: +
+        meson builddir -Dcmake_module_path=/home/user/mycmake/prefix
+
+

+

As of meson 0.49.0 meson also has the concept of a "native file", @@ -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' +

Obviously, only cmake or llvm-config is required.

+

Then configure meson:

     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 Cross Compilation section for more information.
 
+

On windows (and in other cases), using llvm-config or cmake may be +either undesirable or impossible. Meson's solution for this is a +wrap, in +this case a "binary wrap". Follow the steps below:

+
    +
  • Install the binaries and headers into the $mesa_src/subprojects/llvm
  • +
  • Add a meson build.build file to that directory (more on that later)
  • +
+ +

The wrap file must define the following:

+
    +
  • dep_llvm: a declare_dependency() object with include_directories, dependencies, and version set)
  • +
+ +

It may also define:

+
    +
  • irbuilder_h: a files() object pointing to llvm/IR/IRBuilder.h (this is requred for SWR)
  • +
  • has_rtti: a bool that declares whether LLVM was built with RTTI. Defaults to true
  • +
+ +

such a meson.build file might look like:

+
+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')
+
+ +

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.

+ +
+ +
PKG_CONFIG_PATH

The pkg-config utility is a hard requirement for configuring and -- 2.30.2