Windows instructions

Riatre Foo 2018-10-09 21:55:54 +08:00
parent 0cb99b0237
commit 5f94c2bceb

@ -8,11 +8,6 @@ See [[Getting-started]] for recommended configuration options for common systems
You may append `-G Ninja -DCMAKE_CXX_LINK_FLAGS=-fuse-ld=lld -DCMAKE_CXX_COMPILER=clang++`
[**Windows**] On Windows you have to explicitly tell CMake to target 64-bit
architecture by adding the `-DCMAKE_GENERATOR_PLATFORM=x64` option to the
cmake invocation (`cmake -DCMAKE_GENERATOR_PLATFORM=x64 ..`). 32-bit builds
are not supported at the moment.
## CMake Options
* `-DCMAKE_BUILD_TYPE=(Debug|MinSizeRel|Release|RelWithDebInfo)`
@ -80,7 +75,22 @@ Build ccls with `/usr/bin/clang++`. You may use the absolute path of `Release/cl
## Windows
If using Windows the automatically downloaded LLVM binaries are 64-bit; you should build ccls in 64-bit as well. You can tell cmake to build 64-bit using `-DCMAKE_GENERATOR_PLATFORM=x64`
The Windows archive on releases.llvm.org does not contain library headers, since ccls uses Clang C++ APIs, it is not possible to build ccls with these releases. You have to either:
1. Build LLVM+Clang by yourself with your favorite toolchain.
2. Get prebuilt LLVM+Clang from other sources.
For 2, one possible way is use MSYS2, in MSYS2 MinGW 64-bit shell:
```
pacman -S mingw-w64-x86_64-clang mingw-w64-x86_64-jq mingw-w64-x86_64-ninja mingw-w64-x86_64-ncurses
mkdir build
cd build
cmake .. -G Ninja -DSYSTEM_CLANG=ON
cmake --build .
```
Building ccls with MSVC 2017 and locally built LLVM+Clang on Windows does not work right now, contributions welcome.
## Link against clang+llvm libraries compiled from source