我想使用Clang 4.0,CMake 3.8.1,MinGW x86_64 6.3.0编译应用程序。我试过了:
cmake -G "MinGW Makefiles" -DCMAKE_C_COMPILER=clang.exe -DCMAKE_CXX_COMPILER=clang++ ..\code
Run Code Online (Sandbox Code Playgroud)
但是由于传递Visual Studio的编译器参数,导致测试程序的编译失败。我根本不想使用Visual Studio。输出:
-- The C compiler identification is Clang 4.0.0
-- The CXX compiler identification is Clang 4.0.0
-- Check for working C compiler: C:/Program Files/LLVM/bin/clang.exe
-- Check for working C compiler: C:/Program Files/LLVM/bin/clang.exe -- broken
CMake Error at C:/Program Files/CMake/share/cmake-3.8/Modules/CMakeTestCCompiler.cmake:51 (message):
The C compiler "C:/Program Files/LLVM/bin/clang.exe" is not able to compile a simple test program.
clang.exe: error: no such file or directory: '/nologo'
clang.exe: error: no …Run Code Online (Sandbox Code Playgroud)