![]() ![]() If you're bukldong with cmake, you distribute the cmakelists txt, and treat the makefiles, ninja files etc as build intermediates > Also, I have been told that cmake-generated Makefiles invoke cmake itself, so you can't really generate portable Makefiles with it.Ĭmake generates a target for makefile that will re run cmake if your cmake file changes. Imnot going to do a line by line review of the file you picked, as I said I'm sure I can find awful code in bazel, meson, etc. "_CLASSIC_C_" is not a thing (why they don't use _STDC_? > meaning that in my code I don't need to do stuff like in my code to detect features In addition to that, I have been told that cmake takes ages to compile. ), it's just that they do not want to fix it for that specific file for some reason.Īnd then for CHECK_FUNCTION_EXISTS(), there are a few rare compilers that do not throw an error at compile-time if said function does not exist.Īlso, I have been told that cmake-generated Makefiles invoke cmake itself, so you can't really generate portable Makefiles with it. The funny thing is that they do know how to use the pre-standard C argument syntax (as in. It has been there for years and multiple people have pointed it out but they do not seem to care. "_CLASSIC_C_" is not a thing (why they don't use _STDC_? I don't know, they don't seem to know either) and the syntax that they use inside that ifdef is. Code like that is the price to pay for that level of support. that's a blessing and a curse, but it means that if I write simple program to run on some crufty microcontroller with a bastardised gcc toolchain from the 90s, it's fairly likely that cmake supports it out of the box. 3) CMake supports more platforms and targets than I've ever seen in my life, and likely supports more compilers than are necessary. 2) The alternative to this is you having to write something equivalent in your own code, meaning that in my code I don't need to do stuff like in my code to detect features my build system handles it for me. ![]() > Its code is horrifying too, for example:ġ) I'm sure I could find some horriffic code in meson too if I went digging. Far more luck than I've had with autotools. > I don't think that I have ever been able to successfully compile a project that uses CMake. (I have no meson experience, so can't compare it). , by setting the CMAKE_GENERATOR environment variable to ninja. You can even set it to the default generator It's literally that much more powerful and portable.> I think I had the best experience with Meson/Ninja so far.Ĭmake lets you use ninja as the backend if that's your cup of tea. Switching from, say, CMake to Bazel is like switching from assembly to C. That's unfortunate, because it does a fantastic job of separating the complexity that typically comes with a build system, from the complexity of the thing being built. I cannot stress enough how much I am not exaggerating.)īazel is big and complicated enough that people tend to be put off by its internal complexity. And after defining the toolchain - once, ever - it literally requires only a flag change and a single command to switch back and forth. It is quite possible, I use this on a regular basis. Want to compile using MSVC under Wine? That's actually possible. Oh, want GCC? No problem, just define the GCC toolchain, then run your test with -compiler=gcc. Need to build and test on Linux and Clang? Fine, maybe that's your default. Making the toolchain part of the input means that cross-builds are trivial. I think you've actually gotten your assessment backwards. (So I could see why you might be biased, build2 and all that.) They are probably working on fixing that and tons of others bugs and I'm sure it will be a great tool in the future. 6 months ago, if you tried to use Boost on Mac or Windows with its thousands of files and header isolation? You'll still be compiling your small project. Some of the features are cheap on Linux but super expensive otherwise on other platforms. ![]() Right now, it imposes the Google structure on your project which might not be what you want. People still target an old version that doesn't have the required primitives, people still skip providing logical targets even for header only libraries "lol, it's just an include path".īut Bazel isn't perfect, it still hasn't reached version "1" yet. You can do the same things with other build systems like CMake for example, but years of legacy prevent that. All your targets are building in isolation and all the requirements bubble up to the users.Īll of that is great and should be the norm nowadays. You can't have generators producing random files and use them without a proper declaration. You can't have circular dependencies between your targets. You can't have targets including random headers left and right. In some ways, Bazel is great as it imposes a good structure on your project. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |