From 1fc72c51c77bccddb9b4eb6daf3320e7dd8980cc Mon Sep 17 00:00:00 2001 From: Olli Niskanen Date: Tue, 4 Oct 2016 21:12:19 +0300 Subject: [PATCH] Document LLVM build using premake on OSX --- docs/BuildingLLVM.md | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/docs/BuildingLLVM.md b/docs/BuildingLLVM.md index d443e8b7..53c20018 100644 --- a/docs/BuildingLLVM.md +++ b/docs/BuildingLLVM.md @@ -39,6 +39,8 @@ msbuild LLVM.sln /p:Configuration=RelWithDebInfo;Platform=x64 /m ## Compiling on Mac OS X +### Compiling manually + 1. Compile LLVM solution in *RelWithDebInfo* mode The following CMake variables should be enabled: - LLVM_ENABLE_LIBCXX (enables libc++ standard library support) @@ -52,6 +54,22 @@ cmake -G "Unix Makefiles" -DLLVM_ENABLE_LIBCXX=true -DLLVM_BUILD_32_BITS=true -D make ``` +### Compiling using the build script + +Before building, ensure cmake is installed under Applications/Cmake.app and Ninja is installed in your PATH. + +1. Navigate to `build/scripts` +2. Clone, build and package LLVM with +```../premake5-osx --file=LLVM.lua clone_llvm +../premake5-osx --file=LLVM.lua build_llvm +../premake5-osx --file=LLVM.lua package_llvm +``` + +If the clone_llvm step fails, you can try to manually clone LLVM and Clang as explained above. You should still run clone_llvm to ensure that you are on the correct revision. + +The compile flags for cmake can be edited in `build/scripts/LLVM.lua`, e.g. if you need to build a 64-bit version. + + ## Compiling on Linux If you do not have native build tools you can install them first with: @@ -68,4 +86,4 @@ cd deps/llvm/build cmake -G Ninja -DCLANG_BUILD_EXAMPLES=false -DCLANG_INCLUDE_DOCS=false -DCLANG_INCLUDE_TESTS=false -DCLANG_INCLUDE_DOCS=false -DCLANG_BUILD_EXAMPLES=false -DLLVM_TARGETS_TO_BUILD="X86" -DLLVM_INCLUDE_EXAMPLES=false -DLLVM_INCLUDE_DOCS=false -DLLVM_INCLUDE_TESTS=false .. ninja -``` \ No newline at end of file +```