summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTim Rowley <[email protected]>2017-06-26 12:34:24 -0500
committerTim Rowley <[email protected]>2017-06-30 13:26:19 -0500
commitba64ddedc26278a4ce1fea66ae0938f11e20d9e8 (patch)
treecae49fa2a6d7ff7d301f408be3a278b5a5096e54 /src
parent7d0f80b1d3a99040d4a723bbbdaf76956249786a (diff)
swr/rast: generators will create target directories
Reviewed-by: Bruce Cherniak <bruce.cherniak at intel.com>
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/swr/rasterizer/codegen/gen_common.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/gallium/drivers/swr/rasterizer/codegen/gen_common.py b/src/gallium/drivers/swr/rasterizer/codegen/gen_common.py
index 07b455a4e1d..7f53ec6ad6c 100644
--- a/src/gallium/drivers/swr/rasterizer/codegen/gen_common.py
+++ b/src/gallium/drivers/swr/rasterizer/codegen/gen_common.py
@@ -22,6 +22,7 @@
# Python source
from __future__ import print_function
import os
+import errno
import sys
import argparse
from mako.template import Template
@@ -62,6 +63,12 @@ class MakoTemplateWriter:
'''
Write template data to a file
'''
+ if not os.path.exists(os.path.dirname(output_filename)):
+ try:
+ os.makedirs(os.path.dirname(output_filename))
+ except OSError as err:
+ if err.errno != errno.EEXIST:
+ raise
with open(output_filename, 'w') as outfile:
print(MakoTemplateWriter.to_string(template_filename, **kwargs), file=outfile)