Skip to content

Commit b7cc841

Browse files
authored
Update README.md
1 parent 8464438 commit b7cc841

File tree

1 file changed

+33
-5
lines changed

1 file changed

+33
-5
lines changed

README.md

Lines changed: 33 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,32 @@
22
Prebuilt versions of LLVM and LLD for diamond.
33

44
## Requirements
5+
6+
### macOS and Linux
57
- A C++ compiler
68
- Ninja
79
- LLD
10+
- cmake
811

9-
## Steps to build LLVM (macOS and Linux)
12+
### Windows
13+
- Visual Studio
14+
- cmake
1015

11-
### Get LLVM
16+
## Get LLVM
1217
```
13-
git clone [LLVM]([url](https://github.com/llvm/llvm-project)https://github.com/llvm/llvm-project).
18+
git clone https://github.com/llvm/llvm-project.git
1419
```
1520

16-
### Change directory to LLVM
21+
## Change directory to LLVM
1722
```
1823
cd llvm-project
1924
```
2025

21-
### Checkout the version you want
26+
## Checkout the version you want
2227
```
2328
git checkout llvmorg-15.0.7
2429
```
30+
## Steps to build LLVM on macOS and Linux
2531

2632
### Configure LLVM
2733
```
@@ -45,3 +51,25 @@ Delete:
4551
- Remove `share` folder from `folder/where/you/want/to/leave/llvm/`
4652
- Remove all `.so` files from `folder/where/you/want/to/leave/llvm/lib`
4753
- Remove `cmake` folder from `folder/where/you/want/to/leave/llvm/lib`
54+
55+
## Steps to build LLVM on Windows
56+
57+
## Configure LLVM
58+
59+
```
60+
cmake -S llvm -B build -DLLVM_ENABLE_PROJECTS=lld -DLLVM_TARGETS_TO_BUILD=X86 -Thost=x64 -DLLVM_USE_CRT_RELEASE=MT
61+
```
62+
63+
### Build
64+
65+
To build open the generated `LLVM.sln` file on `build` directory with Visual Studio. Select `Release` and then compile. If you don't have a lot of ram you should limit thee number of cores used in for compilation. For that you can follow this link https://stackoverflow.com/a/49068569.
66+
67+
### Install
68+
```
69+
cmake --install . --prefix folder/where/you/want/to/leave/llvm/
70+
```
71+
72+
### Remove unnecessary files from installation
73+
Delete:
74+
- All binaries, but `llvm-config` from `folder/where/you/want/to/leave/llvm/bin`
75+
- Remove `share` folder from `folder/where/you/want/to/leave/llvm/`

0 commit comments

Comments
 (0)