From 2a2240f41c210557d32717f7fd041a294562e1d1 Mon Sep 17 00:00:00 2001
From: Dylan Baker $PATH
(or %PATH%
llvm-config, so using an LLVM from a non-standard path is as easy as
PATH=/path/with/llvm-config:$PATH meson build
.
On windows (and in other cases), using llvm-config is 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 + +ext_llvm = declare_dependency( + include_directories : include_directories('include'), + dependencies : _deps, + version : '6.0.0', +) + +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.
+ +