summaryrefslogtreecommitdiffstats
path: root/Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/react-to-vsprops-changes.py
diff options
context:
space:
mode:
Diffstat (limited to 'Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/react-to-vsprops-changes.py')
-rw-r--r--Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/react-to-vsprops-changes.py37
1 files changed, 37 insertions, 0 deletions
diff --git a/Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/react-to-vsprops-changes.py b/Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/react-to-vsprops-changes.py
new file mode 100644
index 0000000..ab1df83
--- /dev/null
+++ b/Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/react-to-vsprops-changes.py
@@ -0,0 +1,37 @@
+#!/usr/bin/env python
+
+import glob
+import os
+import re
+import sys
+
+
+def main():
+ # It's fragile to rely on the location of this script to find the top-level
+ # source directory.
+ top_level_directory = os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))))
+
+ vsprops_directory = os.path.join(top_level_directory, 'WebKitLibraries', 'win', 'tools', 'vsprops')
+ vsprops_files = glob.glob(os.path.join(vsprops_directory, '*.vsprops'))
+ assert len(vsprops_files), "Couldn't find any .vsprops files in %s" % vsprops_directory
+ newest_vsprops_time = max(map(os.path.getmtime, vsprops_files))
+
+ # Delete any manifest-related files because Visual Studio isn't smart
+ # enough to figure out that it might need to rebuild them.
+ obj_directory = os.path.join(os.environ['CONFIGURATIONBUILDDIR'], 'obj')
+ for manifest_file in glob.iglob(os.path.join(obj_directory, '*', '*', '*.manifest*')):
+ manifest_time = os.path.getmtime(manifest_file)
+ if manifest_time < newest_vsprops_time:
+ print 'Deleting %s' % manifest_file
+ os.remove(manifest_file)
+
+ # Touch wtf/Platform.h so all files will be recompiled. This is necessary
+ # to pick up changes to preprocessor macros (e.g., ENABLE_*).
+ wtf_platform_h = os.path.join(top_level_directory, 'Source', 'JavaScriptCore', 'wtf', 'Platform.h')
+ if os.path.getmtime(wtf_platform_h) < newest_vsprops_time:
+ print 'Touching wtf/Platform.h'
+ os.utime(wtf_platform_h, None)
+
+
+if __name__ == '__main__':
+ sys.exit(main())