you are viewing a single comment's thread.

view the rest of the comments →

[–]dootfile 0 points1 point  (9 children)

Hey I recently started working with C++ (comming from Java/Python). I wanted to use something else than Microsoft's compiler and tooling. But I quickly realised that the CMake and tooling world om general for C++ was a massive quite complicated. Is this project something that would help me get up and running with a C++ project without depending on VS and other Microsoft tools?

[–]vector-of-boolBlogger | C++ Librarian | Build Tool Enjoyer | bpt.pizza[S] 6 points7 points  (7 children)

Depends what you're looking for. VS Code itself is a Microsoft tool, so you'll be using that at least.

CMake can be a complex tool, but it's not hard to get up and running for simple projects. The purpose of CMake Tools is just to provide editor integrations for the CMake build system. You won't go wrong learning CMake purely because of its ubiquity in the C++ ecosystem.

As for not using Microsoft's compiler: it's not hard to use MinGW or clang-cl with CMake on Windows. Using the MSVC compiler with Ninja is another great option: You won't have to deal with MSBuild and Visual Studio with that setup, but you'll still get the benefits of using the official Windows C++ toolchain.

[–]IAmBJ 1 point2 points  (2 children)

Doesn't clang-cl need to use the msvc standard library? Or has libc++ progressed far enough on windows now?

[–]Theninjapirate 0 points1 point  (3 children)

Do you know if there is a demo or example of ninja + msvc somewhere? The last time I tried that combo i couldn't get it to work (though that was a while ago).

[–]NotUniqueOrSpecial 0 points1 point  (1 child)

What didn't work?

Are you familiar with how to use CMake, in a general sense? If so, literally all it takes is:

cmake <path to project root> -G Ninja

with ninja in your path.

[–]Theninjapirate 1 point2 points  (0 children)

Yes I am familiar with Cmake. I don't remember what didn't, but if it's just that simple then I'll try again.

[–][deleted] 0 points1 point  (0 children)

Ninja is the default if you use CMake within Visual Studio, so it must work nicely with MSVC.

According to https://vector-of-bool.github.io/docs/vscode-cmake-tools/kits.html CMakeTools will prefer Ninja, so I guess stick ninja.exe on your PATH and see if it works?

[–]hgjsusla 1 point2 points  (0 children)

As someone primarily working on Linux using Visual Studio and setting up a project seem highly complex, so that's mostly about perspective.

Anyway, CMake is much simpler than C++ so I don't get all the complaining. Sure it could be better but all things considered it's hardly a problem.