Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlateralusX <lateralusx.github@gmail.com>2019-05-02 18:04:22 +0300
committerlateralusX <lateralusx.github@gmail.com>2019-05-03 16:14:21 +0300
commit488e15e8ab3245bd6faca4f8388f3844d3066314 (patch)
treedbf21f9e304a1cd2b333005b81e19c78f0a8d2d0 /msvc/install-llvm-mono-build.bat
parentf83d9f3575776a5c7edad336f21f5c70ce519bc4 (diff)
Add support to include external build LLVM binaries in Mono build output.
Diffstat (limited to 'msvc/install-llvm-mono-build.bat')
-rw-r--r--msvc/install-llvm-mono-build.bat77
1 files changed, 77 insertions, 0 deletions
diff --git a/msvc/install-llvm-mono-build.bat b/msvc/install-llvm-mono-build.bat
new file mode 100644
index 00000000000..ebb1a86780c
--- /dev/null
+++ b/msvc/install-llvm-mono-build.bat
@@ -0,0 +1,77 @@
+:: --------------------------------------------------
+:: Install needed LLVM binaries from LLVM install directory
+:: into Mono build output directory.
+::
+:: %1 LLVM install root directory (internal or external LLVM build).
+:: %2 Mono distribution root directory.
+:: --------------------------------------------------
+
+@echo off
+setlocal
+
+set BUILD_RESULT=1
+
+set LLVM_INSTALL_DIR=%~1
+shift
+set MONO_DIST_DIR=%~1
+shift
+
+if "%LLVM_INSTALL_DIR%" == "" (
+ echo Missing LLVM install directory argument.
+ goto ECHO_USAGE
+)
+
+if "%MONO_DIST_DIR%" == "" (
+ echo Missing Mono dist directory argument.
+ goto ECHO_USAGE
+)
+
+if not exist "%LLVM_INSTALL_DIR%\bin\opt.exe" (
+ echo Missing LLVM build output, "%LLVM_INSTALL_DIR%\bin\opt.exe"
+ goto ON_ERROR
+)
+
+if not exist "%LLVM_INSTALL_DIR%\bin\llc.exe" (
+ echo Missing LLVM build output, "%LLVM_INSTALL_DIR%\bin\llc.exe"
+ goto ON_ERROR
+)
+
+if not exist "%LLVM_INSTALL_DIR%\bin\llvm-dis.exe" (
+ echo Missing LLVM build output, "%LLVM_INSTALL_DIR%\bin\llvm-dis.exe"
+ goto ON_ERROR
+)
+
+if not exist "%LLVM_INSTALL_DIR%\bin\llvm-mc.exe" (
+ echo Missing LLVM build output, "%LLVM_INSTALL_DIR%\bin\llvm-mc.exe"
+ goto ON_ERROR
+)
+
+if not exist "%LLVM_INSTALL_DIR%\bin\llvm-as.exe" (
+ echo Missing LLVM build output, "%LLVM_INSTALL_DIR%\bin\llvm-as.exe"
+ goto ON_ERROR
+)
+
+copy /Y "%LLVM_INSTALL_DIR%\bin\opt.exe" "%MONO_DIST_DIR%" >nul 2>&1
+copy /Y "%LLVM_INSTALL_DIR%\bin\llc.exe" "%MONO_DIST_DIR%" >nul 2>&1
+copy /Y "%LLVM_INSTALL_DIR%\bin\llvm-dis.exe" "%MONO_DIST_DIR%" >nul 2>&1
+copy /Y "%LLVM_INSTALL_DIR%\bin\llvm-mc.exe" "%MONO_DIST_DIR%" >nul 2>&1
+copy /Y "%LLVM_INSTALL_DIR%\bin\llvm-as.exe" "%MONO_DIST_DIR%" >nul 2>&1
+
+goto ON_SUCCESS
+
+:ON_SUCCESS
+
+set BUILD_RESULT=0
+goto ON_EXIT
+
+:ECHO_USAGE:
+ ECHO Usage: install-llvm-mono-build.bat [llvm_install_dir] [mono_dist_dir].
+
+:ON_ERROR
+ echo Failed to install LLVM binaries into Mono build output directory.
+ goto ON_EXIT
+
+:ON_EXIT
+ exit /b %BUILD_RESULT%
+
+@echo on