2020-04-21 09:49:16 +02:00
|
|
|
#!/usr/bin/env python3
|
|
|
|
|
2020-05-28 12:31:15 +02:00
|
|
|
"usage: gen-harfbuzzcc.py harfbuzz.cc hb-blob.cc hb-buffer.cc ..."
|
|
|
|
|
2020-07-03 12:39:10 +02:00
|
|
|
import os, sys
|
2020-04-21 09:49:16 +02:00
|
|
|
|
2020-06-02 16:48:35 +02:00
|
|
|
os.chdir (os.path.dirname (__file__))
|
|
|
|
|
2020-04-21 09:49:16 +02:00
|
|
|
if len (sys.argv) < 3:
|
2020-05-28 20:21:29 +02:00
|
|
|
sys.exit (__doc__)
|
2020-04-21 09:49:16 +02:00
|
|
|
|
|
|
|
output_file = sys.argv[1]
|
|
|
|
source_paths = sys.argv[2:]
|
|
|
|
|
2020-07-03 23:38:30 +02:00
|
|
|
result = "".join ('#include "{}"\n'.format (os.path.basename (x)) for x in source_paths if x.endswith (".cc")).encode ()
|
2020-07-03 12:44:10 +02:00
|
|
|
|
|
|
|
with open (output_file, "rb") as f:
|
|
|
|
current = f.read()
|
|
|
|
|
|
|
|
if result != current:
|
|
|
|
with open (output_file, "wb") as f:
|
|
|
|
f.write (result)
|