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)
评论列表
文章目录