4 ms·
Bazel's "macros" are just Python functions in Hancho. Manipulating the object files directly to link them into a binary can be wrapped up in a 2 line Python fun
by aappleby 3y ago
Bazel's "macros" are just Python functions in Hancho. Manipulating the object files directly to link them into a binary can be wrapped up in a 2 line Python function if you want to abstract over how the link rule works.
Both of these details are covered in the tutorial.
- chubot 3y agoHm I don't see anything like cc_library(). Though I misread the intro -- it doesn't claim to be like Bazel, just less than Bazel I saw "Bazel and Ninja" in the post, and thought it was more similar to what I had built. Though IMO, to build C/C++, even for small projects, you need something to parse .d files, the output of gcc -M. Otherwise you need to write more build metadata manually, and you can get it wrong And there is no enforcement of errors For truly small projects, I just use a shell script, and no incremental build. Works great --- And Ninja does parse .d files. The compiler is the authoritative source of header deps, because it has the preprocessor. Ninja is very fast and small. It's meant to be generated, so I wouldn't call it verbose. I don't think anyone really writes Ninja by hand. There are at least 3 common code generators for it -- CMake, the Chrome one, and Android one
- aappleby 3y agoHancho parses .d files.