appveyor: Add support for building llvmpipe with meson
authorDylan Baker <dylan@pnwbakers.com>
Tue, 15 Oct 2019 18:16:01 +0000 (11:16 -0700)
committerDylan Baker <dylan@pnwbakers.com>
Fri, 18 Oct 2019 20:02:58 +0000 (13:02 -0700)
Reviewed-by: Adam Jackson <ajax@redhat.com>
.appveyor/llvm-wrap.meson [new file with mode: 0644]
scripts/appveyor_msvc.bat

diff --git a/.appveyor/llvm-wrap.meson b/.appveyor/llvm-wrap.meson
new file mode 100644 (file)
index 0000000..34b1e32
--- /dev/null
@@ -0,0 +1,36 @@
+# A meson.build file for binary wrapping the LLVM used in the appvyeor CI
+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
+
+dep_llvm = declare_dependency(
+  include_directories : include_directories('include'),
+  dependencies : _deps,
+  version : '5.0.1',
+)
+
+has_rtti = false
+irbuilder_h = files('include/llvm/IR/IRBuilder.h')
index 5e8bd451d7e29779c87bdec0cf5ce366dee9efde..0f0e1e17aafb4cc0927d89d12f799b7965d08967 100644 (file)
@@ -2,7 +2,6 @@ goto %1
 
 :install
 rem Check pip
 
 :install
 rem Check pip
-call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat"
 if "%buildsystem%" == "scons" (
     python --version
     python -m pip --version
 if "%buildsystem%" == "scons" (
     python --version
     python -m pip --version
@@ -37,6 +36,9 @@ if not exist "%LLVM_ARCHIVE%" appveyor DownloadFile "https://people.freedesktop.
 if "%buildsystem%" == "scons" (
     mkdir llvm\bin
     set LLVM=%CD%\llvm
 if "%buildsystem%" == "scons" (
     mkdir llvm\bin
     set LLVM=%CD%\llvm
+) else (
+    move llvm subprojects\
+    copy .appveyor\llvm-wrap.meson subprojects\llvm\meson.build
 )
 goto :eof
 
 )
 goto :eof
 
@@ -44,10 +46,11 @@ goto :eof
 if "%buildsystem%" == "scons" (
     call scons -j%NUMBER_OF_PROCESSORS% MSVC_VERSION=14.1 llvm=1
 ) else (
 if "%buildsystem%" == "scons" (
     call scons -j%NUMBER_OF_PROCESSORS% MSVC_VERSION=14.1 llvm=1
 ) else (
+    call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools\VsDevCmd.bat" -arch=x86
     rem We use default-library as static to affect any wraps (such as expat and zlib)
     rem it would be better if we could set subprojects buildtype independently,
     rem but I haven't written that patch yet :)
     rem We use default-library as static to affect any wraps (such as expat and zlib)
     rem it would be better if we could set subprojects buildtype independently,
     rem but I haven't written that patch yet :)
-    call meson builddir --backend=vs2017 --default-library=static -Dbuild-tests=true -Db_vscrt=mtd --buildtype=release -Dllvm=false
+    call meson builddir --backend=vs2017 --default-library=static -Dbuild-tests=true -Db_vscrt=mtd --buildtype=release -Dllvm=true -Dgallium-drivers=swrast
     pushd builddir
     call msbuild mesa.sln /m
     popd
     pushd builddir
     call msbuild mesa.sln /m
     popd