weixin_39633917 2020-11-30 09:44
浏览 0

Move to ninja build system

Prototype, WIP version of this is here: https://github.com/adafruit/circuitpython/compare/master...tannewt:ninja

该提问来源于开源项目:adafruit/circuitpython

  • 写回答

2条回答 默认 最新

  • weixin_39633917 2020-11-30 09:44
    关注

    Yesterday I read through the short ninja build manual and wonder if it's worth using the depfile feature that automatically discovers required header files by using gcc -MM -MF $out.d ... to write out all required headers for a given C file. Using depfile could help in several ways:

    Besides eliminating the need to specify the implicit header dependencies for an given C file using | foo.h, it also makes the process more robust by ensuring no header files fall through. For example, the current generated ninja.build has:

    I definitely want to use depfile for header dependencies. I don't think it'll work for mpversionhdr though because the file doesn't exist until built. I believe you need to be explicit for headers that are generated.

    I've been experimenting by directly modifying the build.ninja file and can get past the genhdr/qstrdefs.enum.h error, but I don't trust the generated file is corrected because I haven't yet corrected for all the modified paths in the $include_pre, etc. Which is worrying: the ad-hoc sed commands, clearly are not fault tolerant and I think the sed functionality should be merged into the python later. What do you think?

    The sed stuff should definitely be merged into one of the QSTR build scripts.

    评论

报告相同问题?