I built a Cargo-like build tool for C/C++
I built a Cargo-like build tool for C/C++
The least painful C/C++ build tool I've used is xmake
https://github.com/xmake-io/xmake
The reason why I like it (beyond ease-of-use) is that it can spit out CMakeLists.txt and compile_commands.json for IDE/LSP integration and also supports installing Conan/vcpkg libraries or even Git repos.
set_project("myapp")
set_languages("c++20") add_requires("conan::fmt/11.0.2", {alias = "fmt"})
add_requires("vcpkg::fmt", {alias = "fmt"})
add_requires("git://github.com/fmtlib/fmt v11.0.2", {alias = "fmt"})
target("myapp")
set_kind("binary")
add_files("src/*.cpp")
add_packages("fmt")
# Generate compile_commands.json and CMakeLists.txt
$ xmake project -k compile_commands
$ xmake project -k cmake # Build + run
$ xmake && xmake run myapp