-
Notifications
You must be signed in to change notification settings - Fork 60
/
build-tblgen.cmd
52 lines (40 loc) · 1.07 KB
/
build-tblgen.cmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
@echo off
setlocal EnableDelayedExpansion EnableExtensions
set RootDirectory=%~dp0
set SourcesDirectory=%RootDirectory%src
set BinariesDirectory=%RootDirectory%obj
set StagingDirectory=%RootDirectory%bin
where /q cmake.exe
if %ERRORLEVEL% neq 0 (
echo ERROR: cmake.exe is not found in the PATH
exit /b 1
)
if not exist "%BinariesDirectory%" (
mkdir "%BinariesDirectory%"
)
pushd "%BinariesDirectory%"
cmake.exe ^
-G "Visual Studio 17 2022" ^
-DCMAKE_INSTALL_PREFIX="%RootDirectory%\" ^
-DLLVM_TARGETS_TO_BUILD=AArch64;ARM;X86 ^
"%SourcesDirectory%\llvm-project\llvm"
popd
cmake.exe ^
--build %BinariesDirectory% ^
--target llvm-tblgen ^
--config Release
if %ERRORLEVEL% neq 0 (
echo llvm-tblgen compilation has failed
exit /b 1
)
if not exist "%StagingDirectory%" (
mkdir "%StagingDirectory%"
)
for /r "%BinariesDirectory%" %%I in (llvm-tblgen.ex?) do (
if "%%~nxI" == "llvm-tblgen.exe" (
xcopy "%%~I" "%StagingDirectory%"
exit /b 0
)
)
echo llvm-tblgen.exe is not found in "%BinariesDirectory%"
exit /b 1