gcc_compile_wrapper.py 文件源码

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

项目:gn-build 作者: timniederhausen 项目源码 文件源码
def main():
  parser = argparse.ArgumentParser(description=__doc__)
  parser.add_argument('--resource-whitelist',
                      help='Generate a resource whitelist for this target.',
                      metavar='PATH')
  parser.add_argument('command', nargs=argparse.REMAINDER,
                      help='Compilation command')
  args = parser.parse_args()

  returncode, stderr = wrapper_utils.CaptureCommandStderr(
      wrapper_utils.CommandToRun(args.command))

  used_resources = wrapper_utils.ExtractResourceIdsFromPragmaWarnings(stderr)
  sys.stderr.write(stderr)

  if args.resource_whitelist:
    with open(args.resource_whitelist, 'w') as f:
      if used_resources:
        f.write('\n'.join(str(resource) for resource in used_resources))
        f.write('\n')

  return returncode
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号