X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=docs%2Fmeson.html;h=7a5d14bdf3828758ca7bd797a14f06ba826632c2;hb=f512965b0b3d70525424f100e534b8ac0a43a376;hp=0291f90658b483aea5b837855f299816d66ef066;hpb=4913ad9a37ecc71ae1b5c497c17d639e30c35d15;p=mesa.git diff --git a/docs/meson.html b/docs/meson.html index 0291f90658b..7a5d14bdf38 100644 --- a/docs/meson.html +++ b/docs/meson.html @@ -31,9 +31,13 @@

Mesa's Meson build system is generally considered stable and ready for production.

-

The Meson build of Mesa is tested on Linux, macOS, Cygwin and Haiku, FreeBSD, +

Mesa requires Meson >= 0.46.0 to build. + +

The Meson build of Mesa is tested on Linux, macOS, Windows, Cygwin, Haiku, FreeBSD, DragonflyBSD, NetBSD, and should work on OpenBSD.

+

Unix-like OSes

+

If Meson is not already installed on your system, you can typically install it with your package installer. For example:

@@ -44,8 +48,6 @@ or
 sudo dnf install meson   # Fedora
 
-

Mesa requires Meson >= 0.46.0 to build. - Some older versions of meson do not check that they are too old and will error out in odd ways.

@@ -55,6 +57,30 @@ If it's not already installed, use apt-get or dnf to install the ninja-build package.

+

Windows

+ +

+You will need to install python3 and meson as a module using pip. This is +because we use python for generating code, and rely on external modules +(mako). You also need pkg-config (a hard dependency of meson), flex, and bison. + +The easiest way to install everything you need is with chocolatey. +

+
+  choco install python3 winflexbison pkgconfiglite
+
+

You can even use chocolatey to install mingw and ninja (ninja can be used with MSVC as well)

+
+  choco install ninja mingw
+
+

Then install meson using pip

+
+  py -3 -m pip install meson mako
+
+ +You may need to add the python3 scripts directory to your path for meson. +

2. Basic Usage

@@ -152,6 +178,29 @@ Meson does not do this. Instead, you will need do this: ninja -C build/ xmlpool-pot xmlpool-update-po xmlpool-gmo +

Windows specific instructions

+ +

+On windows you have a couple of choices for compilers. If you installed mingw +with chocolatey and want to use ninja you should be able to open any shell +and follow the instructions above. If you want to you MSVC, clang-cl, or ICL +(the Intel Compiler), read on. +

+

+Both ICL and MSVC come with shell environments, the easiest way to use meson +with these it to open a shell. For clang-cl you will need to open an MSVC +shell, and then override the compilers, either using a native file, or +with the CC and CXX environment variables. +

+

+All of these compilers are tested and work with ninja, but if you want visual +studio integration or you just like msbuild, passing +--backend=vs to meson will generate a visual studio solution. If +you want to use ICL or clang-cl with the vsbackend you will need meson 0.52.0 +or greater. Older versions always use the microsoft compiler. +

+

3. Advanced Usage

@@ -232,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", @@ -276,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
@@ -286,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:

+ + +

The wrap file must define the following:

+ + +

It may also define:

+ + +

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