c_config.py 文件源码

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

项目:SoCFoundationFlow 作者: mattaw 项目源码 文件源码
def get_suncc_version(conf, cc):
    """Get the compiler version"""

    cmd = cc + ['-V']
    try:
        out, err = conf.cmd_and_log(cmd, output=0)
    except Errors.WafError as e:
        # Older versions of the compiler exit with non-zero status when reporting their version
        if not (hasattr(e, 'returncode') and hasattr(e, 'stdout') and hasattr(e, 'stderr')):
            conf.fatal('Could not find suncc %r' % cmd)
        out = e.stdout
        err = e.stderr

    version = (out or err)
    version = version.splitlines()[0]

    version_re = re.compile(r'cc:\s+sun\s+(c\+\+|c)\s+(?P<major>\d*)\.(?P<minor>\d*)', re.I).search
    match = version_re(version)
    if match:
        k = match.groupdict()
        conf.env['CC_VERSION'] = (k['major'], k['minor'])
    else:
        conf.fatal('Could not determine the suncc version.')

# ============ the --as-needed flag should added during the configuration, not at runtime =========
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号