[Mesa-dev] [PATCH v4 48/49] appveyor: Add a wrap for llvm

Dylan Baker dylan at pnwbakers.com
Wed Aug 22 17:05:11 UTC 2018


The appveyor build has a copy of llvm 5.0.1 that scons uses, meson can
also use this to build llvm pipe (though not swr, which requires 6.0.0)
as well.

This requires a plain buildtype, since we need to compile single
threaded to link with the provided LLVM, as well as a 32 bit build for
the same reason.

v4: - New in this version
---
 appveyor.yml                            |  8 ++--
 build-support/appveyor-llvm.meson.build | 56 +++++++++++++++++++++++++
 2 files changed, 61 insertions(+), 3 deletions(-)
 create mode 100644 build-support/appveyor-llvm.meson.build

diff --git a/appveyor.yml b/appveyor.yml
index 6277e9636d9..2c45f534ec3 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -75,12 +75,14 @@ install:
 # Download and extract LLVM
 - if not exist "%LLVM_ARCHIVE%" appveyor DownloadFile "https://people.freedesktop.org/~jrfonseca/llvm/%LLVM_ARCHIVE%"
 - 7z x -y "%LLVM_ARCHIVE%" > nul
-- mkdir llvm\bin
-- set LLVM=%CD%\llvm
+- if "%BUILD_SYSTEM%"=="scons" mkdir llvm\bin
+- if "%BUILD_SYSTEM%"=="scons" set LLVM=%CD%\llvm
+- if "%BUILD_SYSTEM%"=="meson" move llvm subprojects\
+- if "%BUILD_SYSTEM%"=="meson" copy build-support\appveyor-llvm.meson.build subprojects\llvm\meson.build
 
 build_script:
 - if "%BUILD_SYSTEM%"=="scons" scons -j%NUMBER_OF_PROCESSORS% MSVC_VERSION=14.0 llvm=1
-- if "%BUILD_SYSTEM%"=="meson" meson builddir --backend=vs2015 -Dbuild-tests=true
+- if "%BUILD_SYSTEM%"=="meson" meson builddir --backend=vs2015 --buildtype=plain -Dc_args="/MTd /ZI /Ob0 /Od /RTC1"  -Dcpp_args="/MTd /ZI /Ob0 /Od /RTC1" -Dbuild-tests=true -Dllvm=true -Dllvm-wrap=llvm 
 - if "%BUILD_SYSTEM%"=="meson" cd builddir
 - if "%BUILD_SYSTEM%"=="meson" msbuild mesa.sln /m
 
diff --git a/build-support/appveyor-llvm.meson.build b/build-support/appveyor-llvm.meson.build
new file mode 100644
index 00000000000..1f0ad1c148b
--- /dev/null
+++ b/build-support/appveyor-llvm.meson.build
@@ -0,0 +1,56 @@
+# Copyright © 2018 Intel Corporation
+
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+# This wrap is used by appveyor to build with meson against a pre-compiled llvm
+project('llvm', ['cpp'])
+
+cpp = meson.get_compiler('cpp')
+
+_deps = []
+_search = join_paths(meson.current_source_dir(), 'lib')
+foreach d : ['LLVMAnalysis', 'LLVMAsmParser', 'LLVMAsmPrinter',
+             'LLVMBinaryFormat', 'LLVMBitReader', 'LLVMBitWriter',
+             'LLVMCodeGen', 'LLVMCore', 'LLVMCoroutines', 'LLVMCoverage',
+             'LLVMDebugInfoCodeView', 'LLVMDebugInfoDWARF', 'LLVMDebugInfoMSF',
+             'LLVMDebugInfoPDB', 'LLVMDemangle', 'LLVMDlltoolDriver',
+             'LLVMExecutionEngine', 'LLVMGlobalISel', 'LLVMInstCombine',
+             'LLVMInstrumentation', 'LLVMInterpreter', 'LLVMipo',
+             'LLVMIRReader', 'LLVMLibDriver', 'LLVMLineEditor', 'LLVMLinker',
+             'LLVMLTO', 'LLVMMCDisassembler', 'LLVMMCJIT', 'LLVMMC',
+             'LLVMMCParser', 'LLVMMIRParser', 'LLVMObjCARCOpts', 'LLVMObject',
+             'LLVMObjectYAML', 'LLVMOption', 'LLVMOrcJIT', 'LLVMPasses',
+             'LLVMProfileData', 'LLVMRuntimeDyld', 'LLVMScalarOpts',
+             'LLVMSelectionDAG', 'LLVMSupport', 'LLVMSymbolize',
+             'LLVMTableGen', 'LLVMTarget', 'LLVMTransformUtils',
+             'LLVMVectorize', 'LLVMX86AsmParser', 'LLVMX86AsmPrinter',
+             'LLVMX86CodeGen', 'LLVMX86Desc', 'LLVMX86Disassembler',
+             'LLVMX86Info', 'LLVMX86Utils', 'LLVMXRay']
+  _deps += cpp.find_library(d, dirs : _search)
+endforeach
+
+ext_llvm = declare_dependency(
+  include_directories : include_directories('include'),
+  dependencies : _deps,
+  version : '5.0.1',
+)
+
+irbuilder_h = files('include/llvm/IR/IRBuilder.h')
+
+# vim: ft=meson.build
-- 
2.18.0



More information about the mesa-dev mailing list