Search code examples
pythonsetuptools

setup.py build that doesn't reinvoke compiler on every C source file / incremental build


Is there a way to run python setup.py build with C extensions which doesn't involve unconditionally rerunning the compiler on every C file known to the Python project?


Solution

  • We have managed to integrate ninja into the our setup.py. https://github.com/onnx/onnx/commit/d1bfcebd9c21a836d88b63ea8715c7a5b137ef32

    It creates ninja build files on the fly and invoke ninja at the link stage.