Chalet: A cross-platform project format and build tool for C/C++
chalet-work.space
chalet-work.space
https://github.com/chalet-org - github org w/ example projects
This is a project of mine that has been in the works for a little over a year and a half. The main goal of Chalet is ultimately to streamline C/C++ tooling as much as possible. In practice it's a command-line application for its own project format, much like msbuild or xcodebuild, that can take C/C++ code from various sources and build them using the same compiler toolchain. It can also run your executable applications after the build and handle paths for you. Chalet can also fetch git repositories by branch, tag or commit. It also supports cross-compiling without reconfiguring, and just requires a couple different options at the command-line.
This is the first release, and right now it works with all major compilers. The downside is that there isn't much in the way of IDE integration yet aside from a VS Code extension. This will hopefully change in the future as the application matures and interest grows. VS Code, text editors, and anything that execute command line applications are perfectly suitable otherwise.
The rest of the features and details are explained on the website, but it's worth noting that building C++20 modules with MSVC is also supported.
The docs might be spotty in places, so any feedback is appreciated. I hope this is something others are interested in, and can try out with some of their projects.
From Windows:
- MSVC: x64, x86, arm64, arm
- LLVM/Clang: (same as MSVC)
- MinGW: x86_64, i686, any version of GCC & Clang from MSYS2
- Intel LLVM (mostly experimental)
- No WSL support yet, although I'm not sure what does and doesn't work with it yet.
From MacOS:
- Apple Clang: arm64, x86_64, universal binaries
- GCC from Homebrew: x86_64
- LLVM from Homebrew: x86_64
- Intel Compiler Classic for x86_64
From Linux:
- GCC & Clang: x86_64, i686, arm-none-linux, arm-linux-gnueabihf, x86_64-w64-mingw32, i686-w64-mingw32
There may be others that work on Linux, although I haven't tested them. As for compiler versions:
VS 2017+ LLVM 12+ (earlier ones might work) GCC/MinGW 7.3+, MinGW 4.8.1
I wish this went further to have an opinion on project layout, like location of source files and include dirs. Every C/C++ build system I've seen has a configuration-over-convention approach rather than the other way around. I get it's by necessity to accommodate arbitrary pre-existing projects, but it's unfortunate that it perpetuates C projects being snowflakes, each with a slightly different directory structure, approach to includes, naming scheme of defines, different ways of enabling optional features, different way of running tests, and so on. Because of that maximal flexibility even projects using the same build system end up being gratuitously different.
Having tried to get into C/C++ development roughly 3-4 years ago, I found the toolchain associated with getting even basic projects working incredibly complex and opaque as someone without industry experience.
From a brief look over the documentation of this project, I feel like I could get something up and running in very little time.
Would be amazing if there's a script to quickly convert common mk files and cmake files into chalet format, that would absolutely help with adoption amongst legacy codebases.
equip c++ with new tooling like what golang and rust have will be a huge boost to this language.
It needs more guidance for making simple, typical projects easy to set up, at the very least more stuff that works like ExternalProject_Add (a big powerful command with all its options clearly documented on one page).
1) declare your dependencies in a vcpkg.json file (similar to npm's package.json). Example:
{ ... "dependencies": [ "openssl" ] }
2) Add it to your CMakeLists.txt file. Example:
find_package(OpenSSL REQUIRED)
target_link_libraries(main PRIVATE OpenSSL::SSL OpenSSL::Crypto)