Re: Issue 956 in include-what-you-use: Any instruction how to build it on windows?

3 views
Skip to first unread message

notifi...@include-what-you-use.org

unread,
Dec 10, 2021, 6:08:17 PM12/10/21
to include-wh...@googlegroups.com
Comment #9 on issue 956 by cglf: Any instruction how to build it on windows?
https://github.com/include-what-you-use/include-what-you-use/issues/956

Since this is still open, someone might find the exact steps I used to build iwyu and llvm from scratch on Windows 10 x64 with useful. MSVC 2019 must be installed, and Git and CMake are required to be in the environment path to use these commands verbatim. Start by opening a command prompt (not powershell) and `cd` into an empty folder somewhere. Then execute these commands to build and install LLVM 13.0.0 then IWYU 0.17:
```
set "WD=%CD:\=/%"

mkdir ".\build\llvm"
mkdir ".\install\llvm"
git clone -b llvmorg-13.0.0 https://github.com/llvm/llvm-project.git
cmake -S "%WD%/llvm-project/llvm" -B "%WD%/build/llvm" -G "Visual Studio 16 2019" -Thost=x64 -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="%WD%/install/llvm" -DLLVM_ENABLE_ASSERTIONS=On -DLLVM_ENABLE_PROJECTS="clang;clang-tools-extra"
cmake --build ".\build\llvm" --target INSTALL --config Release

mkdir ".\build\iwyu"
mkdir ".\install\iwyu"
git clone -b 0.17 https://github.com/include-what-you-use/include-what-you-use.git
cmake -S "%WD%/include-what-you-use" -B "%WD%/build/iwyu" -G "Visual Studio 16 2019" -Thost=x64 -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="%WD%/install/iwyu" -DLLVM_DIR="%WD%/install/llvm/lib/cmake/llvm" -DClang_DIR="%WD%/install/llvm/lib/cmake/clang"
cmake --build "%WD%/build/iwyu" --target INSTALL --config Release
```

For powershell the steps would be the same, but the `set` and `mkdir` commands would have to be changed to powershell equivalents.


notifi...@include-what-you-use.org

unread,
Dec 10, 2021, 6:08:38 PM12/10/21
to include-wh...@googlegroups.com
Comment #9 on issue 956 by cglf: Any instruction how to build it on windows?
https://github.com/include-what-you-use/include-what-you-use/issues/956

Since this is still open, someone might find the exact steps I used to build iwyu and llvm from scratch on Windows 10 x64 useful. MSVC 2019 must be installed, and Git and CMake are required to be in the environment path to use these commands verbatim. Start by opening a command prompt (not powershell) and `cd` into an empty folder somewhere. Then execute these commands to build and install LLVM 13.0.0 then IWYU 0.17:
Reply all
Reply to author
Forward
0 new messages