summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndroid Chromium Automerger <chromium-automerger@android>2013-07-17 00:24:08 +0000
committerAndroid Chromium Automerger <chromium-automerger@android>2013-07-17 00:24:08 +0000
commit01ae325e9f8ab372a8d8baed0f76c5d372987551 (patch)
tree1eebd0313aaf663152ab273cbb557cb2032b180e
parent7d5975f79c4108013e6e0ceaebe7ba0bc2efa03c (diff)
parentdc4f7194a410b59b21e3d3df9d65b2bce985853c (diff)
downloadgyp-01ae325e9f8ab372a8d8baed0f76c5d372987551.tar.gz
Merge tools/gyp from https://chromium.googlesource.com/external/gyp.git at dc4f7194a410b59b21e3d3df9d65b2bce985853c
This commit was generated by merge_from_chromium.py. Change-Id: Ic3f87fb448e1e9b148aef3e1d5169d7f1f26f8ac
-rw-r--r--pylib/gyp/MSVSVersion.py28
-rwxr-xr-xpylib/gyp/win_tool.py2
-rw-r--r--pylib/gyp/xcode_emulation.py5
-rw-r--r--test/mac/gyptest-xcode-gcc-clang.py40
-rw-r--r--test/mac/xcode-gcc/aliasing.cc13
-rw-r--r--test/mac/xcode-gcc/test-clang.gyp42
6 files changed, 128 insertions, 2 deletions
diff --git a/pylib/gyp/MSVSVersion.py b/pylib/gyp/MSVSVersion.py
index 2d95cd0c..6dfed3bd 100644
--- a/pylib/gyp/MSVSVersion.py
+++ b/pylib/gyp/MSVSVersion.py
@@ -197,6 +197,24 @@ def _CreateVersion(name, path, sdk_based=False):
if path:
path = os.path.normpath(path)
versions = {
+ '2013': VisualStudioVersion('2013',
+ 'Visual Studio 2013',
+ solution_version='13.00',
+ project_version='4.0',
+ flat_sln=False,
+ uses_vcxproj=True,
+ path=path,
+ sdk_based=sdk_based,
+ default_toolset='v110'),
+ '2013e': VisualStudioVersion('2013e',
+ 'Visual Studio 2013',
+ solution_version='13.00',
+ project_version='4.0',
+ flat_sln=True,
+ uses_vcxproj=True,
+ path=path,
+ sdk_based=sdk_based,
+ default_toolset='v110'),
'2012': VisualStudioVersion('2012',
'Visual Studio 2012',
solution_version='12.00',
@@ -288,10 +306,16 @@ def _DetectVisualStudioVersions(versions_to_check, force_express):
2008(e) - Visual Studio 2008 (9)
2010(e) - Visual Studio 2010 (10)
2012(e) - Visual Studio 2012 (11)
+ 2013(e) - Visual Studio 2013 (11)
Where (e) is e for express editions of MSVS and blank otherwise.
"""
version_to_year = {
- '8.0': '2005', '9.0': '2008', '10.0': '2010', '11.0': '2012'}
+ '8.0': '2005',
+ '9.0': '2008',
+ '10.0': '2010',
+ '11.0': '2012',
+ '12.0': '2013',
+ }
versions = []
for version in versions_to_check:
# Old method of searching for which VS version is installed
@@ -354,6 +378,8 @@ def SelectVisualStudioVersion(version='auto'):
'2010e': ('10.0',),
'2012': ('11.0',),
'2012e': ('11.0',),
+ '2013': ('12.0',),
+ '2013e': ('12.0',),
}
override_path = os.environ.get('GYP_MSVS_OVERRIDE_PATH')
if override_path:
diff --git a/pylib/gyp/win_tool.py b/pylib/gyp/win_tool.py
index 999dc778..3424c015 100755
--- a/pylib/gyp/win_tool.py
+++ b/pylib/gyp/win_tool.py
@@ -98,7 +98,7 @@ class WinTool(object):
and resource name which can be "1" (for executables) or "2" (for DLLs)."""
manifest_path, resource_path, resource_name = args
with open(resource_path, 'wb') as output:
- output.write('#include <winuser.h>\n%s RT_MANIFEST "%s"' % (
+ output.write('#include <windows.h>\n%s RT_MANIFEST "%s"' % (
resource_name,
os.path.abspath(manifest_path).replace('\\', '/')))
diff --git a/pylib/gyp/xcode_emulation.py b/pylib/gyp/xcode_emulation.py
index 543308d6..346bcf9b 100644
--- a/pylib/gyp/xcode_emulation.py
+++ b/pylib/gyp/xcode_emulation.py
@@ -308,6 +308,11 @@ class XcodeSettings(object):
else:
raise NotImplementedError('Unknown debug format %s' % dbg_format)
+ if self._Settings().get('GCC_STRICT_ALIASING') == 'YES':
+ cflags.append('-fstrict-aliasing')
+ elif self._Settings().get('GCC_STRICT_ALIASING') == 'NO':
+ cflags.append('-fno-strict-aliasing')
+
if self._Test('GCC_SYMBOLS_PRIVATE_EXTERN', 'YES', default='NO'):
cflags.append('-fvisibility=hidden')
diff --git a/test/mac/gyptest-xcode-gcc-clang.py b/test/mac/gyptest-xcode-gcc-clang.py
new file mode 100644
index 00000000..981c3fc5
--- /dev/null
+++ b/test/mac/gyptest-xcode-gcc-clang.py
@@ -0,0 +1,40 @@
+#!/usr/bin/env python
+
+# Copyright (c) 2012 Google Inc. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+"""
+Verifies that xcode-style GCC_... settings that require clang are handled
+properly.
+"""
+
+import TestGyp
+
+import os
+import sys
+
+if sys.platform == 'darwin':
+ test = TestGyp.TestGyp(formats=['ninja', 'make', 'xcode'])
+
+ CHDIR = 'xcode-gcc'
+ test.run_gyp('test-clang.gyp', chdir=CHDIR)
+
+ test.build('test-clang.gyp', 'aliasing_yes', chdir=CHDIR)
+ test.run_built_executable('aliasing_yes', chdir=CHDIR, stdout="1\n")
+ test.build('test-clang.gyp', 'aliasing_no', chdir=CHDIR)
+ test.run_built_executable('aliasing_no', chdir=CHDIR, stdout="0\n")
+
+ # The default behavior changed: strict aliasing used to be off, now it's on
+ # by default. The important part is that this is identical for all generators
+ # (which it is). TODO(thakis): Enable this once the bots have a newer Xcode.
+ #test.build('test-clang.gyp', 'aliasing_default', chdir=CHDIR)
+ #test.run_built_executable('aliasing_default', chdir=CHDIR, stdout="1\n")
+ # For now, just check the generated ninja file:
+ if test.format == 'ninja':
+ contents = open(test.built_file_path('obj/aliasing_default.ninja',
+ chdir=CHDIR)).read()
+ if 'strict-aliasing' in contents:
+ test.fail_test()
+
+ test.pass_test()
diff --git a/test/mac/xcode-gcc/aliasing.cc b/test/mac/xcode-gcc/aliasing.cc
new file mode 100644
index 00000000..16a41efb
--- /dev/null
+++ b/test/mac/xcode-gcc/aliasing.cc
@@ -0,0 +1,13 @@
+#include <stdio.h>
+
+void check(int* h, long* k) {
+ *h = 1;
+ *k = 0;
+ printf("%d\n", *h);
+}
+
+int main(void) {
+ long k;
+ check((int*)&k, &k);
+ return 0;
+}
diff --git a/test/mac/xcode-gcc/test-clang.gyp b/test/mac/xcode-gcc/test-clang.gyp
new file mode 100644
index 00000000..9f4a98ae
--- /dev/null
+++ b/test/mac/xcode-gcc/test-clang.gyp
@@ -0,0 +1,42 @@
+# Copyright (c) 2013 Google Inc. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+{
+ 'make_global_settings': [
+ ['CC', '/usr/bin/clang'],
+ ['CXX', '/usr/bin/clang++'],
+ ],
+
+ 'targets': [
+ {
+ 'target_name': 'aliasing_yes',
+ 'type': 'executable',
+ 'sources': [ 'aliasing.cc', ],
+ 'xcode_settings': {
+ 'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0',
+ 'GCC_STRICT_ALIASING': 'YES',
+ 'GCC_OPTIMIZATION_LEVEL': 2,
+ },
+ },
+ {
+ 'target_name': 'aliasing_no',
+ 'type': 'executable',
+ 'sources': [ 'aliasing.cc', ],
+ 'xcode_settings': {
+ 'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0',
+ 'GCC_STRICT_ALIASING': 'NO',
+ 'GCC_OPTIMIZATION_LEVEL': 2,
+ },
+ },
+ {
+ 'target_name': 'aliasing_default',
+ 'type': 'executable',
+ 'sources': [ 'aliasing.cc', ],
+ 'xcode_settings': {
+ 'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0',
+ 'GCC_OPTIMIZATION_LEVEL': 2,
+ },
+ },
+ ],
+}
+