- Clone the
llvm-project
submodule with the following commands.
git submodule init
git submodule update
- Navigate to
koi/compiler/submodules/llvm-project
. mkdir build; cd build
- Run the following
cmake
command.
cmake -G Ninja ../llvm \
-DLLVM_TARGETS_TO_BUILD=X86 \
-DCMAKE_BUILD_TYPE=Release \
-DLLVM_ENABLE_ASSERTIONS=ON \
-DCMAKE_EXPORT_COMPILE_COMMANDS=1 \
- Run
ninja
to build LLVM. - Make some tea and wait :)
If you're having trouble with steps 2-6 check our LLVM's Getting Started guide.
- Navigate back to the
koi
directory. - Run the following command to set an environment variable.
export KOI_WORKING_DIRECTORY="$(pwd)" && export LLVM_SYS_130_PREFIX="$KOI_WORKING_DIRECTORY/compiler/submodules/llvm-project/build/"