summaryrefslogtreecommitdiff
path: root/Build/source/libs/harfbuzz/harfbuzz-src/src/gen-def.py
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/libs/harfbuzz/harfbuzz-src/src/gen-def.py')
-rw-r--r--Build/source/libs/harfbuzz/harfbuzz-src/src/gen-def.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/gen-def.py b/Build/source/libs/harfbuzz/harfbuzz-src/src/gen-def.py
index 9a997d65a1b..ba39eaae586 100644
--- a/Build/source/libs/harfbuzz/harfbuzz-src/src/gen-def.py
+++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/gen-def.py
@@ -4,8 +4,14 @@ from __future__ import print_function, division, absolute_import
import io, os, re, sys
+if len (sys.argv) < 3:
+ sys.exit("usage: gen-def.py harfbuzz.def hb.h [hb-blob.h hb-buffer.h ...]")
+
+output_file = sys.argv[1]
+header_paths = sys.argv[2:]
+
headers_content = []
-for h in os.environ["headers"].split (' '):
+for h in header_paths:
if h.endswith (".h"):
with io.open (h, encoding='utf-8') as f: headers_content.append (f.read ())
@@ -13,7 +19,7 @@ result = """EXPORTS
%s
LIBRARY lib%s-0.dll""" % (
"\n".join (sorted (re.findall (r"^hb_\w+(?= \()", "\n".join (headers_content), re.M))),
- sys.argv[1].replace ('.def', '')
+ output_file.replace ('.def', '')
)
-with open (sys.argv[1], "w") as f: f.write (result)
+with open (output_file, "w") as f: f.write (result)