summaryrefslogtreecommitdiffstats
path: root/third_party/python/gyp/test/win/vs-macros
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 00:47:55 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 00:47:55 +0000
commit26a029d407be480d791972afb5975cf62c9360a6 (patch)
treef435a8308119effd964b339f76abb83a57c29483 /third_party/python/gyp/test/win/vs-macros
parentInitial commit. (diff)
downloadfirefox-26a029d407be480d791972afb5975cf62c9360a6.tar.xz
firefox-26a029d407be480d791972afb5975cf62c9360a6.zip
Adding upstream version 124.0.1.upstream/124.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'third_party/python/gyp/test/win/vs-macros')
-rw-r--r--third_party/python/gyp/test/win/vs-macros/as.py20
-rw-r--r--third_party/python/gyp/test/win/vs-macros/containing-gyp.gyp39
-rw-r--r--third_party/python/gyp/test/win/vs-macros/do_stuff.py8
-rw-r--r--third_party/python/gyp/test/win/vs-macros/hello.cc7
-rw-r--r--third_party/python/gyp/test/win/vs-macros/input-output-macros.gyp32
-rw-r--r--third_party/python/gyp/test/win/vs-macros/input.S0
-rw-r--r--third_party/python/gyp/test/win/vs-macros/projectname.gyp29
-rw-r--r--third_party/python/gyp/test/win/vs-macros/stuff.blah1
-rw-r--r--third_party/python/gyp/test/win/vs-macros/targetext.gyp59
-rw-r--r--third_party/python/gyp/test/win/vs-macros/targetfilename.gyp59
-rw-r--r--third_party/python/gyp/test/win/vs-macros/targetname.gyp52
-rw-r--r--third_party/python/gyp/test/win/vs-macros/targetpath.gyp59
-rw-r--r--third_party/python/gyp/test/win/vs-macros/test_exists.py10
-rw-r--r--third_party/python/gyp/test/win/vs-macros/vcinstalldir.gyp41
14 files changed, 416 insertions, 0 deletions
diff --git a/third_party/python/gyp/test/win/vs-macros/as.py b/third_party/python/gyp/test/win/vs-macros/as.py
new file mode 100644
index 0000000000..806c91d926
--- /dev/null
+++ b/third_party/python/gyp/test/win/vs-macros/as.py
@@ -0,0 +1,20 @@
+#!/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.
+
+from __future__ import print_function
+
+from optparse import OptionParser
+
+parser = OptionParser()
+parser.add_option('-a', dest='platform')
+parser.add_option('-o', dest='output')
+parser.add_option('-p', dest='path')
+(options, args) = parser.parse_args()
+
+f = open(options.output, 'w')
+print('options', options, file=f)
+print('args', args, file=f)
+f.close()
diff --git a/third_party/python/gyp/test/win/vs-macros/containing-gyp.gyp b/third_party/python/gyp/test/win/vs-macros/containing-gyp.gyp
new file mode 100644
index 0000000000..c07b639ff1
--- /dev/null
+++ b/third_party/python/gyp/test/win/vs-macros/containing-gyp.gyp
@@ -0,0 +1,39 @@
+# 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_expansions',
+ 'msvs_cygwin_shell': 0,
+ 'type': 'none',
+ 'rules': [
+ {
+ 'rule_name': 'assembler (gnu-compatible)',
+ 'msvs_cygwin_shell': 0,
+ 'msvs_quote_cmd': 0,
+ 'extension': 'S',
+ 'inputs': [
+ 'as.py',
+ ],
+ 'outputs': [
+ '$(IntDir)/$(InputName).obj',
+ ],
+ 'action':
+ ['python',
+ 'as.py',
+ '-a', '$(PlatformName)',
+ '-o', '$(IntDir)/$(InputName).obj',
+ '-p', '<(DEPTH)',
+ '$(InputPath)'],
+ 'message': 'Building assembly language file $(InputPath)',
+ 'process_outputs_as_sources': 1,
+ },
+ ],
+ 'sources': [
+ 'input.S',
+ ],
+ },
+ ]
+}
diff --git a/third_party/python/gyp/test/win/vs-macros/do_stuff.py b/third_party/python/gyp/test/win/vs-macros/do_stuff.py
new file mode 100644
index 0000000000..4669d3139b
--- /dev/null
+++ b/third_party/python/gyp/test/win/vs-macros/do_stuff.py
@@ -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.
+
+import sys
+
+input = open(sys.argv[1], "r").read()
+open(sys.argv[2], "w").write(input + "Modified.")
diff --git a/third_party/python/gyp/test/win/vs-macros/hello.cc b/third_party/python/gyp/test/win/vs-macros/hello.cc
new file mode 100644
index 0000000000..1711567ef5
--- /dev/null
+++ b/third_party/python/gyp/test/win/vs-macros/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/vs-macros/input-output-macros.gyp b/third_party/python/gyp/test/win/vs-macros/input-output-macros.gyp
new file mode 100644
index 0000000000..b4520f8cb8
--- /dev/null
+++ b/third_party/python/gyp/test/win/vs-macros/input-output-macros.gyp
@@ -0,0 +1,32 @@
+# 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_expansions',
+ 'msvs_cygwin_shell': 0,
+ 'type': 'none',
+ 'rules': [
+ {
+ 'rule_name': 'generate_file',
+ 'extension': 'blah',
+ 'inputs': [
+ 'do_stuff.py',
+ ],
+ 'outputs': [
+ '$(OutDir)\\<(RULE_INPUT_NAME).something',
+ ],
+ 'action': ['python',
+ 'do_stuff.py',
+ '<(RULE_INPUT_PATH)',
+ '$(OutDir)\\<(RULE_INPUT_NAME).something',],
+ },
+ ],
+ 'sources': [
+ 'stuff.blah',
+ ],
+ },
+ ]
+}
diff --git a/third_party/python/gyp/test/win/vs-macros/input.S b/third_party/python/gyp/test/win/vs-macros/input.S
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/third_party/python/gyp/test/win/vs-macros/input.S
diff --git a/third_party/python/gyp/test/win/vs-macros/projectname.gyp b/third_party/python/gyp/test/win/vs-macros/projectname.gyp
new file mode 100644
index 0000000000..625a177643
--- /dev/null
+++ b/third_party/python/gyp/test/win/vs-macros/projectname.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_expansions',
+ 'type': 'executable',
+ 'sources': ['hello.cc'],
+ 'msvs_settings': {
+ 'VCLinkerTool': {
+ 'OutputFile': '$(OutDir)\\$(ProjectName)_plus_something.exe',
+ },
+ },
+ },
+ {
+ 'target_name': 'test_with_product_name',
+ 'product_name': 'prod_name',
+ 'type': 'executable',
+ 'sources': ['hello.cc'],
+ 'msvs_settings': {
+ 'VCLinkerTool': {
+ 'OutputFile': '$(OutDir)\\$(ProjectName)_plus_something.exe',
+ },
+ },
+ },
+ ]
+}
diff --git a/third_party/python/gyp/test/win/vs-macros/stuff.blah b/third_party/python/gyp/test/win/vs-macros/stuff.blah
new file mode 100644
index 0000000000..d438b4a787
--- /dev/null
+++ b/third_party/python/gyp/test/win/vs-macros/stuff.blah
@@ -0,0 +1 @@
+Random data file.
diff --git a/third_party/python/gyp/test/win/vs-macros/targetext.gyp b/third_party/python/gyp/test/win/vs-macros/targetext.gyp
new file mode 100644
index 0000000000..11f580e4a6
--- /dev/null
+++ b/third_party/python/gyp/test/win/vs-macros/targetext.gyp
@@ -0,0 +1,59 @@
+# 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_targetext_executable',
+ 'type': 'executable',
+ 'sources': ['hello.cc'],
+ 'msvs_settings': {
+ 'VCLinkerTool': {
+ 'OutputFile': '$(TargetDir)\\executable$(TargetExt)',
+ },
+ },
+ },
+ {
+ 'target_name': 'test_targetext_loadable_module',
+ 'type': 'loadable_module',
+ 'sources': ['hello.cc'],
+ 'msvs_settings': {
+ 'VCLinkerTool': {
+ 'OutputFile': '$(TargetDir)\\loadable_module$(TargetExt)',
+ },
+ },
+ },
+ {
+ 'target_name': 'test_targetext_shared_library',
+ 'type': 'shared_library',
+ 'sources': ['hello.cc'],
+ 'msvs_settings': {
+ 'VCLinkerTool': {
+ 'OutputFile': '$(TargetDir)\\shared_library$(TargetExt)',
+ },
+ },
+ },
+ {
+ 'target_name': 'test_targetext_static_library',
+ 'type': 'static_library',
+ 'sources': ['hello.cc'],
+ 'msvs_settings': {
+ 'VCLibrarianTool': {
+ 'OutputFile': '$(TargetDir)\\static_library$(TargetExt)',
+ },
+ },
+ },
+ {
+ 'target_name': 'test_targetext_product_extension',
+ 'type': 'executable',
+ 'sources': ['hello.cc'],
+ 'product_extension': 'library',
+ 'msvs_settings': {
+ 'VCLinkerTool': {
+ 'OutputFile': '$(TargetDir)\\product_extension$(TargetExt)',
+ },
+ },
+ },
+ ]
+}
diff --git a/third_party/python/gyp/test/win/vs-macros/targetfilename.gyp b/third_party/python/gyp/test/win/vs-macros/targetfilename.gyp
new file mode 100644
index 0000000000..8287320278
--- /dev/null
+++ b/third_party/python/gyp/test/win/vs-macros/targetfilename.gyp
@@ -0,0 +1,59 @@
+# 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_targetfilename_executable',
+ 'type': 'executable',
+ 'sources': ['hello.cc'],
+ 'msvs_settings': {
+ 'VCLinkerTool': {
+ 'OutputFile': '$(TargetDir)\\$(TargetFileName)',
+ },
+ },
+ },
+ {
+ 'target_name': 'test_targetfilename_loadable_module',
+ 'type': 'loadable_module',
+ 'sources': ['hello.cc'],
+ 'msvs_settings': {
+ 'VCLinkerTool': {
+ 'OutputFile': '$(TargetDir)\\$(TargetFileName)',
+ },
+ },
+ },
+ {
+ 'target_name': 'test_targetfilename_shared_library',
+ 'type': 'loadable_module',
+ 'sources': ['hello.cc'],
+ 'msvs_settings': {
+ 'VCLinkerTool': {
+ 'OutputFile': '$(TargetDir)\\$(TargetFileName)',
+ },
+ },
+ },
+ {
+ 'target_name': 'test_targetfilename_static_library',
+ 'type': 'static_library',
+ 'sources': ['hello.cc'],
+ 'msvs_settings': {
+ 'VCLibrarianTool': {
+ 'OutputFile': '$(TargetDir)\\$(TargetFileName)',
+ },
+ },
+ },
+ {
+ 'target_name': 'test_targetfilename_product_extension',
+ 'type': 'executable',
+ 'sources': ['hello.cc'],
+ 'product_extension': 'foo',
+ 'msvs_settings': {
+ 'VCLinkerTool': {
+ 'OutputFile': '$(TargetDir)\\$(TargetFileName)',
+ },
+ },
+ },
+ ]
+}
diff --git a/third_party/python/gyp/test/win/vs-macros/targetname.gyp b/third_party/python/gyp/test/win/vs-macros/targetname.gyp
new file mode 100644
index 0000000000..a53d3c0aa3
--- /dev/null
+++ b/third_party/python/gyp/test/win/vs-macros/targetname.gyp
@@ -0,0 +1,52 @@
+# 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_targetname',
+ 'type': 'executable',
+ 'sources': ['hello.cc'],
+ 'msvs_settings': {
+ 'VCLinkerTool': {
+ 'OutputFile': '$(TargetDir)\\$(TargetName)_plus_something1.exe',
+ },
+ },
+ },
+ {
+ 'target_name': 'test_targetname_with_prefix',
+ 'product_prefix': 'prod_prefix',
+ 'type': 'executable',
+ 'sources': ['hello.cc'],
+ 'msvs_settings': {
+ 'VCLinkerTool': {
+ 'OutputFile': '$(TargetDir)\\$(TargetName)_plus_something2.exe',
+ },
+ },
+ },
+ {
+ 'target_name': 'test_targetname_with_prodname',
+ 'product_name': 'prod_name',
+ 'type': 'executable',
+ 'sources': ['hello.cc'],
+ 'msvs_settings': {
+ 'VCLinkerTool': {
+ 'OutputFile': '$(TargetDir)\\$(TargetName)_plus_something3.exe',
+ },
+ },
+ },
+ {
+ 'target_name': 'test_targetname_with_prodname_with_prefix',
+ 'product_name': 'prod_name',
+ 'product_prefix': 'prod_prefix',
+ 'type': 'executable',
+ 'sources': ['hello.cc'],
+ 'msvs_settings': {
+ 'VCLinkerTool': {
+ 'OutputFile': '$(TargetDir)\\$(TargetName)_plus_something4.exe',
+ },
+ },
+ },
+ ]
+}
diff --git a/third_party/python/gyp/test/win/vs-macros/targetpath.gyp b/third_party/python/gyp/test/win/vs-macros/targetpath.gyp
new file mode 100644
index 0000000000..a8699ffb25
--- /dev/null
+++ b/third_party/python/gyp/test/win/vs-macros/targetpath.gyp
@@ -0,0 +1,59 @@
+# 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_targetpath_executable',
+ 'type': 'executable',
+ 'sources': ['hello.cc'],
+ 'msvs_settings': {
+ 'VCLinkerTool': {
+ 'OutputFile': '$(TargetPath)',
+ },
+ },
+ },
+ {
+ 'target_name': 'test_targetpath_loadable_module',
+ 'type': 'loadable_module',
+ 'sources': ['hello.cc'],
+ 'msvs_settings': {
+ 'VCLinkerTool': {
+ 'OutputFile': '$(TargetPath)',
+ },
+ },
+ },
+ {
+ 'target_name': 'test_targetpath_shared_library',
+ 'type': 'loadable_module',
+ 'sources': ['hello.cc'],
+ 'msvs_settings': {
+ 'VCLinkerTool': {
+ 'OutputFile': '$(TargetPath)',
+ },
+ },
+ },
+ {
+ 'target_name': 'test_targetpath_static_library',
+ 'type': 'static_library',
+ 'sources': ['hello.cc'],
+ 'msvs_settings': {
+ 'VCLibrarianTool': {
+ 'OutputFile': '$(TargetPath)',
+ },
+ },
+ },
+ {
+ 'target_name': 'test_targetpath_product_extension',
+ 'type': 'executable',
+ 'sources': ['hello.cc'],
+ 'product_extension': 'foo',
+ 'msvs_settings': {
+ 'VCLinkerTool': {
+ 'OutputFile': '$(TargetPath)',
+ },
+ },
+ },
+ ]
+}
diff --git a/third_party/python/gyp/test/win/vs-macros/test_exists.py b/third_party/python/gyp/test/win/vs-macros/test_exists.py
new file mode 100644
index 0000000000..297b1b7d9f
--- /dev/null
+++ b/third_party/python/gyp/test/win/vs-macros/test_exists.py
@@ -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.
+
+import os
+import sys
+
+if not os.path.exists(sys.argv[1]):
+ raise Exception()
+open(sys.argv[2], 'w').close()
diff --git a/third_party/python/gyp/test/win/vs-macros/vcinstalldir.gyp b/third_party/python/gyp/test/win/vs-macros/vcinstalldir.gyp
new file mode 100644
index 0000000000..3763a4eb18
--- /dev/null
+++ b/third_party/python/gyp/test/win/vs-macros/vcinstalldir.gyp
@@ -0,0 +1,41 @@
+# 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_slash_trailing',
+ 'type': 'none',
+ 'msvs_cygwin_shell': '0',
+ 'actions': [
+ {
+ 'action_name': 'root',
+ 'inputs': [],
+ 'outputs': ['out1'],
+ 'action': ['python', 'test_exists.py', '$(VCInstallDir)', 'out1']
+ },
+ ],
+ },
+ {
+ 'target_name': 'test_slash_dir',
+ 'type': 'none',
+ 'msvs_cygwin_shell': '0',
+ 'actions': [
+ {
+ 'action_name': 'bin',
+ 'inputs': [],
+ 'outputs': ['out2'],
+ 'action': ['python', 'test_exists.py', '$(VCInstallDir)bin', 'out2'],
+ },
+ {
+ 'action_name': 'compiler',
+ 'inputs': [],
+ 'outputs': ['out3'],
+ 'action': [
+ 'python', 'test_exists.py', '$(VCInstallDir)bin\\cl.exe', 'out3'],
+ },
+ ],
+ },
+ ]
+}