summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tools/grit/grit/scons.py4
-rw-r--r--tools/grit/grit/tool/build.py14
2 files changed, 4 insertions, 14 deletions
diff --git a/tools/grit/grit/scons.py b/tools/grit/grit/scons.py
index 6410e26..89b8837 100644
--- a/tools/grit/grit/scons.py
+++ b/tools/grit/grit/scons.py
@@ -108,6 +108,10 @@ def _Emitter(target, source, env):
if _IsDebugEnabled():
print "GRIT: Added target %s" % path
+ # GRIT is not thread safe so we should only build one grit target at a time.
+ # We tell scons about this by making a fake side effect target.
+ env.SideEffect('grit_lock', target)
+
# return target and source lists
return (target, source)
diff --git a/tools/grit/grit/tool/build.py b/tools/grit/grit/tool/build.py
index 63ade73..ab89809 100644
--- a/tools/grit/grit/tool/build.py
+++ b/tools/grit/grit/tool/build.py
@@ -170,14 +170,6 @@ are exported to translation interchange files (e.g. XMB files), etc.
# character sets.
if output.GetType() in ['rc_header']:
encoding = 'cp1252'
- outname = output.GetOutputFilename()
- oldname = outname + '.tmp'
- if os.access(oldname, os.F_OK):
- os.remove(oldname)
- try:
- os.rename(outname, oldname)
- except OSError:
- oldname = None
else:
encoding = 'utf_16'
outfile = self.fo_create(output.GetOutputFilename(), 'wb')
@@ -197,12 +189,6 @@ are exported to translation interchange files (e.g. XMB files), etc.
self.ProcessNode(self.res, output, outfile)
outfile.close()
- if output.GetType() in ['rc_header'] and oldname:
- if open(oldname).read() != open(outname).read():
- os.remove(oldname)
- else:
- os.remove(outname)
- os.rename(oldname, outname)
self.VerboseOut(' done.\n')
# Print warnings if there are any duplicate shortcuts.