summaryrefslogtreecommitdiff
path: root/deps/v8/build/win_is_xtree_patched.py
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/build/win_is_xtree_patched.py')
-rwxr-xr-xdeps/v8/build/win_is_xtree_patched.py28
1 files changed, 28 insertions, 0 deletions
diff --git a/deps/v8/build/win_is_xtree_patched.py b/deps/v8/build/win_is_xtree_patched.py
new file mode 100755
index 0000000000..54aff46d20
--- /dev/null
+++ b/deps/v8/build/win_is_xtree_patched.py
@@ -0,0 +1,28 @@
+#!/usr/bin/env python
+# Copyright 2014 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+"""Determines if the VS xtree header has been patched to disable C4702."""
+
+from __future__ import print_function
+
+import os
+
+
+def IsPatched():
+ # TODO(scottmg): For now, just return if we're using the packaged toolchain
+ # script (because we know it's patched). Another case could be added here to
+ # query the active VS installation and actually check the contents of xtree.
+ # http://crbug.com/346399.
+ return int(os.environ.get('DEPOT_TOOLS_WIN_TOOLCHAIN', 1)) == 1
+
+
+def DoMain(_):
+ """Hook to be called from gyp without starting a separate python
+ interpreter."""
+ return "1" if IsPatched() else "0"
+
+
+if __name__ == '__main__':
+ print(DoMain([]))