简体   繁体   中英

build toolchain with cmake, clang and llvm for visual studio

I googled a lot and didn't find an appropriate answer, so I'm asking here.

What steps do I need to take to develop a c++ project from existing code which shall be compiled using cmake and clang ?

I also want to have all the nice features like auto-completion and debugging with breakpoints and step by step debugging.

See the recent LLVM snapshot page for Windows builds integrating with Visual Studio here . There is an installer and a code formatting plugin. You will not get auto-complete and Clang/LLVM has nothing to do with debugging in Visual Studio (except that it will probably not work if you compile with Clang).

See also this interesting blog post predicting much good for LLVM on Windows in the future, backed by companies with paid developers ;-)

Staying on top of what the clang guys are doing for Windows is a good idea. The last two releases 3.6 and 3.7 show a commitment to the product but still some holes: MSVC C++: but not quite debug information, not quite compatible with MSVC C++ exceptions (but Windows SEH works) meaning this is more like an auxiliary build tool at the moment than something you can build any running product on. 但不完全调试信息,与MSVC C ++异常不兼容(但Windows SEH工作)意味着这更像是一个目前,辅助构建工具可以构建任何正在运行的产品。 I concur with the problems with exceptions at the moment.

I haven't got the strakh to post more than two links but the intervening weekly notes, have lots of interesting snippets including the coming of lldb to Windows and (if you care for this sort of thing) a longer post on compiling for CLR on Windows. Either way, looking at blog.llvm.org regularly is a good idea to keep this answer current.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM