Switched to cmake

This commit is contained in:
2020-06-14 20:01:04 +02:00
parent 1cb3d5eae8
commit ffe620636d
15 changed files with 784 additions and 91 deletions

View File

@@ -1,5 +1,6 @@
#! /usr/bin/env python3
import sys
import os
import clang.cindex
from mako.template import Template
@@ -71,20 +72,27 @@ def main(argv):
output = argv[2]
index = clang.cindex.Index.create()
tu = index.parse(filename, ['-x', 'c++', '-std=c++2a', '-Iecs/include', '-I.build/git/stduuid/include', '-I/lib/gcc/x86_64-pc-linux-gnu/9.3.0/include'])
tu = index.parse(filename, ['-x', 'c++', '-std=c++2a', f'-Iecs/include', f'-Ibuild/_deps/stduuid-src/include', '-I/lib/gcc/x86_64-pc-linux-gnu/10.1.0/include'])
components = build_components(tu.cursor, filename)
tpl = Template(filename='template.mako')
tpl = Template(filename=f'template.mako')
include_file = filename.split('/')[-1]
if not os.path.exists(os.path.dirname(output)):
try:
os.makedirs(os.path.dirname(output))
except OSError as exc:
if exc.errno != errno.EEXIST:
raise
output_file = open(output, "w")
output_file.write(tpl.render(components=components, include_file=include_file))
output_file.close()
# for d in tu.diagnostics:
# print(d)
for d in tu.diagnostics:
print(d)
if __name__ == "__main__":
main(sys.argv)