summaryrefslogtreecommitdiffstats
path: root/third_party/python/gyp/test/win/linker-flags
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 14:29:10 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 14:29:10 +0000
commit2aa4a82499d4becd2284cdb482213d541b8804dd (patch)
treeb80bf8bf13c3766139fbacc530efd0dd9d54394c /third_party/python/gyp/test/win/linker-flags
parentInitial commit. (diff)
downloadfirefox-upstream.tar.xz
firefox-upstream.zip
Adding upstream version 86.0.1.upstream/86.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'third_party/python/gyp/test/win/linker-flags')
-rw-r--r--third_party/python/gyp/test/win/linker-flags/a/x.cc7
-rw-r--r--third_party/python/gyp/test/win/linker-flags/a/z.cc7
-rw-r--r--third_party/python/gyp/test/win/linker-flags/additional-deps.cc10
-rw-r--r--third_party/python/gyp/test/win/linker-flags/additional-deps.gyp30
-rw-r--r--third_party/python/gyp/test/win/linker-flags/additional-options.gyp29
-rw-r--r--third_party/python/gyp/test/win/linker-flags/aslr.gyp35
-rw-r--r--third_party/python/gyp/test/win/linker-flags/b/y.cc7
-rw-r--r--third_party/python/gyp/test/win/linker-flags/base-address.gyp38
-rw-r--r--third_party/python/gyp/test/win/linker-flags/debug-info.gyp28
-rw-r--r--third_party/python/gyp/test/win/linker-flags/deffile-multiple.gyp17
-rw-r--r--third_party/python/gyp/test/win/linker-flags/deffile.cc13
-rw-r--r--third_party/python/gyp/test/win/linker-flags/deffile.def8
-rw-r--r--third_party/python/gyp/test/win/linker-flags/deffile.gyp38
-rw-r--r--third_party/python/gyp/test/win/linker-flags/delay-load-dlls.gyp35
-rw-r--r--third_party/python/gyp/test/win/linker-flags/delay-load.cc10
-rw-r--r--third_party/python/gyp/test/win/linker-flags/embed-manifest.gyp109
-rw-r--r--third_party/python/gyp/test/win/linker-flags/enable-uac.gyp45
-rw-r--r--third_party/python/gyp/test/win/linker-flags/entrypointsymbol.cc13
-rw-r--r--third_party/python/gyp/test/win/linker-flags/entrypointsymbol.gyp28
-rw-r--r--third_party/python/gyp/test/win/linker-flags/extra.manifest11
-rw-r--r--third_party/python/gyp/test/win/linker-flags/extra2.manifest11
-rw-r--r--third_party/python/gyp/test/win/linker-flags/fixed-base.gyp52
-rw-r--r--third_party/python/gyp/test/win/linker-flags/force-symbol-reference.gyp39
-rw-r--r--third_party/python/gyp/test/win/linker-flags/generate-manifest.gyp166
-rw-r--r--third_party/python/gyp/test/win/linker-flags/hello.cc7
-rw-r--r--third_party/python/gyp/test/win/linker-flags/incremental.gyp65
-rw-r--r--third_party/python/gyp/test/win/linker-flags/inline_test.cc12
-rw-r--r--third_party/python/gyp/test/win/linker-flags/inline_test.h5
-rw-r--r--third_party/python/gyp/test/win/linker-flags/inline_test_main.cc15
-rw-r--r--third_party/python/gyp/test/win/linker-flags/large-address-aware.gyp28
-rw-r--r--third_party/python/gyp/test/win/linker-flags/library-adjust.cc10
-rw-r--r--third_party/python/gyp/test/win/linker-flags/library-adjust.gyp16
-rw-r--r--third_party/python/gyp/test/win/linker-flags/library-directories-define.cc7
-rw-r--r--third_party/python/gyp/test/win/linker-flags/library-directories-reference.cc10
-rw-r--r--third_party/python/gyp/test/win/linker-flags/library-directories.gyp42
-rw-r--r--third_party/python/gyp/test/win/linker-flags/link-ordering.gyp95
-rw-r--r--third_party/python/gyp/test/win/linker-flags/link-warning.cc10
-rw-r--r--third_party/python/gyp/test/win/linker-flags/ltcg.gyp42
-rw-r--r--third_party/python/gyp/test/win/linker-flags/main-crt.c8
-rw-r--r--third_party/python/gyp/test/win/linker-flags/manifest-in-comment.cc13
-rw-r--r--third_party/python/gyp/test/win/linker-flags/mapfile.cc12
-rw-r--r--third_party/python/gyp/test/win/linker-flags/mapfile.gyp45
-rw-r--r--third_party/python/gyp/test/win/linker-flags/no-default-libs.cc18
-rw-r--r--third_party/python/gyp/test/win/linker-flags/no-default-libs.gyp13
-rw-r--r--third_party/python/gyp/test/win/linker-flags/nodefaultlib.cc13
-rw-r--r--third_party/python/gyp/test/win/linker-flags/nodefaultlib.gyp30
-rw-r--r--third_party/python/gyp/test/win/linker-flags/nxcompat.gyp35
-rw-r--r--third_party/python/gyp/test/win/linker-flags/opt-icf.cc29
-rw-r--r--third_party/python/gyp/test/win/linker-flags/opt-icf.gyp63
-rw-r--r--third_party/python/gyp/test/win/linker-flags/opt-ref.cc11
-rw-r--r--third_party/python/gyp/test/win/linker-flags/opt-ref.gyp56
-rw-r--r--third_party/python/gyp/test/win/linker-flags/outputfile.gyp58
-rw-r--r--third_party/python/gyp/test/win/linker-flags/pdb-output.gyp49
-rw-r--r--third_party/python/gyp/test/win/linker-flags/pgo.gyp143
-rw-r--r--third_party/python/gyp/test/win/linker-flags/profile.gyp50
-rw-r--r--third_party/python/gyp/test/win/linker-flags/program-database.gyp40
-rw-r--r--third_party/python/gyp/test/win/linker-flags/safeseh.gyp79
-rw-r--r--third_party/python/gyp/test/win/linker-flags/safeseh_hello.cc11
-rw-r--r--third_party/python/gyp/test/win/linker-flags/safeseh_zero.asm10
-rw-r--r--third_party/python/gyp/test/win/linker-flags/safeseh_zero64.asm9
-rw-r--r--third_party/python/gyp/test/win/linker-flags/stacksize.gyp44
-rw-r--r--third_party/python/gyp/test/win/linker-flags/subdir/library.gyp13
-rw-r--r--third_party/python/gyp/test/win/linker-flags/subsystem-windows.cc9
-rw-r--r--third_party/python/gyp/test/win/linker-flags/subsystem.gyp70
-rw-r--r--third_party/python/gyp/test/win/linker-flags/target-machine.gyp48
-rw-r--r--third_party/python/gyp/test/win/linker-flags/tsaware.gyp28
-rw-r--r--third_party/python/gyp/test/win/linker-flags/unsupported-manifest.gyp13
-rw-r--r--third_party/python/gyp/test/win/linker-flags/update_pgd.py35
-rw-r--r--third_party/python/gyp/test/win/linker-flags/warn-as-error.gyp33
-rw-r--r--third_party/python/gyp/test/win/linker-flags/x.cc7
-rw-r--r--third_party/python/gyp/test/win/linker-flags/y.cc7
-rw-r--r--third_party/python/gyp/test/win/linker-flags/z.cc7
72 files changed, 2259 insertions, 0 deletions
diff --git a/third_party/python/gyp/test/win/linker-flags/a/x.cc b/third_party/python/gyp/test/win/linker-flags/a/x.cc
new file mode 100644
index 0000000000..f5f763b095
--- /dev/null
+++ b/third_party/python/gyp/test/win/linker-flags/a/x.cc
@@ -0,0 +1,7 @@
+// 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.
+
+int x() {
+ return 1;
+}
diff --git a/third_party/python/gyp/test/win/linker-flags/a/z.cc b/third_party/python/gyp/test/win/linker-flags/a/z.cc
new file mode 100644
index 0000000000..8a43501270
--- /dev/null
+++ b/third_party/python/gyp/test/win/linker-flags/a/z.cc
@@ -0,0 +1,7 @@
+// 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.
+
+int z() {
+ return 3;
+}
diff --git a/third_party/python/gyp/test/win/linker-flags/additional-deps.cc b/third_party/python/gyp/test/win/linker-flags/additional-deps.cc
new file mode 100644
index 0000000000..7dfb589d26
--- /dev/null
+++ b/third_party/python/gyp/test/win/linker-flags/additional-deps.cc
@@ -0,0 +1,10 @@
+// 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.
+
+#include <winsock2.h>
+
+int main() {
+ WSAStartup(0, 0);
+ return 0;
+}
diff --git a/third_party/python/gyp/test/win/linker-flags/additional-deps.gyp b/third_party/python/gyp/test/win/linker-flags/additional-deps.gyp
new file mode 100644
index 0000000000..55afe64fb0
--- /dev/null
+++ b/third_party/python/gyp/test/win/linker-flags/additional-deps.gyp
@@ -0,0 +1,30 @@
+# 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.
+
+{
+ 'targets': [
+ {
+ 'target_name': 'test_deps_none',
+ 'type': 'executable',
+ 'msvs_settings': {
+ 'VCLinkerTool': {
+ }
+ },
+ 'sources': ['hello.cc'],
+ },
+ {
+ 'target_name': 'test_deps_few',
+ 'type': 'executable',
+ 'msvs_settings': {
+ 'VCLinkerTool': {
+ 'AdditionalDependencies': [
+ 'wininet.lib',
+ 'ws2_32.lib',
+ ]
+ }
+ },
+ 'sources': ['additional-deps.cc'],
+ },
+ ]
+}
diff --git a/third_party/python/gyp/test/win/linker-flags/additional-options.gyp b/third_party/python/gyp/test/win/linker-flags/additional-options.gyp
new file mode 100644
index 0000000000..cab3994cd1
--- /dev/null
+++ b/third_party/python/gyp/test/win/linker-flags/additional-options.gyp
@@ -0,0 +1,29 @@
+# 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.
+
+{
+ 'targets': [
+ {
+ 'target_name': 'test_additional_none',
+ 'type': 'executable',
+ 'msvs_settings': {
+ 'VCLinkerTool': {
+ }
+ },
+ 'sources': ['hello.cc'],
+ },
+ {
+ 'target_name': 'test_additional_few',
+ 'type': 'executable',
+ 'msvs_settings': {
+ 'VCLinkerTool': {
+ 'AdditionalOptions': [
+ '/dynamicbase:no',
+ ]
+ }
+ },
+ 'sources': ['hello.cc'],
+ },
+ ]
+}
diff --git a/third_party/python/gyp/test/win/linker-flags/aslr.gyp b/third_party/python/gyp/test/win/linker-flags/aslr.gyp
new file mode 100644
index 0000000000..b3aefd50b7
--- /dev/null
+++ b/third_party/python/gyp/test/win/linker-flags/aslr.gyp
@@ -0,0 +1,35 @@
+# 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.
+
+{
+ 'targets': [
+ {
+ 'target_name': 'test_aslr_default',
+ 'type': 'executable',
+ 'msvs_settings': {
+ },
+ 'sources': ['hello.cc'],
+ },
+ {
+ 'target_name': 'test_aslr_no',
+ 'type': 'executable',
+ 'msvs_settings': {
+ 'VCLinkerTool': {
+ 'RandomizedBaseAddress': '1',
+ },
+ },
+ 'sources': ['hello.cc'],
+ },
+ {
+ 'target_name': 'test_aslr_yes',
+ 'type': 'executable',
+ 'msvs_settings': {
+ 'VCLinkerTool': {
+ 'RandomizedBaseAddress': '2',
+ }
+ },
+ 'sources': ['hello.cc'],
+ },
+ ]
+}
diff --git a/third_party/python/gyp/test/win/linker-flags/b/y.cc b/third_party/python/gyp/test/win/linker-flags/b/y.cc
new file mode 100644
index 0000000000..bd884119fc
--- /dev/null
+++ b/third_party/python/gyp/test/win/linker-flags/b/y.cc
@@ -0,0 +1,7 @@
+// 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.
+
+int y() {
+ return 2;
+}
diff --git a/third_party/python/gyp/test/win/linker-flags/base-address.gyp b/third_party/python/gyp/test/win/linker-flags/base-address.gyp
new file mode 100644
index 0000000000..873ebfea3f
--- /dev/null
+++ b/third_party/python/gyp/test/win/linker-flags/base-address.gyp
@@ -0,0 +1,38 @@
+# Copyright 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.
+
+{
+ 'targets': [
+ {
+ 'target_name': 'test_base_specified_exe',
+ 'type': 'executable',
+ 'msvs_settings': {
+ 'VCLinkerTool': {
+ 'BaseAddress': '0x00420000',
+ },
+ },
+ 'sources': ['hello.cc'],
+ },
+ {
+ 'target_name': 'test_base_specified_dll',
+ 'type': 'shared_library',
+ 'msvs_settings': {
+ 'VCLinkerTool': {
+ 'BaseAddress': '0x10420000',
+ },
+ },
+ 'sources': ['hello.cc'],
+ },
+ {
+ 'target_name': 'test_base_default_exe',
+ 'type': 'executable',
+ 'sources': ['hello.cc'],
+ },
+ {
+ 'target_name': 'test_base_default_dll',
+ 'type': 'shared_library',
+ 'sources': ['hello.cc'],
+ },
+ ]
+}
diff --git a/third_party/python/gyp/test/win/linker-flags/debug-info.gyp b/third_party/python/gyp/test/win/linker-flags/debug-info.gyp
new file mode 100644
index 0000000000..d47d0ecced
--- /dev/null
+++ b/third_party/python/gyp/test/win/linker-flags/debug-info.gyp
@@ -0,0 +1,28 @@
+# 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.
+
+{
+ 'targets': [
+ {
+ 'target_name': 'test_debug_off',
+ 'type': 'executable',
+ 'msvs_settings': {
+ 'VCLinkerTool': {
+ 'GenerateDebugInformation': 'false'
+ },
+ },
+ 'sources': ['hello.cc'],
+ },
+ {
+ 'target_name': 'test_debug_on',
+ 'type': 'executable',
+ 'msvs_settings': {
+ 'VCLinkerTool': {
+ 'GenerateDebugInformation': 'true'
+ },
+ },
+ 'sources': ['hello.cc'],
+ },
+ ]
+}
diff --git a/third_party/python/gyp/test/win/linker-flags/deffile-multiple.gyp b/third_party/python/gyp/test/win/linker-flags/deffile-multiple.gyp
new file mode 100644
index 0000000000..c74a9af20a
--- /dev/null
+++ b/third_party/python/gyp/test/win/linker-flags/deffile-multiple.gyp
@@ -0,0 +1,17 @@
+# 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.
+
+{
+ 'targets': [
+ {
+ 'target_name': 'test_deffile_multiple_fail',
+ 'type': 'shared_library',
+ 'sources': [
+ 'deffile.cc',
+ 'deffile.def',
+ 'deffile2.def',
+ ],
+ },
+ ]
+}
diff --git a/third_party/python/gyp/test/win/linker-flags/deffile.cc b/third_party/python/gyp/test/win/linker-flags/deffile.cc
new file mode 100644
index 0000000000..fa203b34c8
--- /dev/null
+++ b/third_party/python/gyp/test/win/linker-flags/deffile.cc
@@ -0,0 +1,13 @@
+// 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.
+
+void AnExportedFunction() {
+}
+
+void AnotherExportedFunction() {
+}
+
+int main() {
+ return 0;
+}
diff --git a/third_party/python/gyp/test/win/linker-flags/deffile.def b/third_party/python/gyp/test/win/linker-flags/deffile.def
new file mode 100644
index 0000000000..ba9d399bd6
--- /dev/null
+++ b/third_party/python/gyp/test/win/linker-flags/deffile.def
@@ -0,0 +1,8 @@
+; 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.
+
+LIBRARY test_deffile_ok
+
+EXPORTS
+ AnExportedFunction
diff --git a/third_party/python/gyp/test/win/linker-flags/deffile.gyp b/third_party/python/gyp/test/win/linker-flags/deffile.gyp
new file mode 100644
index 0000000000..7b241d5e3a
--- /dev/null
+++ b/third_party/python/gyp/test/win/linker-flags/deffile.gyp
@@ -0,0 +1,38 @@
+# 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.
+
+{
+ 'targets': [
+ {
+ 'target_name': 'test_deffile_dll_ok',
+ 'type': 'shared_library',
+ 'sources': [
+ 'deffile.cc',
+ 'deffile.def',
+ ],
+ },
+ {
+ 'target_name': 'test_deffile_dll_notexported',
+ 'type': 'shared_library',
+ 'sources': [
+ 'deffile.cc',
+ ],
+ },
+ {
+ 'target_name': 'test_deffile_exe_ok',
+ 'type': 'executable',
+ 'sources': [
+ 'deffile.cc',
+ 'deffile.def',
+ ],
+ },
+ {
+ 'target_name': 'test_deffile_exe_notexported',
+ 'type': 'executable',
+ 'sources': [
+ 'deffile.cc',
+ ],
+ },
+ ]
+}
diff --git a/third_party/python/gyp/test/win/linker-flags/delay-load-dlls.gyp b/third_party/python/gyp/test/win/linker-flags/delay-load-dlls.gyp
new file mode 100644
index 0000000000..671cbaa802
--- /dev/null
+++ b/third_party/python/gyp/test/win/linker-flags/delay-load-dlls.gyp
@@ -0,0 +1,35 @@
+# 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.
+
+{
+ 'targets': [
+ {
+ 'target_name': 'test_dld_none',
+ 'type': 'executable',
+ 'msvs_settings': {
+ 'VCLinkerTool': {
+ }
+ },
+ 'sources': ['delay-load.cc'],
+ 'libraries': [
+ 'delayimp.lib',
+ 'shell32.lib',
+ ],
+ },
+ {
+ 'target_name': 'test_dld_shell32',
+ 'type': 'executable',
+ 'msvs_settings': {
+ 'VCLinkerTool': {
+ 'DelayLoadDLLs': ['shell32.dll']
+ }
+ },
+ 'sources': ['delay-load.cc'],
+ 'libraries': [
+ 'delayimp.lib',
+ 'shell32.lib',
+ ],
+ },
+ ]
+}
diff --git a/third_party/python/gyp/test/win/linker-flags/delay-load.cc b/third_party/python/gyp/test/win/linker-flags/delay-load.cc
new file mode 100644
index 0000000000..2be34aa876
--- /dev/null
+++ b/third_party/python/gyp/test/win/linker-flags/delay-load.cc
@@ -0,0 +1,10 @@
+// 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.
+
+#include <shlobj.h>
+
+int main() {
+ SHCreateDirectory(0, 0);
+ return 0;
+}
diff --git a/third_party/python/gyp/test/win/linker-flags/embed-manifest.gyp b/third_party/python/gyp/test/win/linker-flags/embed-manifest.gyp
new file mode 100644
index 0000000000..fefb2f56d8
--- /dev/null
+++ b/third_party/python/gyp/test/win/linker-flags/embed-manifest.gyp
@@ -0,0 +1,109 @@
+# Copyright (c) 2013 Yandex LLC. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+{
+ 'targets': [
+ {
+ 'target_name': 'test_manifest_exe',
+ 'type': 'executable',
+ 'sources': ['hello.cc'],
+ 'msvs_settings': {
+ 'VCLinkerTool': {
+ 'LinkIncremental': '1',
+ },
+ 'VCManifestTool': {
+ 'EmbedManifest': 'true',
+ }
+ },
+ },
+ {
+ 'target_name': 'test_manifest_dll',
+ 'type': 'loadable_module',
+ 'sources': ['hello.cc'],
+ 'msvs_settings': {
+ 'VCLinkerTool': {
+ 'LinkIncremental': '1',
+ },
+ 'VCManifestTool': {
+ 'EmbedManifest': 'true',
+ }
+ },
+ },
+ {
+ 'target_name': 'test_manifest_extra1',
+ 'type': 'executable',
+ 'sources': ['hello.cc'],
+ 'msvs_settings': {
+ 'VCManifestTool': {
+ 'EmbedManifest': 'true',
+ 'AdditionalManifestFiles': 'extra.manifest',
+ }
+ },
+ },
+ {
+ 'target_name': 'test_manifest_extra2',
+ 'type': 'executable',
+ 'sources': ['hello.cc'],
+ 'msvs_settings': {
+ 'VCManifestTool': {
+ 'EmbedManifest': 'true',
+ 'AdditionalManifestFiles': 'extra.manifest;extra2.manifest',
+ }
+ },
+ },
+ {
+ 'target_name': 'test_manifest_extra_list',
+ 'type': 'executable',
+ 'sources': ['hello.cc'],
+ 'msvs_settings': {
+ 'VCManifestTool': {
+ 'EmbedManifest': 'true',
+ 'AdditionalManifestFiles': [
+ 'extra.manifest',
+ 'extra2.manifest'
+ ],
+ }
+ },
+ },
+ {
+ 'target_name': 'test_manifest_dll_inc',
+ 'type': 'loadable_module',
+ 'sources': ['hello.cc'],
+ 'msvs_settings': {
+ 'VCLinkerTool': {
+ 'LinkIncremental': '2',
+ },
+ 'VCManifestTool': {
+ 'EmbedManifest': 'true',
+ }
+ },
+ },
+ {
+ 'target_name': 'test_manifest_exe_inc',
+ 'type': 'executable',
+ 'sources': ['hello.cc'],
+ 'msvs_settings': {
+ 'VCLinkerTool': {
+ 'LinkIncremental': '2',
+ },
+ 'VCManifestTool': {
+ 'EmbedManifest': 'true',
+ }
+ },
+ },
+ {
+ 'target_name': 'test_manifest_exe_inc_no_embed',
+ 'type': 'executable',
+ 'sources': ['hello.cc'],
+ 'msvs_settings': {
+ 'VCLinkerTool': {
+ 'LinkIncremental': '2',
+ },
+ 'VCManifestTool': {
+ 'EmbedManifest': 'false',
+ }
+ },
+ },
+ ]
+}
diff --git a/third_party/python/gyp/test/win/linker-flags/enable-uac.gyp b/third_party/python/gyp/test/win/linker-flags/enable-uac.gyp
new file mode 100644
index 0000000000..4e58c86ec8
--- /dev/null
+++ b/third_party/python/gyp/test/win/linker-flags/enable-uac.gyp
@@ -0,0 +1,45 @@
+# Copyright 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.
+
+{
+ 'targets': [
+ {
+ 'target_name': 'enable_uac',
+ 'type': 'executable',
+ 'sources': ['hello.cc'],
+ 'msvs_settings': {
+ 'VCManifestTool': {
+ 'EmbedManifest': 'true',
+ }
+ },
+ },
+ {
+ 'target_name': 'enable_uac_no',
+ 'type': 'executable',
+ 'sources': ['hello.cc'],
+ 'msvs_settings': {
+ 'VCLinkerTool': {
+ 'EnableUAC': 'false',
+ },
+ 'VCManifestTool': {
+ 'EmbedManifest': 'true',
+ }
+ },
+ },
+ {
+ 'target_name': 'enable_uac_admin',
+ 'type': 'executable',
+ 'sources': ['hello.cc'],
+ 'msvs_settings': {
+ 'VCLinkerTool': {
+ 'UACExecutionLevel': 2,
+ 'UACUIAccess': 'true',
+ },
+ 'VCManifestTool': {
+ 'EmbedManifest': 'true',
+ }
+ },
+ },
+ ]
+}
diff --git a/third_party/python/gyp/test/win/linker-flags/entrypointsymbol.cc b/third_party/python/gyp/test/win/linker-flags/entrypointsymbol.cc
new file mode 100644
index 0000000000..b567bc87b3
--- /dev/null
+++ b/third_party/python/gyp/test/win/linker-flags/entrypointsymbol.cc
@@ -0,0 +1,13 @@
+// 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.
+
+// The entry point specified by link.exe /ENTRY option.
+extern "C" void MainEntryPoint() {
+}
+
+// Still needed because the linker checks for existence of one of main, wmain,
+// WinMain, or wMain to offer informative diagnositics.
+int main() {
+ return 0;
+}
diff --git a/third_party/python/gyp/test/win/linker-flags/entrypointsymbol.gyp b/third_party/python/gyp/test/win/linker-flags/entrypointsymbol.gyp
new file mode 100644
index 0000000000..7f2c14252d
--- /dev/null
+++ b/third_party/python/gyp/test/win/linker-flags/entrypointsymbol.gyp
@@ -0,0 +1,28 @@
+# 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.
+
+{
+ 'targets': [
+ {
+ 'target_name': 'test_ok',
+ 'type': 'executable',
+ 'msvs_settings': {
+ 'VCLinkerTool': {
+ 'EntryPointSymbol': 'MainEntryPoint',
+ }
+ },
+ 'sources': ['entrypointsymbol.cc'],
+ },
+ {
+ 'target_name': 'test_fail',
+ 'type': 'executable',
+ 'msvs_settings': {
+ 'VCLinkerTool': {
+ 'EntryPointSymbol': 'MainEntryPoint',
+ }
+ },
+ 'sources': ['hello.cc'],
+ },
+ ]
+}
diff --git a/third_party/python/gyp/test/win/linker-flags/extra.manifest b/third_party/python/gyp/test/win/linker-flags/extra.manifest
new file mode 100644
index 0000000000..2e436dc251
--- /dev/null
+++ b/third_party/python/gyp/test/win/linker-flags/extra.manifest
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
+
+ <compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
+ <application>
+ <!--This Id value indicates the application supports Windows 7 functionality-->
+ <supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
+ </application>
+ </compatibility>
+
+</assembly>
diff --git a/third_party/python/gyp/test/win/linker-flags/extra2.manifest b/third_party/python/gyp/test/win/linker-flags/extra2.manifest
new file mode 100644
index 0000000000..bfb570ca59
--- /dev/null
+++ b/third_party/python/gyp/test/win/linker-flags/extra2.manifest
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
+
+ <compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
+ <application>
+ <!--This Id value indicates the application supports Windows Vista functionality -->
+ <supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/>
+ </application>
+ </compatibility>
+
+</assembly>
diff --git a/third_party/python/gyp/test/win/linker-flags/fixed-base.gyp b/third_party/python/gyp/test/win/linker-flags/fixed-base.gyp
new file mode 100644
index 0000000000..cc2982eb27
--- /dev/null
+++ b/third_party/python/gyp/test/win/linker-flags/fixed-base.gyp
@@ -0,0 +1,52 @@
+# 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.
+
+{
+ 'targets': [
+ # Disable DYNAMICBASE for these tests because it implies/doesn't imply
+ # FIXED in certain cases so it complicates the test for FIXED.
+ {
+ 'target_name': 'test_fixed_default_exe',
+ 'type': 'executable',
+ 'msvs_settings': {
+ 'VCLinkerTool': {
+ 'RandomizedBaseAddress': '1',
+ },
+ },
+ 'sources': ['hello.cc'],
+ },
+ {
+ 'target_name': 'test_fixed_default_dll',
+ 'type': 'shared_library',
+ 'msvs_settings': {
+ 'VCLinkerTool': {
+ 'RandomizedBaseAddress': '1',
+ },
+ },
+ 'sources': ['hello.cc'],
+ },
+ {
+ 'target_name': 'test_fixed_no',
+ 'type': 'executable',
+ 'msvs_settings': {
+ 'VCLinkerTool': {
+ 'FixedBaseAddress': '1',
+ 'RandomizedBaseAddress': '1',
+ }
+ },
+ 'sources': ['hello.cc'],
+ },
+ {
+ 'target_name': 'test_fixed_yes',
+ 'type': 'executable',
+ 'msvs_settings': {
+ 'VCLinkerTool': {
+ 'FixedBaseAddress': '2',
+ 'RandomizedBaseAddress': '1',
+ },
+ },
+ 'sources': ['hello.cc'],
+ },
+ ]
+}
diff --git a/third_party/python/gyp/test/win/linker-flags/force-symbol-reference.gyp b/third_party/python/gyp/test/win/linker-flags/force-symbol-reference.gyp
new file mode 100644
index 0000000000..d6d02a6848
--- /dev/null
+++ b/third_party/python/gyp/test/win/linker-flags/force-symbol-reference.gyp
@@ -0,0 +1,39 @@
+# 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.
+
+{
+ 'targets': [
+ {
+ 'target_name': 'test_force_reference_lib',
+ 'type': 'static_library',
+ 'sources': ['x.cc', 'y.cc'],
+ },
+ {
+ 'target_name': 'test_force_reference',
+ 'type': 'executable',
+ # Turn on debug info to get symbols in disasm for the test code, and
+ # turn on opt:ref to drop unused symbols to make sure we wouldn't
+ # otherwise have the symbols.
+ 'msvs_settings': {
+ 'VCCLCompilerTool': {
+ 'DebugInformationFormat': '3',
+ },
+ 'VCLinkerTool': {
+ 'GenerateDebugInformation': 'true',
+ 'AdditionalOptions': [
+ '/OPT:REF',
+ ],
+ 'ForceSymbolReferences': [
+ '?x@@YAHXZ',
+ '?y@@YAHXZ',
+ ],
+ },
+ },
+ 'sources': ['hello.cc'],
+ 'dependencies': [
+ 'test_force_reference_lib',
+ ],
+ },
+ ]
+}
diff --git a/third_party/python/gyp/test/win/linker-flags/generate-manifest.gyp b/third_party/python/gyp/test/win/linker-flags/generate-manifest.gyp
new file mode 100644
index 0000000000..34a68d1a48
--- /dev/null
+++ b/third_party/python/gyp/test/win/linker-flags/generate-manifest.gyp
@@ -0,0 +1,166 @@
+# 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.
+
+{
+ 'targets': [
+ {
+ 'target_name': 'test_generate_manifest_true',
+ 'type': 'executable',
+ 'sources': ['hello.cc'],
+ 'msvs_settings': {
+ 'VCLinkerTool': {
+ 'EnableUAC': 'true',
+ 'GenerateManifest': 'true',
+ },
+ 'VCManifestTool': {
+ 'EmbedManifest': 'false',
+ },
+ },
+ },
+ {
+ 'target_name': 'test_generate_manifest_false',
+ 'type': 'executable',
+ 'sources': ['hello.cc'],
+ 'msvs_settings': {
+ 'VCLinkerTool': {
+ 'EnableUAC': 'true',
+ 'GenerateManifest': 'false',
+ },
+ 'VCManifestTool': {
+ 'EmbedManifest': 'false',
+ },
+ },
+ },
+ {
+ 'target_name': 'test_generate_manifest_default',
+ 'type': 'executable',
+ 'sources': ['hello.cc'],
+ 'msvs_settings': {
+ 'VCLinkerTool': {
+ 'EnableUAC': 'true',
+ },
+ 'VCManifestTool': {
+ 'EmbedManifest': 'false',
+ },
+ },
+ },
+ {
+ 'target_name': 'test_generate_manifest_true_as_embedded',
+ 'type': 'executable',
+ 'sources': ['hello.cc'],
+ 'msvs_settings': {
+ 'VCLinkerTool': {
+ 'EnableUAC': 'true',
+ 'GenerateManifest': 'true',
+ },
+ 'VCManifestTool': {
+ 'EmbedManifest': 'true',
+ },
+ },
+ },
+ {
+ 'target_name': 'test_generate_manifest_false_as_embedded',
+ 'type': 'executable',
+ 'sources': ['hello.cc'],
+ 'msvs_settings': {
+ 'VCLinkerTool': {
+ 'EnableUAC': 'true',
+ 'GenerateManifest': 'false',
+ },
+ 'VCManifestTool': {
+ 'EmbedManifest': 'true',
+ },
+ },
+ },
+ {
+ 'target_name': 'test_generate_manifest_default_as_embedded',
+ 'type': 'executable',
+ 'sources': ['hello.cc'],
+ 'msvs_settings': {
+ 'VCLinkerTool': {
+ 'EnableUAC': 'true',
+ },
+ 'VCManifestTool': {
+ 'EmbedManifest': 'true',
+ },
+ },
+ },
+ {
+ 'target_name': 'test_generate_manifest_true_with_extra_manifest',
+ 'type': 'executable',
+ 'sources': ['hello.cc'],
+ 'msvs_settings': {
+ 'VCLinkerTool': {
+ 'EnableUAC': 'true',
+ 'GenerateManifest': 'true',
+ },
+ 'VCManifestTool': {
+ 'EmbedManifest': 'false',
+ 'AdditionalManifestFiles': 'extra.manifest;extra2.manifest',
+ },
+ },
+ },
+ {
+ 'target_name': 'test_generate_manifest_false_with_extra_manifest',
+ 'type': 'executable',
+ 'sources': ['hello.cc'],
+ 'msvs_settings': {
+ 'VCLinkerTool': {
+ 'EnableUAC': 'true',
+ 'GenerateManifest': 'false',
+ },
+ 'VCManifestTool': {
+ 'EmbedManifest': 'false',
+ 'AdditionalManifestFiles': 'extra.manifest;extra2.manifest',
+ },
+ },
+ },
+ {
+ 'target_name': 'test_generate_manifest_true_with_extra_manifest_list',
+ 'type': 'executable',
+ 'sources': ['hello.cc'],
+ 'msvs_settings': {
+ 'VCLinkerTool': {
+ 'EnableUAC': 'true',
+ 'GenerateManifest': 'true',
+ },
+ 'VCManifestTool': {
+ 'EmbedManifest': 'false',
+ 'AdditionalManifestFiles': [
+ 'extra.manifest',
+ 'extra2.manifest',
+ ],
+ },
+ },
+ },
+ {
+ 'target_name': 'test_generate_manifest_false_with_extra_manifest_list',
+ 'type': 'executable',
+ 'sources': ['hello.cc'],
+ 'msvs_settings': {
+ 'VCLinkerTool': {
+ 'EnableUAC': 'true',
+ 'GenerateManifest': 'false',
+ },
+ 'VCManifestTool': {
+ 'EmbedManifest': 'false',
+ 'AdditionalManifestFiles': [
+ 'extra.manifest',
+ 'extra2.manifest',
+ ],
+ },
+ },
+ },
+ {
+ 'target_name': 'test_generate_manifest_default_embed_default',
+ 'type': 'executable',
+ 'sources': ['hello.cc'],
+ 'msvs_settings': {
+ 'VCLinkerTool': {
+ 'EnableUAC': 'true',
+ },
+ },
+ },
+ ]
+}
diff --git a/third_party/python/gyp/test/win/linker-flags/hello.cc b/third_party/python/gyp/test/win/linker-flags/hello.cc
new file mode 100644
index 0000000000..1711567ef5
--- /dev/null
+++ b/third_party/python/gyp/test/win/linker-flags/hello.cc
@@ -0,0 +1,7 @@
+// 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.
+
+int main() {
+ return 0;
+}
diff --git a/third_party/python/gyp/test/win/linker-flags/incremental.gyp b/third_party/python/gyp/test/win/linker-flags/incremental.gyp
new file mode 100644
index 0000000000..59f3103253
--- /dev/null
+++ b/third_party/python/gyp/test/win/linker-flags/incremental.gyp
@@ -0,0 +1,65 @@
+# 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.
+
+{
+ 'targets': [
+ # Turn on debug information so the incremental linking tables have a
+ # visible symbolic name in the disassembly.
+ {
+ 'target_name': 'test_incremental_unset',
+ 'type': 'executable',
+ 'msvs_settings': {
+ 'VCCLCompilerTool': {
+ 'DebugInformationFormat': '3',
+ },
+ 'VCLinkerTool': {
+ 'GenerateDebugInformation': 'true',
+ },
+ },
+ 'sources': ['hello.cc'],
+ },
+ {
+ 'target_name': 'test_incremental_default',
+ 'type': 'executable',
+ 'msvs_settings': {
+ 'VCCLCompilerTool': {
+ 'DebugInformationFormat': '3',
+ },
+ 'VCLinkerTool': {
+ 'GenerateDebugInformation': 'true',
+ 'LinkIncremental': '0',
+ },
+ },
+ 'sources': ['hello.cc'],
+ },
+ {
+ 'target_name': 'test_incremental_no',
+ 'type': 'executable',
+ 'msvs_settings': {
+ 'VCCLCompilerTool': {
+ 'DebugInformationFormat': '3',
+ },
+ 'VCLinkerTool': {
+ 'GenerateDebugInformation': 'true',
+ 'LinkIncremental': '1',
+ },
+ },
+ 'sources': ['hello.cc'],
+ },
+ {
+ 'target_name': 'test_incremental_yes',
+ 'type': 'executable',
+ 'msvs_settings': {
+ 'VCCLCompilerTool': {
+ 'DebugInformationFormat': '3',
+ },
+ 'VCLinkerTool': {
+ 'GenerateDebugInformation': 'true',
+ 'LinkIncremental': '2',
+ }
+ },
+ 'sources': ['hello.cc'],
+ },
+ ]
+}
diff --git a/third_party/python/gyp/test/win/linker-flags/inline_test.cc b/third_party/python/gyp/test/win/linker-flags/inline_test.cc
new file mode 100644
index 0000000000..a9f177e476
--- /dev/null
+++ b/third_party/python/gyp/test/win/linker-flags/inline_test.cc
@@ -0,0 +1,12 @@
+// 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.
+
+#include "inline_test.h"
+
+#include <intrin.h>
+#pragma intrinsic(_ReturnAddress)
+
+bool IsFunctionInlined(void* caller_return_address) {
+ return _ReturnAddress() == caller_return_address;
+}
diff --git a/third_party/python/gyp/test/win/linker-flags/inline_test.h b/third_party/python/gyp/test/win/linker-flags/inline_test.h
new file mode 100644
index 0000000000..117913c4f5
--- /dev/null
+++ b/third_party/python/gyp/test/win/linker-flags/inline_test.h
@@ -0,0 +1,5 @@
+// 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.
+
+bool IsFunctionInlined(void* current_return_address);
diff --git a/third_party/python/gyp/test/win/linker-flags/inline_test_main.cc b/third_party/python/gyp/test/win/linker-flags/inline_test_main.cc
new file mode 100644
index 0000000000..23cafe8f94
--- /dev/null
+++ b/third_party/python/gyp/test/win/linker-flags/inline_test_main.cc
@@ -0,0 +1,15 @@
+// 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.
+
+#include "inline_test.h"
+
+#include <intrin.h>
+#include <stdio.h>
+
+#pragma intrinsic(_ReturnAddress)
+
+int main() {
+ if (IsFunctionInlined(_ReturnAddress()))
+ puts("==== inlined ====\n");
+}
diff --git a/third_party/python/gyp/test/win/linker-flags/large-address-aware.gyp b/third_party/python/gyp/test/win/linker-flags/large-address-aware.gyp
new file mode 100644
index 0000000000..fa56d3789c
--- /dev/null
+++ b/third_party/python/gyp/test/win/linker-flags/large-address-aware.gyp
@@ -0,0 +1,28 @@
+# 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.
+
+{
+ 'targets': [
+ {
+ 'target_name': 'test_large_address_aware_no',
+ 'type': 'executable',
+ 'msvs_settings': {
+ 'VCLinkerTool': {
+ 'LargeAddressAware': '1',
+ }
+ },
+ 'sources': ['hello.cc'],
+ },
+ {
+ 'target_name': 'test_large_address_aware_yes',
+ 'type': 'executable',
+ 'msvs_settings': {
+ 'VCLinkerTool': {
+ 'LargeAddressAware': '2',
+ },
+ },
+ 'sources': ['hello.cc'],
+ },
+ ]
+}
diff --git a/third_party/python/gyp/test/win/linker-flags/library-adjust.cc b/third_party/python/gyp/test/win/linker-flags/library-adjust.cc
new file mode 100644
index 0000000000..7dfb589d26
--- /dev/null
+++ b/third_party/python/gyp/test/win/linker-flags/library-adjust.cc
@@ -0,0 +1,10 @@
+// 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.
+
+#include <winsock2.h>
+
+int main() {
+ WSAStartup(0, 0);
+ return 0;
+}
diff --git a/third_party/python/gyp/test/win/linker-flags/library-adjust.gyp b/third_party/python/gyp/test/win/linker-flags/library-adjust.gyp
new file mode 100644
index 0000000000..10e9996f5c
--- /dev/null
+++ b/third_party/python/gyp/test/win/linker-flags/library-adjust.gyp
@@ -0,0 +1,16 @@
+# 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.
+
+{
+ 'targets': [
+ {
+ 'target_name': 'test_adjust',
+ 'type': 'executable',
+ 'libraries': [
+ '-lws2_32.lib'
+ ],
+ 'sources': ['library-adjust.cc'],
+ },
+ ]
+}
diff --git a/third_party/python/gyp/test/win/linker-flags/library-directories-define.cc b/third_party/python/gyp/test/win/linker-flags/library-directories-define.cc
new file mode 100644
index 0000000000..211ef062c1
--- /dev/null
+++ b/third_party/python/gyp/test/win/linker-flags/library-directories-define.cc
@@ -0,0 +1,7 @@
+// 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.
+
+int library_function() {
+ return 0;
+}
diff --git a/third_party/python/gyp/test/win/linker-flags/library-directories-reference.cc b/third_party/python/gyp/test/win/linker-flags/library-directories-reference.cc
new file mode 100644
index 0000000000..335097839a
--- /dev/null
+++ b/third_party/python/gyp/test/win/linker-flags/library-directories-reference.cc
@@ -0,0 +1,10 @@
+// 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.
+
+extern int library_function();
+
+int main() {
+ library_function();
+ return 0;
+}
diff --git a/third_party/python/gyp/test/win/linker-flags/library-directories.gyp b/third_party/python/gyp/test/win/linker-flags/library-directories.gyp
new file mode 100644
index 0000000000..25395d6c87
--- /dev/null
+++ b/third_party/python/gyp/test/win/linker-flags/library-directories.gyp
@@ -0,0 +1,42 @@
+# 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.
+
+{
+ 'targets': [
+ {
+ 'target_name': 'test_libdirs_none',
+ 'type': 'executable',
+ 'msvs_settings': {
+ 'VCLinkerTool': {
+ 'AdditionalDependencies': [
+ 'test_lib.lib',
+ ],
+ },
+ },
+ 'sources': ['library-directories-reference.cc'],
+ },
+ {
+ 'target_name': 'test_libdirs_with',
+ 'type': 'executable',
+ 'msvs_settings': {
+ 'VCLinkerTool': {
+ # NOTE: Don't use this for general dependencies between gyp
+ # libraries (use 'dependencies' instead). This is done here only for
+ # testing.
+ #
+ # This setting should only be used to depend on third party prebuilt
+ # libraries that are stored as binaries at a known location.
+ 'AdditionalLibraryDirectories': [
+ '<(DEPTH)/out/Default/obj/subdir', # ninja style
+ '<(DEPTH)/subdir/Default/lib', # msvs style
+ ],
+ 'AdditionalDependencies': [
+ 'test_lib.lib',
+ ],
+ },
+ },
+ 'sources': ['library-directories-reference.cc'],
+ },
+ ]
+}
diff --git a/third_party/python/gyp/test/win/linker-flags/link-ordering.gyp b/third_party/python/gyp/test/win/linker-flags/link-ordering.gyp
new file mode 100644
index 0000000000..66f44309d1
--- /dev/null
+++ b/third_party/python/gyp/test/win/linker-flags/link-ordering.gyp
@@ -0,0 +1,95 @@
+# 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.
+
+{
+ 'targets': [
+ {
+ 'target_name': 'test_ordering_exe',
+ 'type': 'executable',
+ # These are so the names of the functions appear in the disassembly.
+ 'msvs_settings': {
+ 'VCCLCompilerTool': {
+ 'DebugInformationFormat': '3',
+ 'Optimization': '2',
+ },
+ 'VCLinkerTool': {
+ 'GenerateDebugInformation': 'true',
+ 'LinkIncremental': '1',
+ 'GenerateManifest': 'false',
+ # Minimize the disassembly to just our code.
+ 'AdditionalOptions': [
+ '/NODEFAULTLIB',
+ ],
+ },
+ },
+ 'sources': [
+ # Explicitly sorted the same way as the disassembly in the test .py.
+ 'main-crt.c',
+ 'z.cc',
+ 'x.cc',
+ 'y.cc',
+ 'hello.cc',
+ ],
+ },
+
+ {
+ 'target_name': 'test_ordering_subdirs',
+ 'type': 'executable',
+ # These are so the names of the functions appear in the disassembly.
+ 'msvs_settings': {
+ 'VCCLCompilerTool': {
+ 'DebugInformationFormat': '3',
+ 'Optimization': '2',
+ },
+ 'VCLinkerTool': {
+ 'GenerateDebugInformation': 'true',
+ 'LinkIncremental': '1',
+ 'GenerateManifest': 'false',
+ # Minimize the disassembly to just our code.
+ 'AdditionalOptions': [
+ '/NODEFAULTLIB',
+ ],
+ },
+ },
+ 'sources': [
+ # Explicitly sorted the same way as the disassembly in the test .py.
+ 'main-crt.c',
+ 'hello.cc',
+ 'b/y.cc',
+ 'a/z.cc',
+ ],
+ },
+
+
+ {
+ 'target_name': 'test_ordering_subdirs_mixed',
+ 'type': 'executable',
+ # These are so the names of the functions appear in the disassembly.
+ 'msvs_settings': {
+ 'VCCLCompilerTool': {
+ 'DebugInformationFormat': '3',
+ 'Optimization': '2',
+ },
+ 'VCLinkerTool': {
+ 'GenerateDebugInformation': 'true',
+ 'LinkIncremental': '1',
+ 'GenerateManifest': 'false',
+ # Minimize the disassembly to just our code.
+ 'AdditionalOptions': [
+ '/NODEFAULTLIB',
+ ],
+ },
+ },
+ 'sources': [
+ # Explicitly sorted the same way as the disassembly in the test .py.
+ 'main-crt.c',
+ 'a/x.cc',
+ 'hello.cc',
+ 'a/z.cc',
+ 'y.cc',
+ ],
+ },
+
+ ]
+}
diff --git a/third_party/python/gyp/test/win/linker-flags/link-warning.cc b/third_party/python/gyp/test/win/linker-flags/link-warning.cc
new file mode 100644
index 0000000000..4b34277ba3
--- /dev/null
+++ b/third_party/python/gyp/test/win/linker-flags/link-warning.cc
@@ -0,0 +1,10 @@
+// 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.
+
+// This will cause LNK4254.
+#pragma comment(linker, "/merge:.data=.text")
+
+int main() {
+ return 0;
+}
diff --git a/third_party/python/gyp/test/win/linker-flags/ltcg.gyp b/third_party/python/gyp/test/win/linker-flags/ltcg.gyp
new file mode 100644
index 0000000000..ddb0d9b4e2
--- /dev/null
+++ b/third_party/python/gyp/test/win/linker-flags/ltcg.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.
+
+{
+ 'targets': [
+ {
+ 'target_name': 'test_ltcg_off',
+ 'type': 'executable',
+ 'msvs_settings': {
+ 'VCCLCompilerTool': {
+ 'WholeProgramOptimization': 'false',
+ },
+ 'VCLinkerTool': {
+ 'LinkTimeCodeGeneration': '0',
+ },
+ },
+ 'sources': [
+ 'inline_test.h',
+ 'inline_test.cc',
+ 'inline_test_main.cc',
+ ],
+ },
+ {
+ 'target_name': 'test_ltcg_on',
+ 'type': 'executable',
+ 'msvs_settings': {
+ 'VCCLCompilerTool': {
+ 'WholeProgramOptimization': 'true', # /GL
+ },
+ 'VCLinkerTool': {
+ 'LinkTimeCodeGeneration': '1', # /LTCG
+ },
+ },
+ 'sources': [
+ 'inline_test.h',
+ 'inline_test.cc',
+ 'inline_test_main.cc',
+ ],
+ },
+ ]
+}
diff --git a/third_party/python/gyp/test/win/linker-flags/main-crt.c b/third_party/python/gyp/test/win/linker-flags/main-crt.c
new file mode 100644
index 0000000000..bdc80c54fd
--- /dev/null
+++ b/third_party/python/gyp/test/win/linker-flags/main-crt.c
@@ -0,0 +1,8 @@
+// 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.
+
+// Stub so we can link with /NODEFAULTLIB when checking disasm.
+int mainCRTStartup() {
+ return 5;
+}
diff --git a/third_party/python/gyp/test/win/linker-flags/manifest-in-comment.cc b/third_party/python/gyp/test/win/linker-flags/manifest-in-comment.cc
new file mode 100644
index 0000000000..ae54ae5462
--- /dev/null
+++ b/third_party/python/gyp/test/win/linker-flags/manifest-in-comment.cc
@@ -0,0 +1,13 @@
+// Copyright 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.
+
+#pragma comment(linker, \
+ "\"/manifestdependency:type='Win32' " \
+ "name='Test.Research.SampleAssembly' version='6.0.0.0' " \
+ "processorArchitecture='X86' " \
+ "publicKeyToken='0000000000000000' language='*'\"")
+
+int main() {
+ return 0;
+}
diff --git a/third_party/python/gyp/test/win/linker-flags/mapfile.cc b/third_party/python/gyp/test/win/linker-flags/mapfile.cc
new file mode 100644
index 0000000000..cebccb264a
--- /dev/null
+++ b/third_party/python/gyp/test/win/linker-flags/mapfile.cc
@@ -0,0 +1,12 @@
+// 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.
+
+__declspec(dllexport)
+void AnExportedFunction() {
+ // We need an exported function to verify that /MAPINFO:EXPORTS works.
+}
+
+int main() {
+ return 0;
+}
diff --git a/third_party/python/gyp/test/win/linker-flags/mapfile.gyp b/third_party/python/gyp/test/win/linker-flags/mapfile.gyp
new file mode 100644
index 0000000000..14206fe28d
--- /dev/null
+++ b/third_party/python/gyp/test/win/linker-flags/mapfile.gyp
@@ -0,0 +1,45 @@
+# 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.
+
+{
+ 'targets': [
+ {
+ 'target_name': 'test_mapfile_unset',
+ 'type': 'executable',
+ 'sources': ['mapfile.cc'],
+ },
+ {
+ 'target_name': 'test_mapfile_generate',
+ 'type': 'executable',
+ 'msvs_settings': {
+ 'VCLinkerTool': {
+ 'GenerateMapFile': 'true',
+ },
+ },
+ 'sources': ['mapfile.cc'],
+ },
+ {
+ 'target_name': 'test_mapfile_generate_exports',
+ 'type': 'executable',
+ 'msvs_settings': {
+ 'VCLinkerTool': {
+ 'GenerateMapFile': 'true',
+ 'MapExports': 'true',
+ },
+ },
+ 'sources': ['mapfile.cc'],
+ },
+ {
+ 'target_name': 'test_mapfile_generate_filename',
+ 'type': 'executable',
+ 'msvs_settings': {
+ 'VCLinkerTool': {
+ 'GenerateMapFile': 'true',
+ 'MapFileName': '<(PRODUCT_DIR)/custom_file_name.map',
+ },
+ },
+ 'sources': ['mapfile.cc'],
+ },
+ ]
+}
diff --git a/third_party/python/gyp/test/win/linker-flags/no-default-libs.cc b/third_party/python/gyp/test/win/linker-flags/no-default-libs.cc
new file mode 100644
index 0000000000..e306846987
--- /dev/null
+++ b/third_party/python/gyp/test/win/linker-flags/no-default-libs.cc
@@ -0,0 +1,18 @@
+// 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.
+
+// Reference something in kernel32.dll. This will fail to link, verifying that
+// GYP provides no default import library configuration.
+// Note that we don't include Windows.h, as that will result in generating
+// linker directives in the object file through #pragma comment(lib, ...).
+typedef short BOOL;
+
+extern "C" __declspec(dllimport)
+BOOL CopyFileW(const wchar_t*, const wchar_t*, BOOL);
+
+
+int main() {
+ CopyFileW(0, 0, 0); // kernel32
+ return 0;
+}
diff --git a/third_party/python/gyp/test/win/linker-flags/no-default-libs.gyp b/third_party/python/gyp/test/win/linker-flags/no-default-libs.gyp
new file mode 100644
index 0000000000..77838ce8c4
--- /dev/null
+++ b/third_party/python/gyp/test/win/linker-flags/no-default-libs.gyp
@@ -0,0 +1,13 @@
+# 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.
+
+{
+ 'targets': [
+ {
+ 'target_name': 'test_default',
+ 'type': 'executable',
+ 'sources': ['no-default-libs.cc'],
+ },
+ ]
+}
diff --git a/third_party/python/gyp/test/win/linker-flags/nodefaultlib.cc b/third_party/python/gyp/test/win/linker-flags/nodefaultlib.cc
new file mode 100644
index 0000000000..24b6eca438
--- /dev/null
+++ b/third_party/python/gyp/test/win/linker-flags/nodefaultlib.cc
@@ -0,0 +1,13 @@
+// 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.
+
+// Include entry point function that's excluded by removing C runtime libraries.
+extern "C" void mainCRTStartup() {
+}
+
+// Still needed because the linker checks for existence of one of main, wmain,
+// WinMain, or wMain to offer informative diagnositics.
+int main() {
+ return 0;
+}
diff --git a/third_party/python/gyp/test/win/linker-flags/nodefaultlib.gyp b/third_party/python/gyp/test/win/linker-flags/nodefaultlib.gyp
new file mode 100644
index 0000000000..4fb452a18b
--- /dev/null
+++ b/third_party/python/gyp/test/win/linker-flags/nodefaultlib.gyp
@@ -0,0 +1,30 @@
+# 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.
+
+{
+ 'targets': [
+ {
+ 'target_name': 'test_ok',
+ 'type': 'executable',
+ 'msvs_settings': {
+ 'VCLinkerTool': {
+ 'IgnoreDefaultLibraryNames':
+ ['libcmtd.lib', 'libcmt.lib', 'msvcrt.lib', 'msvcrtd.lib'],
+ }
+ },
+ 'sources': ['nodefaultlib.cc'],
+ },
+ {
+ 'target_name': 'test_fail',
+ 'type': 'executable',
+ 'msvs_settings': {
+ 'VCLinkerTool': {
+ 'IgnoreDefaultLibraryNames':
+ ['libcmtd.lib', 'libcmt.lib', 'msvcrt.lib', 'msvcrtd.lib'],
+ }
+ },
+ 'sources': ['hello.cc'],
+ },
+ ]
+}
diff --git a/third_party/python/gyp/test/win/linker-flags/nxcompat.gyp b/third_party/python/gyp/test/win/linker-flags/nxcompat.gyp
new file mode 100644
index 0000000000..fa4118cbd7
--- /dev/null
+++ b/third_party/python/gyp/test/win/linker-flags/nxcompat.gyp
@@ -0,0 +1,35 @@
+# 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.
+
+{
+ 'targets': [
+ {
+ 'target_name': 'test_nxcompat_default',
+ 'type': 'executable',
+ 'msvs_settings': {
+ },
+ 'sources': ['hello.cc'],
+ },
+ {
+ 'target_name': 'test_nxcompat_no',
+ 'type': 'executable',
+ 'msvs_settings': {
+ 'VCLinkerTool': {
+ 'DataExecutionPrevention': '1',
+ }
+ },
+ 'sources': ['hello.cc'],
+ },
+ {
+ 'target_name': 'test_nxcompat_yes',
+ 'type': 'executable',
+ 'msvs_settings': {
+ 'VCLinkerTool': {
+ 'DataExecutionPrevention': '2',
+ },
+ },
+ 'sources': ['hello.cc'],
+ },
+ ]
+}
diff --git a/third_party/python/gyp/test/win/linker-flags/opt-icf.cc b/third_party/python/gyp/test/win/linker-flags/opt-icf.cc
new file mode 100644
index 0000000000..1f12156b7f
--- /dev/null
+++ b/third_party/python/gyp/test/win/linker-flags/opt-icf.cc
@@ -0,0 +1,29 @@
+// 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.
+
+void similar_function0(char* x) {
+ while (*x) {
+ ++x;
+ }
+}
+
+void similar_function1(char* p) {
+ while (*p) {
+ ++p;
+ }
+}
+
+void similar_function2(char* q) {
+ while (*q) {
+ ++q;
+ }
+}
+
+int main() {
+ char* x = "hello";
+ similar_function0(x);
+ similar_function1(x);
+ similar_function2(x);
+ return 0;
+}
diff --git a/third_party/python/gyp/test/win/linker-flags/opt-icf.gyp b/third_party/python/gyp/test/win/linker-flags/opt-icf.gyp
new file mode 100644
index 0000000000..effe8021c3
--- /dev/null
+++ b/third_party/python/gyp/test/win/linker-flags/opt-icf.gyp
@@ -0,0 +1,63 @@
+# 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.
+
+{
+ 'targets': [
+ # Have to turn on function level linking here to get the function packaged
+ # as a COMDAT so that it's eligible for merging. Also turn on debug
+ # information so that the symbol names for the code appear in the dump.
+ # Finally, specify non-incremental linking so that there's not a bunch of
+ # extra "similar_function"s in the output (the ILT jump table).
+ {
+ 'target_name': 'test_opticf_default',
+ 'type': 'executable',
+ 'msvs_settings': {
+ 'VCCLCompilerTool': {
+ 'EnableFunctionLevelLinking': 'true',
+ 'DebugInformationFormat': '3',
+ 'Optimization': '0',
+ },
+ 'VCLinkerTool': {
+ 'GenerateDebugInformation': 'true',
+ 'LinkIncremental': '1',
+ },
+ },
+ 'sources': ['opt-icf.cc'],
+ },
+ {
+ 'target_name': 'test_opticf_no',
+ 'type': 'executable',
+ 'msvs_settings': {
+ 'VCCLCompilerTool': {
+ 'EnableFunctionLevelLinking': 'true',
+ 'DebugInformationFormat': '3',
+ 'Optimization': '0',
+ },
+ 'VCLinkerTool': {
+ 'GenerateDebugInformation': 'true',
+ 'EnableCOMDATFolding': '1',
+ 'LinkIncremental': '1',
+ },
+ },
+ 'sources': ['opt-icf.cc'],
+ },
+ {
+ 'target_name': 'test_opticf_yes',
+ 'type': 'executable',
+ 'msvs_settings': {
+ 'VCCLCompilerTool': {
+ 'EnableFunctionLevelLinking': 'true',
+ 'DebugInformationFormat': '3',
+ 'Optimization': '0',
+ },
+ 'VCLinkerTool': {
+ 'GenerateDebugInformation': 'true',
+ 'EnableCOMDATFolding': '2',
+ 'LinkIncremental': '1',
+ },
+ },
+ 'sources': ['opt-icf.cc'],
+ },
+ ]
+}
diff --git a/third_party/python/gyp/test/win/linker-flags/opt-ref.cc b/third_party/python/gyp/test/win/linker-flags/opt-ref.cc
new file mode 100644
index 0000000000..afaa328a5d
--- /dev/null
+++ b/third_party/python/gyp/test/win/linker-flags/opt-ref.cc
@@ -0,0 +1,11 @@
+// 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.
+
+int unused_function() {
+ return 0;
+}
+
+int main() {
+ return 0;
+}
diff --git a/third_party/python/gyp/test/win/linker-flags/opt-ref.gyp b/third_party/python/gyp/test/win/linker-flags/opt-ref.gyp
new file mode 100644
index 0000000000..69d0281a08
--- /dev/null
+++ b/third_party/python/gyp/test/win/linker-flags/opt-ref.gyp
@@ -0,0 +1,56 @@
+# 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.
+
+{
+ 'targets': [
+ # Have to turn on function level linking here to get the function packaged
+ # as a COMDAT so that it's eligible for optimizing away. Also turn on
+ # debug information so that the symbol names for the code appear in the
+ # dump (so we can verify if they are included in the final exe).
+ {
+ 'target_name': 'test_optref_default',
+ 'type': 'executable',
+ 'msvs_settings': {
+ 'VCCLCompilerTool': {
+ 'EnableFunctionLevelLinking': 'true',
+ 'DebugInformationFormat': '3',
+ },
+ 'VCLinkerTool': {
+ 'GenerateDebugInformation': 'true',
+ },
+ },
+ 'sources': ['opt-ref.cc'],
+ },
+ {
+ 'target_name': 'test_optref_no',
+ 'type': 'executable',
+ 'msvs_settings': {
+ 'VCCLCompilerTool': {
+ 'EnableFunctionLevelLinking': 'true',
+ 'DebugInformationFormat': '3',
+ },
+ 'VCLinkerTool': {
+ 'GenerateDebugInformation': 'true',
+ 'OptimizeReferences': '1',
+ },
+ },
+ 'sources': ['opt-ref.cc'],
+ },
+ {
+ 'target_name': 'test_optref_yes',
+ 'type': 'executable',
+ 'msvs_settings': {
+ 'VCCLCompilerTool': {
+ 'EnableFunctionLevelLinking': 'true',
+ 'DebugInformationFormat': '3',
+ },
+ 'VCLinkerTool': {
+ 'GenerateDebugInformation': 'true',
+ 'OptimizeReferences': '2',
+ },
+ },
+ 'sources': ['opt-ref.cc'],
+ },
+ ]
+}
diff --git a/third_party/python/gyp/test/win/linker-flags/outputfile.gyp b/third_party/python/gyp/test/win/linker-flags/outputfile.gyp
new file mode 100644
index 0000000000..1022ec2e20
--- /dev/null
+++ b/third_party/python/gyp/test/win/linker-flags/outputfile.gyp
@@ -0,0 +1,58 @@
+# 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.
+
+{
+ 'targets': [
+ {
+ 'target_name': 'test_output_exe',
+ 'type': 'executable',
+ 'msvs_settings': {
+ 'VCLinkerTool': {
+ 'OutputFile': '$(OutDir)\\blorp.exe'
+ },
+ },
+ 'sources': ['hello.cc'],
+ },
+ {
+ 'target_name': 'test_output_exe2',
+ 'type': 'executable',
+ 'msvs_settings': {
+ 'VCLinkerTool': {
+ 'OutputFile': '$(OutDir)\\subdir\\blorp.exe'
+ },
+ },
+ 'sources': ['hello.cc'],
+ },
+ {
+ 'target_name': 'test_output_dll',
+ 'type': 'shared_library',
+ 'msvs_settings': {
+ 'VCLinkerTool': {
+ 'OutputFile': '$(OutDir)\\blorp.dll'
+ },
+ },
+ 'sources': ['hello.cc'],
+ },
+ {
+ 'target_name': 'test_output_lib',
+ 'type': 'static_library',
+ 'msvs_settings': {
+ 'VCLibrarianTool': {
+ 'OutputFile': '$(OutDir)\\blorp.lib'
+ },
+ },
+ 'sources': ['hello.cc'],
+ },
+ {
+ 'target_name': 'test_output_lib2',
+ 'type': 'static_library',
+ 'msvs_settings': {
+ 'VCLibrarianTool': {
+ 'OutputFile': '$(OutDir)\\subdir\\blorp.lib'
+ },
+ },
+ 'sources': ['hello.cc'],
+ },
+ ]
+}
diff --git a/third_party/python/gyp/test/win/linker-flags/pdb-output.gyp b/third_party/python/gyp/test/win/linker-flags/pdb-output.gyp
new file mode 100644
index 0000000000..1a03c67cc0
--- /dev/null
+++ b/third_party/python/gyp/test/win/linker-flags/pdb-output.gyp
@@ -0,0 +1,49 @@
+# Copyright (c) 2014 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.
+
+{
+ 'targets': [
+ {
+ 'target_name': 'test_pdb_output_exe',
+ 'type': 'executable',
+ 'sources': ['hello.cc'],
+ 'msvs_settings': {
+ 'VCCLCompilerTool': {
+ 'DebugInformationFormat': '3'
+ },
+ 'VCLinkerTool': {
+ 'GenerateDebugInformation': 'true',
+ 'ProgramDatabaseFile': 'output_exe.pdb',
+ },
+ },
+ },
+ {
+ 'target_name': 'test_pdb_output_dll',
+ 'type': 'shared_library',
+ 'sources': ['hello.cc'],
+ 'msvs_settings': {
+ 'VCCLCompilerTool': {
+ 'DebugInformationFormat': '3'
+ },
+ 'VCLinkerTool': {
+ 'GenerateDebugInformation': 'true',
+ 'ProgramDatabaseFile': 'output_dll.pdb',
+ },
+ },
+ },
+ {
+ 'target_name': 'test_pdb_output_disabled',
+ 'type': 'executable',
+ 'sources': ['hello.cc'],
+ 'msvs_settings': {
+ 'VCCLCompilerTool': {
+ 'DebugInformationFormat': '0'
+ },
+ 'VCLinkerTool': {
+ 'GenerateDebugInformation': 'false',
+ },
+ },
+ },
+ ]
+}
diff --git a/third_party/python/gyp/test/win/linker-flags/pgo.gyp b/third_party/python/gyp/test/win/linker-flags/pgo.gyp
new file mode 100644
index 0000000000..da32639973
--- /dev/null
+++ b/third_party/python/gyp/test/win/linker-flags/pgo.gyp
@@ -0,0 +1,143 @@
+# 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.
+
+{
+ 'variables': {
+ 'pgd_basename': 'test_pgo',
+ },
+ 'targets': [
+ # In the PGO (Profile-Guided Optimization) build flow, we need to build the
+ # target binary multiple times. To implement this flow with gyp, here we
+ # define multiple 'executable' targets, each of which represents one build
+ # particular build/profile stage. On tricky part to do this is that these
+ # 'executable' targets should share the code itself so that profile data
+ # can be reused among these 'executable' files. In other words, the only
+ # differences among below 'executable' targets are:
+ # 1) PGO (Profile-Guided Optimization) database, and
+ # 2) linker options.
+ # The following static library contains all the logic including entry point.
+ # Basically we don't need to rebuild this target once we enter profiling
+ # phase of PGO.
+ {
+ 'target_name': 'test_pgo_main',
+ 'type': 'static_library',
+ 'msvs_settings': {
+ 'VCCLCompilerTool': {
+ 'WholeProgramOptimization': 'true', # /GL
+ },
+ 'VCLibrarianTool': {
+ 'LinkTimeCodeGeneration': 'true',
+ },
+ },
+ 'link_settings': {
+ 'msvs_settings': {
+ 'VCLinkerTool': {
+ 'ProfileGuidedDatabase': '$(OutDir)\\<(pgd_basename).pgd',
+ 'TargetMachine': '1', # x86 - 32
+ 'SubSystem': '1', # /SUBSYSTEM:CONSOLE
+ # Tell ninja generator not to pass /ManifestFile:<filename> option
+ # to the linker, because it causes LNK1268 error in PGO biuld.
+ 'GenerateManifest': 'false',
+ # We need to specify 'libcmt.lib' here so that the linker can pick
+ # up a valid entry point.
+ 'AdditionalDependencies': [
+ 'libcmt.lib',
+ ],
+ },
+ },
+ },
+ 'sources': [
+ 'inline_test.h',
+ 'inline_test.cc',
+ 'inline_test_main.cc',
+ ],
+ },
+ {
+ 'target_name': 'test_pgo_instrument',
+ 'type': 'executable',
+ 'msvs_settings': {
+ 'VCLinkerTool': {
+ 'LinkTimeCodeGeneration': '2',
+ },
+ },
+ 'dependencies': [
+ 'test_pgo_main',
+ ],
+ },
+ {
+ 'target_name': 'gen_profile_guided_database',
+ 'type': 'none',
+ 'msvs_cygwin_shell': 0,
+ 'actions': [
+ {
+ 'action_name': 'action_main',
+ 'inputs': [],
+ 'outputs': [
+ '$(OutDir)\\<(pgd_basename).pgd',
+ ],
+ 'action': [
+ 'python', 'update_pgd.py',
+ '--vcbindir', '$(VCInstallDir)bin',
+ '--exe', '$(OutDir)\\test_pgo_instrument.exe',
+ '--pgd', '$(OutDir)\\<(pgd_basename).pgd',
+ ],
+ },
+ ],
+ 'dependencies': [
+ 'test_pgo_instrument',
+ ],
+ },
+ {
+ 'target_name': 'test_pgo_optimize',
+ 'type': 'executable',
+ 'msvs_settings': {
+ 'VCLinkerTool': {
+ 'LinkTimeCodeGeneration': '3',
+ },
+ },
+ 'sources': [
+ '$(OutDir)\\<(pgd_basename).pgd',
+ ],
+ 'dependencies': [
+ 'test_pgo_main',
+ 'gen_profile_guided_database',
+ ],
+ },
+ {
+ 'target_name': 'test_pgo_update',
+ 'type': 'executable',
+ 'msvs_settings': {
+ 'VCLinkerTool': {
+ 'LinkTimeCodeGeneration': '4',
+ },
+ },
+ 'sources': [
+ '$(OutDir)\\<(pgd_basename).pgd',
+ ],
+ 'dependencies': [
+ 'test_pgo_main',
+ ],
+ },
+ # A helper target to dump link.exe's command line options. We can use the
+ # output to determine if PGO (Profile-Guided Optimization) is available on
+ # the test environment.
+ {
+ 'target_name': 'gen_linker_option',
+ 'type': 'none',
+ 'msvs_cygwin_shell': 0,
+ 'actions': [
+ {
+ 'action_name': 'action_main',
+ 'inputs': [],
+ 'outputs': [
+ '$(OutDir)\\linker_options.txt',
+ ],
+ 'action': [
+ 'cmd.exe', '/c link.exe > $(OutDir)\\linker_options.txt & exit 0',
+ ],
+ },
+ ],
+ },
+ ]
+}
diff --git a/third_party/python/gyp/test/win/linker-flags/profile.gyp b/third_party/python/gyp/test/win/linker-flags/profile.gyp
new file mode 100644
index 0000000000..d60a700fbb
--- /dev/null
+++ b/third_party/python/gyp/test/win/linker-flags/profile.gyp
@@ -0,0 +1,50 @@
+# 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.
+
+{
+ 'targets': [
+ # Verify that 'Profile' option correctly makes it to LINK steup in Ninja
+ {
+ 'target_name': 'test_profile_true',
+ 'type': 'executable',
+ 'sources': ['hello.cc'],
+ 'msvs_settings': {
+ 'VCCLCompilerTool': {
+ 'DebugInformationFormat': '3'
+ },
+ 'VCLinkerTool': {
+ 'Profile': 'true',
+ 'GenerateDebugInformation': 'true',
+ },
+ },
+ },
+ {
+ 'target_name': 'test_profile_false',
+ 'type': 'executable',
+ 'sources': ['hello.cc'],
+ 'msvs_settings': {
+ 'VCCLCompilerTool': {
+ 'DebugInformationFormat': '3'
+ },
+ 'VCLinkerTool': {
+ 'Profile': 'false',
+ 'GenerateDebugInformation': 'true',
+ },
+ },
+ },
+ {
+ 'target_name': 'test_profile_default',
+ 'type': 'executable',
+ 'sources': ['hello.cc'],
+ 'msvs_settings': {
+ 'VCCLCompilerTool': {
+ 'DebugInformationFormat': '3'
+ },
+ 'VCLinkerTool': {
+ 'GenerateDebugInformation': 'true',
+ },
+ },
+ },
+ ]
+}
diff --git a/third_party/python/gyp/test/win/linker-flags/program-database.gyp b/third_party/python/gyp/test/win/linker-flags/program-database.gyp
new file mode 100644
index 0000000000..6e60ac0dc9
--- /dev/null
+++ b/third_party/python/gyp/test/win/linker-flags/program-database.gyp
@@ -0,0 +1,40 @@
+# 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.
+
+{
+ 'targets': [
+ # Verify that 'ProgramDatabaseFile' option correctly makes it to LINK
+ # step in Ninja.
+ {
+ # Verify that VC macros and windows paths work correctly.
+ 'target_name': 'test_pdb_outdir',
+ 'type': 'executable',
+ 'sources': ['hello.cc'],
+ 'msvs_settings': {
+ 'VCCLCompilerTool': {
+ 'DebugInformationFormat': '3'
+ },
+ 'VCLinkerTool': {
+ 'GenerateDebugInformation': 'true',
+ 'ProgramDatabaseFile': '$(OutDir)\\name_outdir.pdb',
+ },
+ },
+ },
+ {
+ # Verify that GYP macros and POSIX paths work correctly.
+ 'target_name': 'test_pdb_proddir',
+ 'type': 'executable',
+ 'sources': ['hello.cc'],
+ 'msvs_settings': {
+ 'VCCLCompilerTool': {
+ 'DebugInformationFormat': '3'
+ },
+ 'VCLinkerTool': {
+ 'GenerateDebugInformation': 'true',
+ 'ProgramDatabaseFile': '<(PRODUCT_DIR)/name_proddir.pdb',
+ },
+ },
+ },
+ ]
+}
diff --git a/third_party/python/gyp/test/win/linker-flags/safeseh.gyp b/third_party/python/gyp/test/win/linker-flags/safeseh.gyp
new file mode 100644
index 0000000000..d4a62074b8
--- /dev/null
+++ b/third_party/python/gyp/test/win/linker-flags/safeseh.gyp
@@ -0,0 +1,79 @@
+# Copyright (c) 2014 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.
+
+{
+ 'target_defaults': {
+ 'configurations': {
+ 'Default': {
+ 'msvs_configuration_platform': 'Win32',
+ },
+ 'Default_x64': {
+ 'inherit_from': ['Default'],
+ 'msvs_configuration_platform': 'x64',
+ },
+ },
+ },
+ 'targets': [
+ {
+ 'target_name': 'test_safeseh_default',
+ 'type': 'executable',
+ 'msvs_settings': {
+ # By default, msvs passes /SAFESEH for Link, but not for MASM. In
+ # order for test_safeseh_default to link successfully, we need to
+ # explicitly specify /SAFESEH for MASM.
+ 'MASM': {
+ 'UseSafeExceptionHandlers': 'true',
+ },
+ },
+ 'sources': [
+ 'safeseh_hello.cc',
+ 'safeseh_zero.asm',
+ ],
+ },
+ {
+ 'target_name': 'test_safeseh_no',
+ 'type': 'executable',
+ 'msvs_settings': {
+ 'VCLinkerTool': {
+ 'ImageHasSafeExceptionHandlers': 'false',
+ },
+ },
+ 'sources': [
+ 'safeseh_hello.cc',
+ 'safeseh_zero.asm',
+ ],
+ },
+ {
+ 'target_name': 'test_safeseh_yes',
+ 'type': 'executable',
+ 'msvs_settings': {
+ 'VCLinkerTool': {
+ 'ImageHasSafeExceptionHandlers': 'true',
+ },
+ 'MASM': {
+ 'UseSafeExceptionHandlers': 'true',
+ },
+ },
+ 'sources': [
+ 'safeseh_hello.cc',
+ 'safeseh_zero.asm',
+ ],
+ },
+ {
+ # x64 targets cannot have ImageHasSafeExceptionHandlers or
+ # UseSafeExceptionHandlers set.
+ 'target_name': 'test_safeseh_x64',
+ 'type': 'executable',
+ 'configurations': {
+ 'Default': {
+ 'msvs_target_platform': 'x64',
+ },
+ },
+ 'sources': [
+ 'safeseh_hello.cc',
+ 'safeseh_zero64.asm',
+ ],
+ },
+ ]
+}
diff --git a/third_party/python/gyp/test/win/linker-flags/safeseh_hello.cc b/third_party/python/gyp/test/win/linker-flags/safeseh_hello.cc
new file mode 100644
index 0000000000..6141300d2c
--- /dev/null
+++ b/third_party/python/gyp/test/win/linker-flags/safeseh_hello.cc
@@ -0,0 +1,11 @@
+// Copyright (c) 2014 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.
+
+extern "C" {
+int zero(void);
+}
+
+int main() {
+ return zero();
+}
diff --git a/third_party/python/gyp/test/win/linker-flags/safeseh_zero.asm b/third_party/python/gyp/test/win/linker-flags/safeseh_zero.asm
new file mode 100644
index 0000000000..62da0df4f3
--- /dev/null
+++ b/third_party/python/gyp/test/win/linker-flags/safeseh_zero.asm
@@ -0,0 +1,10 @@
+.MODEL FLAT, C
+.CODE
+
+PUBLIC zero
+zero PROC
+ xor eax, eax
+ ret 0
+zero ENDP
+
+END
diff --git a/third_party/python/gyp/test/win/linker-flags/safeseh_zero64.asm b/third_party/python/gyp/test/win/linker-flags/safeseh_zero64.asm
new file mode 100644
index 0000000000..a4740c0dfb
--- /dev/null
+++ b/third_party/python/gyp/test/win/linker-flags/safeseh_zero64.asm
@@ -0,0 +1,9 @@
+.CODE
+
+PUBLIC zero
+zero PROC
+ xor eax, eax
+ ret 0
+zero ENDP
+
+END
diff --git a/third_party/python/gyp/test/win/linker-flags/stacksize.gyp b/third_party/python/gyp/test/win/linker-flags/stacksize.gyp
new file mode 100644
index 0000000000..bba44ca4a7
--- /dev/null
+++ b/third_party/python/gyp/test/win/linker-flags/stacksize.gyp
@@ -0,0 +1,44 @@
+# Copyright (c) 2015 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.
+
+{
+ 'targets': [
+ {
+ 'target_name': 'test_default',
+ 'type': 'executable',
+ 'sources': ['hello.cc'],
+ },
+ {
+ 'target_name': 'test_set_reserved_size',
+ 'type': 'executable',
+ 'sources': ['hello.cc'],
+ 'msvs_settings': {
+ 'VCLinkerTool': {
+ 'StackReserveSize': 2097152, # 2MB
+ }
+ },
+ },
+ {
+ 'target_name': 'test_set_commit_size',
+ 'type': 'executable',
+ 'sources': ['hello.cc'],
+ 'msvs_settings': {
+ 'VCLinkerTool': {
+ 'StackCommitSize': 8192, # 8KB
+ }
+ },
+ },
+ {
+ 'target_name': 'test_set_both',
+ 'type': 'executable',
+ 'sources': ['hello.cc'],
+ 'msvs_settings': {
+ 'VCLinkerTool': {
+ 'StackReserveSize': 2097152, # 2MB
+ 'StackCommitSize': 8192, # 8KB
+ }
+ },
+ },
+ ]
+}
diff --git a/third_party/python/gyp/test/win/linker-flags/subdir/library.gyp b/third_party/python/gyp/test/win/linker-flags/subdir/library.gyp
new file mode 100644
index 0000000000..519577f0d7
--- /dev/null
+++ b/third_party/python/gyp/test/win/linker-flags/subdir/library.gyp
@@ -0,0 +1,13 @@
+# 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.
+
+{
+ 'targets': [
+ {
+ 'target_name': 'test_lib',
+ 'type': 'static_library',
+ 'sources': ['../library-directories-define.cc'],
+ },
+ ]
+}
diff --git a/third_party/python/gyp/test/win/linker-flags/subsystem-windows.cc b/third_party/python/gyp/test/win/linker-flags/subsystem-windows.cc
new file mode 100644
index 0000000000..ac99da808e
--- /dev/null
+++ b/third_party/python/gyp/test/win/linker-flags/subsystem-windows.cc
@@ -0,0 +1,9 @@
+// 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.
+
+#include <windows.h>
+
+int CALLBACK WinMain(HINSTANCE, HINSTANCE, LPSTR, int) {
+ return 0;
+}
diff --git a/third_party/python/gyp/test/win/linker-flags/subsystem.gyp b/third_party/python/gyp/test/win/linker-flags/subsystem.gyp
new file mode 100644
index 0000000000..63f072a206
--- /dev/null
+++ b/third_party/python/gyp/test/win/linker-flags/subsystem.gyp
@@ -0,0 +1,70 @@
+# 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.
+
+{
+ 'targets': [
+ {
+ 'target_name': 'test_console_ok',
+ 'type': 'executable',
+ 'msvs_settings': {
+ 'VCLinkerTool': {
+ 'SubSystem': '1'
+ }
+ },
+ 'sources': ['hello.cc'],
+ },
+ {
+ 'target_name': 'test_console_fail',
+ 'type': 'executable',
+ 'msvs_settings': {
+ 'VCLinkerTool': {
+ 'SubSystem': '1'
+ }
+ },
+ 'sources': ['subsystem-windows.cc'],
+ },
+ {
+ 'target_name': 'test_windows_ok',
+ 'type': 'executable',
+ 'msvs_settings': {
+ 'VCLinkerTool': {
+ 'SubSystem': '2'
+ }
+ },
+ 'sources': ['subsystem-windows.cc'],
+ },
+ {
+ 'target_name': 'test_windows_fail',
+ 'type': 'executable',
+ 'msvs_settings': {
+ 'VCLinkerTool': {
+ 'SubSystem': '2'
+ }
+ },
+ 'sources': ['hello.cc'],
+ },
+ {
+ 'target_name': 'test_console_xp',
+ 'type': 'executable',
+ 'msvs_settings': {
+ 'VCLinkerTool': {
+ 'SubSystem': '1',
+ 'MinimumRequiredVersion': '5.01', # XP.
+ }
+ },
+ 'sources': ['hello.cc'],
+ },
+ {
+ 'target_name': 'test_windows_xp',
+ 'type': 'executable',
+ 'msvs_settings': {
+ 'VCLinkerTool': {
+ 'SubSystem': '2',
+ 'MinimumRequiredVersion': '5.01', # XP.
+ }
+ },
+ 'sources': ['subsystem-windows.cc'],
+ },
+ ]
+}
diff --git a/third_party/python/gyp/test/win/linker-flags/target-machine.gyp b/third_party/python/gyp/test/win/linker-flags/target-machine.gyp
new file mode 100644
index 0000000000..30271926c9
--- /dev/null
+++ b/third_party/python/gyp/test/win/linker-flags/target-machine.gyp
@@ -0,0 +1,48 @@
+# 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.
+
+{
+ 'targets': [
+ {
+ 'target_name': 'test_target_link_x86',
+ 'type': 'executable',
+ 'msvs_settings': {
+ 'VCLinkerTool': {
+ 'TargetMachine': '1',
+ }
+ },
+ 'sources': ['hello.cc'],
+ },
+ {
+ 'target_name': 'test_target_link_x64',
+ 'type': 'executable',
+ 'msvs_settings': {
+ 'VCLinkerTool': {
+ 'TargetMachine': '17',
+ },
+ },
+ 'sources': ['hello.cc'],
+ },
+ {
+ 'target_name': 'test_target_lib_x86',
+ 'type': 'static_library',
+ 'msvs_settings': {
+ 'VCLibrarianTool': {
+ 'TargetMachine': '1',
+ }
+ },
+ 'sources': ['hello.cc'],
+ },
+ {
+ 'target_name': 'test_target_lib_x64',
+ 'type': 'static_library',
+ 'msvs_settings': {
+ 'VCLibrarianTool': {
+ 'TargetMachine': '17',
+ },
+ },
+ 'sources': ['hello.cc'],
+ },
+ ]
+}
diff --git a/third_party/python/gyp/test/win/linker-flags/tsaware.gyp b/third_party/python/gyp/test/win/linker-flags/tsaware.gyp
new file mode 100644
index 0000000000..7ffc7426bb
--- /dev/null
+++ b/third_party/python/gyp/test/win/linker-flags/tsaware.gyp
@@ -0,0 +1,28 @@
+# 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.
+
+{
+ 'targets': [
+ {
+ 'target_name': 'test_tsaware_no',
+ 'type': 'executable',
+ 'msvs_settings': {
+ 'VCLinkerTool': {
+ 'TerminalServerAware': '1',
+ }
+ },
+ 'sources': ['hello.cc'],
+ },
+ {
+ 'target_name': 'test_tsaware_yes',
+ 'type': 'executable',
+ 'msvs_settings': {
+ 'VCLinkerTool': {
+ 'TerminalServerAware': '2',
+ },
+ },
+ 'sources': ['hello.cc'],
+ },
+ ]
+}
diff --git a/third_party/python/gyp/test/win/linker-flags/unsupported-manifest.gyp b/third_party/python/gyp/test/win/linker-flags/unsupported-manifest.gyp
new file mode 100644
index 0000000000..5549e7cb9b
--- /dev/null
+++ b/third_party/python/gyp/test/win/linker-flags/unsupported-manifest.gyp
@@ -0,0 +1,13 @@
+# 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.
+
+{
+ 'targets': [
+ {
+ 'target_name': 'test_unsupported',
+ 'type': 'executable',
+ 'sources': ['manifest-in-comment.cc'],
+ },
+ ],
+}
diff --git a/third_party/python/gyp/test/win/linker-flags/update_pgd.py b/third_party/python/gyp/test/win/linker-flags/update_pgd.py
new file mode 100644
index 0000000000..176e9e5472
--- /dev/null
+++ b/third_party/python/gyp/test/win/linker-flags/update_pgd.py
@@ -0,0 +1,35 @@
+#!/usr/bin/env python
+
+# 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.
+
+from optparse import OptionParser
+import glob
+import os
+import subprocess
+
+parser = OptionParser()
+parser.add_option('--exe', dest='exe')
+parser.add_option('--vcbindir', dest='vcbindir')
+parser.add_option('--pgd', dest='pgd')
+(options, args) = parser.parse_args()
+
+# Instrumented binaries fail to run unless the Visual C++'s bin dir is included
+# in the PATH environment variable.
+os.environ['PATH'] = os.environ['PATH'] + os.pathsep + options.vcbindir
+
+# Run Instrumented binary. The profile will be recorded into *.pgc file.
+subprocess.call([options.exe])
+
+# Merge *.pgc files into a *.pgd (Profile-Guided Database) file.
+subprocess.call(['pgomgr', '/merge', options.pgd])
+
+# *.pgc files are no longer necessary. Clear all of them.
+pgd_file = os.path.abspath(options.pgd)
+pgd_dir = os.path.dirname(pgd_file)
+(pgd_basename, _) = os.path.splitext(os.path.basename(pgd_file))
+pgc_filepattern = os.path.join(pgd_dir, '%s!*.pgc' % pgd_basename)
+pgc_files= glob.glob(pgc_filepattern)
+for pgc_file in pgc_files:
+ os.unlink(pgc_file)
diff --git a/third_party/python/gyp/test/win/linker-flags/warn-as-error.gyp b/third_party/python/gyp/test/win/linker-flags/warn-as-error.gyp
new file mode 100644
index 0000000000..83c67e9df1
--- /dev/null
+++ b/third_party/python/gyp/test/win/linker-flags/warn-as-error.gyp
@@ -0,0 +1,33 @@
+# 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.
+
+{
+ 'targets': [
+ {
+ 'target_name': 'test_on',
+ 'type': 'executable',
+ 'msvs_settings': {
+ 'VCLinkerTool': {
+ 'TreatLinkerWarningAsErrors': 'true',
+ }
+ },
+ 'sources': ['link-warning.cc'],
+ },
+ {
+ 'target_name': 'test_off',
+ 'type': 'executable',
+ 'msvs_settings': {
+ 'VCLinkerTool': {
+ 'TreatLinkerWarningAsErrors': 'false',
+ }
+ },
+ 'sources': ['link-warning.cc'],
+ },
+ {
+ 'target_name': 'test_default',
+ 'type': 'executable',
+ 'sources': ['link-warning.cc'],
+ },
+ ]
+}
diff --git a/third_party/python/gyp/test/win/linker-flags/x.cc b/third_party/python/gyp/test/win/linker-flags/x.cc
new file mode 100644
index 0000000000..f5f763b095
--- /dev/null
+++ b/third_party/python/gyp/test/win/linker-flags/x.cc
@@ -0,0 +1,7 @@
+// 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.
+
+int x() {
+ return 1;
+}
diff --git a/third_party/python/gyp/test/win/linker-flags/y.cc b/third_party/python/gyp/test/win/linker-flags/y.cc
new file mode 100644
index 0000000000..bd884119fc
--- /dev/null
+++ b/third_party/python/gyp/test/win/linker-flags/y.cc
@@ -0,0 +1,7 @@
+// 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.
+
+int y() {
+ return 2;
+}
diff --git a/third_party/python/gyp/test/win/linker-flags/z.cc b/third_party/python/gyp/test/win/linker-flags/z.cc
new file mode 100644
index 0000000000..8a43501270
--- /dev/null
+++ b/third_party/python/gyp/test/win/linker-flags/z.cc
@@ -0,0 +1,7 @@
+// 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.
+
+int z() {
+ return 3;
+}