Build clang on windows platform


I was trying to build a clang toolchain for a windows machine, i have gone through the following step’s.

  • all this step-up done in ubuntu’s platform.
  1. Successfully Build windows tool -------> x86_64-w64-mingw32-
  2. Successfully Build clang for Linux(X86) platform
  3. With the help of this Tool’s try to Build clang for Windows platform,

~/build && cmake -G “Unix Makefiles” -DCMAKE_BUILD_TYPE=“Release”
4. make -jnproc

  • Build was successful, but clang is built for Linux(X86) platform.

** Can anyone please help me to Built clang for Windows(X86) platform.


With the LLVM_DEFAULT_TARGET_TRIPLE option, you built a compiler that
cross-compiles to the target specified by default (but the compiler
itself runs on the host machine). If your want a clang.exe that runs
on the windows machine, you can either cmake+build LLVM on that
machine or use a cross-compiler (and linker) on the Ubuntu platform
(x86_64-w64-mingw32-gcc or using the clang with
LLVM_DEFAULT_TARGET_TRIPLE that you just compiled)