setup.py 文件源码

python
阅读 19 收藏 0 点赞 0 评论 0

项目:phasm 作者: AbeelLab 项目源码 文件源码
def has_flag(compiler, flagname):
    """Return a boolean indicating whether a flag name is supported on
    the specified compiler.
    """
    import tempfile
    with tempfile.NamedTemporaryFile('w', suffix='.cpp') as f:
        f.write('int main (int argc, char **argv) { return 0; }')
        try:
            compiler.compile([f.name], extra_postargs=[flagname])
        except CompileError:
            return False
    return True
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号