Building Compiler-RT on Windows

Has anyone built Compiler-RT on Windows? I am attempting to compile it for ARM, but I get errors from CMake. It appears to be trying to pass VC++ flags to Clang. I am using a version of Clang built from trunk.

PS D:\llvm\arm_test\compiler-rt-build> cmake -G Ninja -DCMAKE_C_COMPILER=clang.exe -DCMAKE_CXX_COMPILER=clang++.exe -DCM
AKE_RC_COMPILER=rc.exe -DCMAKE_CXX_FLAGS=“” -DCMAKE_C_FLAGS=“” …\compiler-rt
– The C compiler identification is Clang 3.7.0
clang.exe: error: no such file or directory: ‘/nologo’
clang.exe: error: no such file or directory: ‘/showIncludes’
– The CXX compiler identification is Clang 3.7.0
clang.exe: error: no such file or directory: ‘/nologo’
clang.exe: error: no such file or directory: ‘/showIncludes’
– Check for working C compiler using: Ninja
– Check for working C compiler using: Ninja – broken
CMake Error at C:/Program Files (x86)/CMake/share/cmake-3.1/Modules/CMakeTestCCompiler.cmake:61 (message):
The C compiler “d:/llvm/build/Release/bin/clang.exe” is not able to compile
a simple test program.
It fails with the following output:
Change Dir: D:/llvm/arm_test/compiler-rt-build/CMakeFiles/CMakeTmp

Run Build Command:“d:/llvm/ninja/ninja.exe” “cmTryCompileExec2171879632”
[1/2] Building C object
CMakeFiles\cmTryCompileExec2171879632.dir\testCCompiler.c.obj
FAILED: d:\llvm\build\Release\bin\clang.exe /nologo /D_DEBUG /MDd /Zi /Ob0
/Od /RTC1 /showIncludes
/FoCMakeFiles\cmTryCompileExec2171879632.dir\testCCompiler.c.obj
/FdCMakeFiles\cmTryCompileExec2171879632.dir\ -c testCCompiler.c
clang.exe: error: no such file or directory: ‘/nologo’
clang.exe: error: no such file or directory: ‘/D_DEBUG’
clang.exe: error: no such file or directory: ‘/MDd’
clang.exe: error: no such file or directory: ‘/Zi’
clang.exe: error: no such file or directory: ‘/Ob0’
clang.exe: error: no such file or directory: ‘/Od’
clang.exe: error: no such file or directory: ‘/RTC1’
clang.exe: error: no such file or directory: ‘/showIncludes’
clang.exe: error: no such file or directory:
‘/FoCMakeFiles\cmTryCompileExec2171879632.dir\testCCompiler.c.obj’
clang.exe: error: no such file or directory:
'/FdCMakeFiles\cmTryCompileExec2171879632.dir'
ninja: build stopped: subcommand failed.

CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:12 (project)

– Configuring incomplete, errors occurred!
See also “D:/llvm/arm_test/compiler-rt-build/CMakeFiles/CMakeOutput.log”.
See also “D:/llvm/arm_test/compiler-rt-build/CMakeFiles/CMakeError.log”.

It looks like your command fails early in CMake TryCompile tests. Does (your version of) CMake supports using Clang on Windows at all?

I am using CMake 3.1.2.