3 ms·
> And you might have at least clang/msvc/gcc with different flags for address/thread/ub sanitizers. You might be in that situation. Still, how is CMake helping
by cyber_kinetist 4y ago
> And you might have at least clang/msvc/gcc with different flags for address/thread/ub sanitizers. You might be in that situation.
Still, how is CMake helping with that situation? You've linked up an external repo with CMake scripts to solve this, why isn't this part of CMake then? Why am I resorted to use someone else's abandoned hacky build scripts from 4 years ago, which might probably have issues? I would rather just do this myself and add the relevant sanitizer flags (and I'm only using Windows LLVM at the moment, so I only need to deal with that).
> ...it can get hairy very quickly. Conan deals with this.
So CMake doesn't do this, Conan is actually doing all the work. And Conan is another complex piece of package manager machinery that I need to integrate into my workflow, which is slow, breaks often, and doesn't have the packages that I need (and even if they have them, don't have the options I need for customization). I've tried using it before and the experience wasn't that great.
> Also, even more important, it is battle tested
If it is battle tested, why are people still struggling with it so much? Why are people spending so much time fixing build scripts instead of writing actual code?
> But let me recommend you Meson
Does it work on Windows with LLVM Clang? That is the most important initial question. If not, I'll pass.
> Are you aware that this makes your project a personal thing that others cannot use?
If I'm building a end application (like a game or a GUI app), then I really don't need to worry about this.
But if I'm building a library for others to use, then I would make sure that there are minimal dependencies (as the tradition with good, frequently used C++ libraries) with ample room for customization of various options using #define flags. I would design it such that one can quickly integrate into any build system without much hassle. (Libraries that I use such as CGLTF, IMGUI, and physfs are all designed in this way. They all don't have CMakeLists.txt in their repos, but are still used frequently in production. It's fine.) For the few libraries that are a bit hard to build on source because of various reasons (like SDL2), I will precompile it and use the DLL binary with the headers.
> bc you are going to make mistakes all these tools already made and corrected and they are battle-tested.
Seeing from all the hackish solutions and workarounds people have written for CMake, I really don't think it is reducing the number of mistakes you're going to make.
- germandiago 4y agoThe find package set of functions can find metadata and it is a correct way to do it. Same for Meson and pkg config. If you have to do transitive dependency handling by hand, believe me it is nearly impossible without these tools. There is a lot of CMake hacky code around, but there is also a proper way to do it that works :) Also, in Meson at least, it is easy to change to compile dependencies from system to subpprojects without touching the build files or even choose selectively which dependencies to use. And it works well transitively. You can argue that CMake is complex, but the truth is that it adds value. I say this from a real hate to CMake. But it works. As for SDL2, as an example, only in Windows you can have it compiled for different runtimes (debug release) in different modes ( static, dynamic), multithreaded and later you have to choose whether to compile SDL statically or dynamically. Now repeat configs for Linux/Mac/clang/gcc. I have done this before. No, it will not scale. If it is for personal stuff u do not need to release u can do something hardcoded by hand. Otherwise you will be wasting a non-trivial amount of time doing it, wsy more than without a proper build system, no matter how much you hate them...