Index: tools/grit/grit/tool/build.py |
diff --git a/tools/grit/grit/tool/build.py b/tools/grit/grit/tool/build.py |
index ab898093b7fde2acbf9182636e32ed4b188284d2..9e45859e4f10fff19a756af359c60f460391de3b 100644 |
--- a/tools/grit/grit/tool/build.py |
+++ b/tools/grit/grit/tool/build.py |
@@ -10,6 +10,7 @@ SCons build system. |
import os |
import getopt |
import types |
+import shutil |
import sys |
from grit import grd_reader |
@@ -189,6 +190,20 @@ are exported to translation interchange files (e.g. XMB files), etc. |
self.ProcessNode(self.res, output, outfile) |
outfile.close() |
+ |
+ # Generate the header and also put a copy in a grit subdir. We do this |
+ # so our include paths can have 'grit' in them. |
+ # TODO(tc): Once we transition all the #include lines to have 'grit' in |
+ # the path, we can only generate one header. |
+ if output.GetType() == 'rc_header': |
+ dir_name, header_name = os.path.split(output.GetOutputFilename()) |
+ dir_name = os.path.join(dir_name, 'grit') |
+ try: |
+ os.makedirs(dir_name) |
+ except OSError, e: |
+ pass |
+ shutil.copy2(output.GetOutputFilename(), |
+ os.path.join(dir_name, header_name)) |
self.VerboseOut(' done.\n') |
# Print warnings if there are any duplicate shortcuts. |