summaryrefslogtreecommitdiff
path: root/deps/gyp/test/rules-dirname/src
diff options
context:
space:
mode:
authorMike Morris <michael.patrick.morris@gmail.com>2015-12-04 13:29:51 -0500
committerMike Morris <michael.patrick.morris@gmail.com>2015-12-07 15:48:34 -0800
commitd467ae6e7867044b8d7b466776fb37089292c52b (patch)
tree730ee0656e6bf9f0dff33346f07acd800e83ab25 /deps/gyp/test/rules-dirname/src
parent59ef8da69549cf6308078c6f656affba96e9439e (diff)
downloadqtlocation-mapboxgl-d467ae6e7867044b8d7b466776fb37089292c52b.tar.gz
[core] upgrade gyp to git commit 6fb8bd8
https://chromium.googlesource.com/external/gyp/+/6fb8bd829f0ca8fd432fd85ede788b6881c4f09f
Diffstat (limited to 'deps/gyp/test/rules-dirname/src')
-rw-r--r--deps/gyp/test/rules-dirname/src/actions.gyp15
-rwxr-xr-xdeps/gyp/test/rules-dirname/src/copy-file.py11
-rw-r--r--deps/gyp/test/rules-dirname/src/subdir/a/b/c.gencc8
-rw-r--r--deps/gyp/test/rules-dirname/src/subdir/a/b/c.printvars1
-rw-r--r--deps/gyp/test/rules-dirname/src/subdir/foo/bar/baz.gencc8
-rw-r--r--deps/gyp/test/rules-dirname/src/subdir/foo/bar/baz.printvars1
-rw-r--r--deps/gyp/test/rules-dirname/src/subdir/input-rule-dirname.gyp140
-rw-r--r--deps/gyp/test/rules-dirname/src/subdir/main.cc14
-rw-r--r--deps/gyp/test/rules-dirname/src/subdir/nodir.gencc8
-rwxr-xr-xdeps/gyp/test/rules-dirname/src/subdir/printvars.py14
10 files changed, 220 insertions, 0 deletions
diff --git a/deps/gyp/test/rules-dirname/src/actions.gyp b/deps/gyp/test/rules-dirname/src/actions.gyp
new file mode 100644
index 0000000000..c5693c6c9e
--- /dev/null
+++ b/deps/gyp/test/rules-dirname/src/actions.gyp
@@ -0,0 +1,15 @@
+# Copyright (c) 2011 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': 'pull_in_all_actions',
+ 'type': 'none',
+ 'dependencies': [
+ 'subdir/input-rule-dirname.gyp:*',
+ ],
+ },
+ ],
+}
diff --git a/deps/gyp/test/rules-dirname/src/copy-file.py b/deps/gyp/test/rules-dirname/src/copy-file.py
new file mode 100755
index 0000000000..9774ccc960
--- /dev/null
+++ b/deps/gyp/test/rules-dirname/src/copy-file.py
@@ -0,0 +1,11 @@
+#!/usr/bin/env python
+
+# Copyright (c) 2011 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
+
+contents = open(sys.argv[1], 'r').read()
+open(sys.argv[2], 'wb').write(contents)
+
+sys.exit(0)
diff --git a/deps/gyp/test/rules-dirname/src/subdir/a/b/c.gencc b/deps/gyp/test/rules-dirname/src/subdir/a/b/c.gencc
new file mode 100644
index 0000000000..29cb5f79ad
--- /dev/null
+++ b/deps/gyp/test/rules-dirname/src/subdir/a/b/c.gencc
@@ -0,0 +1,8 @@
+// -*- mode: c++ -*-
+#include <stdio.h>
+
+namespace gen {
+ void c() {
+ printf("hi c\n");
+ }
+}
diff --git a/deps/gyp/test/rules-dirname/src/subdir/a/b/c.printvars b/deps/gyp/test/rules-dirname/src/subdir/a/b/c.printvars
new file mode 100644
index 0000000000..cc4561dc41
--- /dev/null
+++ b/deps/gyp/test/rules-dirname/src/subdir/a/b/c.printvars
@@ -0,0 +1 @@
+# Empty file for testing build rules
diff --git a/deps/gyp/test/rules-dirname/src/subdir/foo/bar/baz.gencc b/deps/gyp/test/rules-dirname/src/subdir/foo/bar/baz.gencc
new file mode 100644
index 0000000000..90b4ce9243
--- /dev/null
+++ b/deps/gyp/test/rules-dirname/src/subdir/foo/bar/baz.gencc
@@ -0,0 +1,8 @@
+// -*- mode: c++ -*-
+#include <stdio.h>
+
+namespace gen {
+ void baz() {
+ printf("hello baz\n");
+ }
+}
diff --git a/deps/gyp/test/rules-dirname/src/subdir/foo/bar/baz.printvars b/deps/gyp/test/rules-dirname/src/subdir/foo/bar/baz.printvars
new file mode 100644
index 0000000000..cc4561dc41
--- /dev/null
+++ b/deps/gyp/test/rules-dirname/src/subdir/foo/bar/baz.printvars
@@ -0,0 +1 @@
+# Empty file for testing build rules
diff --git a/deps/gyp/test/rules-dirname/src/subdir/input-rule-dirname.gyp b/deps/gyp/test/rules-dirname/src/subdir/input-rule-dirname.gyp
new file mode 100644
index 0000000000..da749a2231
--- /dev/null
+++ b/deps/gyp/test/rules-dirname/src/subdir/input-rule-dirname.gyp
@@ -0,0 +1,140 @@
+# Copyright (c) 2011 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': 'print_rule_input_dirname',
+ 'type': 'none',
+ 'msvs_cygwin_shell': 0,
+ 'sources': [
+ 'foo/bar/baz.printvars',
+ 'a/b/c.printvars',
+ ],
+ 'rules': [
+ {
+ 'rule_name': 'printvars',
+ 'extension': 'printvars',
+ 'inputs': [
+ 'printvars.py',
+ ],
+ 'outputs': [
+ '<(RULE_INPUT_DIRNAME)/<(RULE_INPUT_ROOT).dirname',
+ ],
+ 'action': [
+ 'python', '<@(_inputs)', '<(RULE_INPUT_DIRNAME)', '<@(_outputs)',
+ ],
+ },
+ ],
+ },
+ {
+ 'target_name': 'print_rule_input_path',
+ 'type': 'none',
+ 'msvs_cygwin_shell': 0,
+ 'sources': [
+ 'foo/bar/baz.printvars',
+ 'a/b/c.printvars',
+ ],
+ 'rules': [
+ {
+ 'rule_name': 'printvars',
+ 'extension': 'printvars',
+ 'inputs': [
+ 'printvars.py',
+ ],
+ 'outputs': [
+ '<(RULE_INPUT_DIRNAME)/<(RULE_INPUT_ROOT).path',
+ ],
+ 'action': [
+ 'python', '<@(_inputs)', '<(RULE_INPUT_PATH)', '<@(_outputs)',
+ ],
+ },
+ ],
+ },
+ {
+ 'target_name': 'gencc_int_output',
+ 'type': 'executable',
+ 'msvs_cygwin_shell': 0,
+ 'sources': [
+ 'nodir.gencc',
+ 'foo/bar/baz.gencc',
+ 'a/b/c.gencc',
+ 'main.cc',
+ ],
+ 'rules': [
+ {
+ 'rule_name': 'gencc',
+ 'extension': 'gencc',
+ 'inputs': [
+ '<(DEPTH)/copy-file.py',
+ ],
+ 'outputs': [
+ '<(INTERMEDIATE_DIR)/<(RULE_INPUT_DIRNAME)/<(RULE_INPUT_ROOT).cc',
+ ],
+ 'action': [
+ 'python', '<@(_inputs)', '<(RULE_INPUT_PATH)', '<@(_outputs)',
+ ],
+ 'process_outputs_as_sources': 1,
+ },
+ ],
+ },
+ ],
+ 'conditions': [
+ ['OS=="win"', {
+ 'targets': [
+ {
+ 'target_name': 'gencc_int_output_external',
+ 'type': 'executable',
+ 'msvs_cygwin_shell': 0,
+ 'msvs_cygwin_dirs': ['../../../../../../<(DEPTH)/third_party/cygwin'],
+ 'sources': [
+ 'nodir.gencc',
+ 'foo/bar/baz.gencc',
+ 'a/b/c.gencc',
+ 'main.cc',
+ ],
+ 'dependencies': [
+ 'cygwin',
+ ],
+ 'rules': [
+ {
+ 'rule_name': 'gencc',
+ 'extension': 'gencc',
+ 'msvs_external_rule': 1,
+ 'inputs': [
+ '<(DEPTH)/copy-file.py',
+ ],
+ 'outputs': [
+ '<(INTERMEDIATE_DIR)/<(RULE_INPUT_DIRNAME)/<(RULE_INPUT_ROOT).cc',
+ ],
+ 'action': [
+ 'python', '<@(_inputs)', '<(RULE_INPUT_PATH)', '<@(_outputs)',
+ ],
+ 'process_outputs_as_sources': 1,
+ },
+ ],
+ },
+ {
+ 'target_name': 'cygwin',
+ 'type': 'none',
+ 'actions': [
+ {
+ 'action_name': 'setup_mount',
+ 'msvs_cygwin_shell': 0,
+ 'inputs': [
+ '../../../../../../<(DEPTH)/third_party/cygwin/setup_mount.bat',
+ ],
+ # Visual Studio requires an output file, or else the
+ # custom build step won't run.
+ 'outputs': [
+ '<(INTERMEDIATE_DIR)/_always_run_setup_mount.marker',
+ ],
+ 'action': ['<@(_inputs)'],
+ },
+ ],
+ },
+ ],
+ }],
+ ],
+}
diff --git a/deps/gyp/test/rules-dirname/src/subdir/main.cc b/deps/gyp/test/rules-dirname/src/subdir/main.cc
new file mode 100644
index 0000000000..3bb8e01395
--- /dev/null
+++ b/deps/gyp/test/rules-dirname/src/subdir/main.cc
@@ -0,0 +1,14 @@
+// Copyright (c) 2011 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.
+namespace gen {
+ extern void nodir();
+ extern void c();
+ extern void baz();
+}
+
+int main() {
+ gen::nodir();
+ gen::c();
+ gen::baz();
+}
diff --git a/deps/gyp/test/rules-dirname/src/subdir/nodir.gencc b/deps/gyp/test/rules-dirname/src/subdir/nodir.gencc
new file mode 100644
index 0000000000..720f589bc2
--- /dev/null
+++ b/deps/gyp/test/rules-dirname/src/subdir/nodir.gencc
@@ -0,0 +1,8 @@
+// -*- mode: c++ -*-
+#include <stdio.h>
+
+namespace gen {
+ void nodir() {
+ printf("no dir here\n");
+ }
+}
diff --git a/deps/gyp/test/rules-dirname/src/subdir/printvars.py b/deps/gyp/test/rules-dirname/src/subdir/printvars.py
new file mode 100755
index 0000000000..ef3d92e8cf
--- /dev/null
+++ b/deps/gyp/test/rules-dirname/src/subdir/printvars.py
@@ -0,0 +1,14 @@
+#!/usr/bin/env python
+
+# Copyright (c) 2011 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.
+
+"""
+Prints interesting vars
+"""
+
+import sys;
+
+out = open(sys.argv[2], 'w')
+out.write(sys.argv[1]);