![]() ![]() Inspired by the "Ways to Compile with Clang on Windows" blog post from and after some extended testing, the following command line worked for me (and yes, it's one big command I just splitted into several lines for better readability): > cmake -E env LDFLAGS="-fuse-ld=lld-link" PATH="" success!!! But much more complicated than I expected. I renamed it to Test.exe and the program executed happily. I ran ninja all to build the executable as Test. G Ninja -Bbuild -DCMAKE_C_COMPILER:PATH="C:\MeineProgramme\LLVM\bin\clang.exe" -DCMAKE_CXX_COMPILER:PATH="C:\MeineProgramme\LLVM\bin\clang .exe" -DCMAKE_C_COMPILER_ID="Clang" -DCMAKE_CXX_COMPILER_ID="Clang" -DCMAKE_SYSTEM_NAME="Generic" cmake -E env LDFLAGS="-fuse-ld=lld" cmake -H. I tried Florians command but omitted the path to ninja for a shorter notation and it turned out to work just fine. Just leave me a comment if you require further information. Thanks for helping me out guys, I appreciate it :-) I guess that the problem is related to CMake calling clang with VS style options using slash instead of preceded by minus, like clang requires. See also "D:/Dateien/Downloads/Test/CMakeFiles/CMakeError.log". See also "D:/Dateien/Downloads/Test/CMakeFiles/CMakeOutput.log". ![]() Configuring incomplete, errors occurred! '/FoCMakeFiles\cmTC_eeb5c.dir\testCCompiler.c.obj'ĬMake will not be able to correctly generate this project. FdCMakeFiles\cmTC_eeb5c.dir\ -c testCCompiler.cĬlang.exe: error: no such file or directory: '/nologo'Ĭlang.exe: error: no such file or directory: '/DWIN32'Ĭlang.exe: error: no such file or directory: '/D_WINDOWS'Ĭlang.exe: error: no such file or directory: '/W3'Ĭlang.exe: error: no such file or directory: '/MDd'Ĭlang.exe: error: no such file or directory: '/Zi'Ĭlang.exe: error: no such file or directory: '/Ob0'Ĭlang.exe: error: no such file or directory: '/Od'Ĭlang.exe: error: no such file or directory: '/RTC1'Ĭlang.exe: error: no such file or directory: '/showIncludes'Ĭlang.exe: error: no such file or directory: FoCMakeFiles\cmTC_eeb5c.dir\testCCompiler.c.obj Building C object CMakeFiles\cmTC_eeb5c.dir\testCCompiler.c.objįAILED: CMakeFiles/cmTC_eeb5c.dir/testCCompiler.c.objĬ:\Meine_Programme\LLVM\bin\clang.exe /nologo /DWIN32 /D_WINDOWS /W3 /MDd Run Build Command:"C:/Meine_Programme/Ninja_Build/ninja.exe" "cmTC_eeb5c" The C compiler "C:/Meine_Programme/LLVM/bin/clang.exe" is not able toĬhange Dir: D:/Dateien/Downloads/Test/CMakeFiles/CMakeTmp Check for working C compiler: C:/Meine_Programme/LLVM/bin/clang.exe - brokenĬMake Error at C:/Meine_Programme/CMake/share/cmake-3.9/Modules/CMakeTestCCompiler.cmake:51 (message): Check for working C compiler: C:/Meine_Programme/LLVM/bin/clang.exe The CXX compiler identification is Clang 5.0.0 The C compiler identification is Clang 5.0.0 The resulting output was disappointing and I don't understand enough to figure out respectively solve the problem myself. I tried the following CMakeLists file cmake_minimum_required(VERSION 3.9) My expectation is that CMake produces a ninja build file and runs it, correct? ![]() ![]() The problems begun when I started to integrate CMake into the process. The build process worked as expected and produced a working executable, just like before. The next step was setting up a simple build with Ninja ( screenshot of ninja.build file and terminal history). Clang automatically detected the standard lib for Windows within the VS Tools directories and produced an executable output. The compilation and execution of a simple program worked perfectly fine ( screenshot of the respective terminal history). The final aim is to be able to compile C and C applications for Windows using VS Code with the CMake integration as "IDE" and Clang with LLD as compiler and linker. I installed the LLVM 5.0.0 binaries, the Ninja build environment, the VS 2017 Tools and CMake 3.9.3. Please take the provided instructions with a pinch of salt since better solutions might be available now.Īfter using the Visual Studio toolchain for building on windows for a while, I decided to give Clang 5 a shot. This question is from 2017 and probably outdated. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |