msys2 __STDC_FORMAT_MACROS

Fangrui Song 2018-10-16 01:08:24 -07:00
parent e0dd026b5b
commit b8021425ec
2 changed files with 4 additions and 2 deletions

@ -86,12 +86,14 @@ 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 pacman -S mingw-w64-x86_64-clang mingw-w64-x86_64-jq mingw-w64-x86_64-ninja mingw-w64-x86_64-ncurses
mkdir build mkdir build
cd build cd build
cmake .. -G Ninja -DSYSTEM_CLANG=ON cmake .. -G Ninja -DSYSTEM_CLANG=ON -DCMAKE_CXX_FLAGS=-D__STDC_FORMAT_MACROS
cmake --build . cmake --build .
``` ```
Building ccls with MSVC 2017 and locally built LLVM+Clang on Windows does not work right now, contributions welcome. Building ccls with MSVC 2017 and locally built LLVM+Clang on Windows does not work right now, contributions welcome.
`-D__STDC_FORMAT_MACROS` is because otherwise `mingw-w64-headers/crt/inttypes.h` does not define `PRIu64`.
## Link against clang+llvm libraries compiled from source ## Link against clang+llvm libraries compiled from source
* `include/llvm/Config/config.h` * `include/llvm/Config/config.h`

@ -35,7 +35,7 @@ But caution is that you need to identify whether the clang library is compiled w
* Mac OS X * Mac OS X
+ Homebrew: https://github.com/twlz0ne/homebrew-ccls + Homebrew: https://github.com/twlz0ne/homebrew-ccls
+ MacPorts: `cmake -H. -BRelease -DSYSTEM_CLANG=on -DCMAKE_CXX_COMPILER=clang++-mp-6.0 -DCMAKE_PREFIX_PATH=/opt/local/libexec/llvm-6.0 -DLLVM_ENABLE_RTTI=on -DUSE_SHARED_LLVM=on` + MacPorts: `cmake -H. -BRelease -DSYSTEM_CLANG=on -DCMAKE_CXX_COMPILER=clang++-mp-6.0 -DCMAKE_PREFIX_PATH=/opt/local/libexec/llvm-6.0 -DLLVM_ENABLE_RTTI=on -DUSE_SHARED_LLVM=on`
* Windows. It is possible to compile with msys2 or build your own toolchain. But welcome to contribute detailed instructions https://github.com/MaskRay/ccls/issues/59 * Windows. [[Build#windows]]
Debian: `apt install zlib1g-dev ncurses-dev` Debian: `apt install zlib1g-dev ncurses-dev`