From b8021425ec6b871b8223260b598e9f799a600816 Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Tue, 16 Oct 2018 01:08:24 -0700 Subject: [PATCH] msys2 __STDC_FORMAT_MACROS --- Build.md | 4 +++- Getting-started.md | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Build.md b/Build.md index 3580109..832f7cc 100644 --- a/Build.md +++ b/Build.md @@ -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 mkdir build cd build -cmake .. -G Ninja -DSYSTEM_CLANG=ON +cmake .. -G Ninja -DSYSTEM_CLANG=ON -DCMAKE_CXX_FLAGS=-D__STDC_FORMAT_MACROS cmake --build . ``` 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 * `include/llvm/Config/config.h` diff --git a/Getting-started.md b/Getting-started.md index 4fa8bf6..fe558a2 100644 --- a/Getting-started.md +++ b/Getting-started.md @@ -35,7 +35,7 @@ But caution is that you need to identify whether the clang library is compiled w * Mac OS X + 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` -* 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`