def preprocess_source(self, in_file, additional_args=[]):
import subprocess
self._args.extend(self._build_compiler_flags())
self._args.extend(additional_args)
result = subprocess.run(self._args, stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True)
if result.returncode == 0:
return result.stdout
else:
if result.stderr:
Style.error('Preprocess failed: ')
print(result.stderr)
return ''
评论列表
文章目录