[cfe-dev] Building clang on Windows with CMake/Ninja

Edward Diener eldlistmailingz at tropicsoft.com
Thu Nov 14 12:29:41 PST 2013


On 11/14/2013 1:57 PM, Óscar Fuentes wrote:
> Edward Diener <eldlistmailingz at tropicsoft.com>
> writes:
>
>> On the clang getting started page there is:
>>
>> "It is also possible to use CMake instead of the makefiles. With CMake
>> it is possible to generate project files for several IDEs: Xcode,
>> Eclipse CDT4, CodeBlocks, Qt-Creator (use the CodeBlocks generator),
>> KDevelop3."
>>
>> How does one build clang on Windows using MingW with CMake/Ninja ?
>
> Install recent versions of MinGW, CMake and Ninja. Make sure everything
> is reachable through PATH environment variable.
>
> Let's suppose that LLVM sources are installed in C:\LLVM and Clang in
> C:\LLVM\tools\clang
>
> Execute this commands on a Windows command prompt and you are done:
>
>
> mkdir \buildLLVM
>
> cd \buildLLVM
>
> cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=c:/llvm_installed ../llvm
>
> ninja
>
> ninja install
>
>
> Be sure that ../llvm is indeed the path to the LLVM sources from the
> build directory.
>
> You can change CMAKE_BUILD_TYPE to Debug, depending on your usage. Last
> time I tried (long time ago) it was not strictly required to install
> Clang to use it.
>
> More information about CMake & LLVM usage on
> http://www.llvm.org/docs/CMake.html
>

Thanks for the info. How does Ninja know to be using MingW as opposed to 
other development environments I have ?




More information about the cfe-dev mailing list