Skip to content

Commit 6f189be

Browse files
LLVM Docker
1 parent 9cd51eb commit 6f189be

File tree

3 files changed

+15
-8
lines changed

3 files changed

+15
-8
lines changed

ClangAST/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ set (CMAKE_CXX_STANDARD 17)
55
set(CMAKE_EXPORT_COMPILE_COMMANDS TRUE)
66

77
# Modify this based on where you cloned and build llvm,
8-
set(LLVM_PATH $ENV{HOME}/llvm-project/llvm/build)
8+
set(LLVM_PATH $ENV{LLVM_BUILD_PATH})
99
find_package(LLVM REQUIRED CONFIG)
1010

1111
link_directories(${LLVM_PATH}/lib)

ClangAST/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ Installing and building LLVM (LLVM-14/clang-14) from source.
1515
You must have `cmake`, `make`, `cmake-data` installed along with `binutils`.
1616

1717
- [Building LLVM From Source](https://llvm.org/docs/CMake.html)
18+
- [Other Dependencies](https://llvm.org/docs/GettingStarted.html#software)
1819

1920
```bash
2021
# Install NCurses GUI/dev

DockerFile

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ RUN apt-get update ; apt-get install --no-install-recommends \
1717
libxml2-dev \
1818
make \
1919
musl-dev \
20+
ninja-build \
2021
libncurses5-dev libncursesw5-dev \
2122
python3 \
2223
python3-dev \
@@ -25,14 +26,19 @@ RUN apt-get update ; apt-get install --no-install-recommends \
2526
wget
2627

2728
WORKDIR /
28-
RUN git clone --progress --verbose https://github.com/llvm/llvm-project.git ; cd llvm-project ; cmake -S llvm -B build -G "Unix Makefiles" \
29+
RUN git clone --progress --verbose --depth 1 https://github.com/llvm/llvm-project.git
30+
31+
RUN cd llvm-project ; cmake -S llvm -B build -G "Ninja" \
2932
-DLLVM_ENABLE_PROJECTS="llvm;clang;compiler-rt" \
3033
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
31-
-DCMAKE_BUILD_TYPE=MinSizeRel \
32-
-DLLVM_INSTALL_UTILS=ON ; cd build ; make -j 2 ; make install
34+
-DCMAKE_BUILD_TYPE=Release \
35+
-DLLVM_INSTALL_UTILS=ON ; cd build ; ninja all ; ninja install
36+
3337
RUN git clone https://github.com/lahiri-phdworks/LLVM-Examples
3438

35-
ENV CXX=clang++
36-
ENV CC=clang
37-
ENV OPT=opt
38-
ENV HOME=HOME
39+
ENV CXX=/llvm-project/build/bin/clang++
40+
ENV CC=/llvm-project/build/bin/clang
41+
ENV OPT=/llvm-project/build/bin/opt
42+
ENV HOME=
43+
ENV LLVM_BUILD_PATH=/llvm-project/build
44+
ENV LLVM_BIN_DIR=/llvm-project/build/bin

0 commit comments

Comments
 (0)