compiler.py 文件源码

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

项目:rain 作者: scizzorz 项目源码 文件源码
def share(self):
    '''Compile a single Rain file into a shared object file.'''
    self.build()

    if self.compiled:
      return
    self.compiled = True

    self.compile_links()

    with self.okay('sharing'):
      target = self.target or self.qname + '.so'
      clang = os.getenv('CLANG', 'clang')
      flags = ['-O2', '-shared', '-fPIC']
      cmd = [clang, '-o', target, self.ll] + flags

      self.vprint('{:>10} {}', 'target', X(target, 'yellow'))
      self.vprint('{:>10} {}', 'flags', X('  '.join(flags), 'yellow'))
      self.vprint('{:>10} {}', 'src', X(self.ll, 'yellow'))

      subprocess.check_call(cmd)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号