summaryrefslogtreecommitdiffstats
path: root/tools/glsl_preproc/main.py
diff options
context:
space:
mode:
Diffstat (limited to 'tools/glsl_preproc/main.py')
-rwxr-xr-xtools/glsl_preproc/main.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/tools/glsl_preproc/main.py b/tools/glsl_preproc/main.py
new file mode 100755
index 0000000..fcfea1f
--- /dev/null
+++ b/tools/glsl_preproc/main.py
@@ -0,0 +1,17 @@
+#!/usr/bin/env python3
+
+import sys
+import argparse
+
+from macros import Macro
+
+parser = argparse.ArgumentParser()
+parser.add_argument('input')
+parser.add_argument('output')
+parser.add_argument('-s', '--strip', default=False, action='store_true')
+args = parser.parse_args()
+
+with open(args.input) as infile:
+ with open(args.output, 'w') as outfile:
+ for line in Macro.process_file(infile, strip=args.strip):
+ outfile.write(line)