-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
dev-setup.bat
63 lines (51 loc) · 1.66 KB
/
dev-setup.bat
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
53
54
55
56
57
58
59
60
61
62
63
@echo off
echo [Step 1] Checking installations ...
:: Check if MinGW is installed
where g++ > nul 2>&1
if errorlevel 1 (
echo MinGW-w64 was not found. Please install the latest version from https://winlibs.com
goto end
)
:: Check if lld is installed
where lld > nul 2>&1
if errorlevel 1 (
echo LLD linker was not found. Please install the latest version from https://winlibs.com
goto end
)
:: Check if Ninja is installed
where ninja > nul 2>&1
if errorlevel 1 (
echo Ninja was not found. Please install the latest version from https://github.com/ninja-build/ninja/releases
goto end
)
:: Check if CMake is installed
where cmake > nul 2>&1
if errorlevel 1 (
echo CMake was not found. Please install the latest version from https://cmake.org/download
goto end
)
echo done.
:: Clone LLVM
echo [Step 2] Cloning LLVM (Could take a while) ...
git clone --depth 1 --branch llvmorg-19.1.3 https://github.com/llvm/llvm-project llvm
echo done.
:: Build LLVM
echo [Step 3] Building LLVM (Could take a whole while, please be patient) ...
mkdir .\llvm\build-release
pushd .\llvm\build-release
cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_FLAGS_RELWITHDEBINFO="-O2 -fuse-ld=lld" -DLLVM_ENABLE_RTTI=ON -GNinja ../llvm
cmake --build .
popd
echo done.
:: Download third-party libs
echo [Step 4] Downloading third-party libraries ...
cmd /c .\setup-libs.bat > nul 2>&1
echo done.
:: Build in dev context
echo [Step 5] Building Spice ...
cmd /c .\build.bat
echo done.
:: End message
echo The setup is done. Have fun coding!
echo Whenever you need to build Spice again, use the ./build.sh script.
:end