diff options
author | Sergio Martins <smartins@kde.org> | 2019-10-07 22:08:17 +0100 |
---|---|---|
committer | Sergio Martins <smartins@kde.org> | 2019-10-07 22:08:17 +0100 |
commit | a7a0f2dbeacd347fbdd3460e6e246e249a693dff (patch) | |
tree | a29ca1b38d7ccd476b80c36c4567ae498a853334 | |
parent | c26ac08ba205c536620b25b93c980c8f723a6c12 (diff) |
Update README with instructions to build on Windows
We now need to build with clang-cl instead of MSVC, otherwise we
get "C2026: C++ string too big, trailing characters truncated" when
compiling checks.json.h
-rw-r--r-- | README.md | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -88,8 +88,8 @@ See troubleshooting section if you have problems. ## Windows ### Build and install clang -These instructions assume your terminal is suitable for development (msvc2015). -jom, nmake, git, cmake and cl should be in your PATH. +These instructions assume your terminal is suitable for development. +jom and nmake (or ninja), git, cmake, and cl (msvc2015 or later) should be in your PATH. clang and LLVM >= 5.0 are required. @@ -98,9 +98,9 @@ Be sure to pass -DLLVM_EXPORT_SYMBOLS_FOR_PLUGINS=ON to CMake when building LLVM ``` > git clone https://github.com/llvm-mirror/llvm.git <some_directory> > cd <some_directory>\tools\ && git clone https://github.com/llvm-mirror/clang.git - > git checkout release_40 + > git checkout release_90 > cd clang - > git checkout release_40 + > git checkout release_90 > mkdir <some_directory>\build && cd <some_directory>\build > cmake -DCMAKE_INSTALL_PREFIX=c:\my_install_folder\llvm\ -DLLVM_TARGETS_TO_BUILD="X86" -DLLVM_EXPORT_SYMBOLS_FOR_PLUGINS=ON -DCMAKE_BUILD_TYPE=Release -G "NMake Makefiles JOM" .. > jom @@ -111,8 +111,11 @@ Be sure to pass -DLLVM_EXPORT_SYMBOLS_FOR_PLUGINS=ON to CMake when building LLVM ### Build clazy Be sure to point CLANG_LIBRARY_IMPORT to clang.lib. It's probably inside your LLVM build dir since it doesn't get installed. +We'll build clazy with clang, since MSVC errors-out with "C2026: C++ string too big, trailing characters truncated" when compiling checks.json.h ``` + > export CXX=clang-cl + > export CC=clang-cl > cd clazy\ > cmake -DCMAKE_INSTALL_PREFIX=c:\my_install_folder\llvm\ -DCLANG_LIBRARY_IMPORT=C:\path\to\llvm-build\lib\clang.lib -DCMAKE_BUILD_TYPE=Release -G "NMake Makefiles JOM" > jom && nmake install |