summaryrefslogtreecommitdiff
path: root/deps/gyp/test/external-cross-compile/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/external-cross-compile/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/external-cross-compile/src')
-rw-r--r--deps/gyp/test/external-cross-compile/src/bogus1.cc1
-rw-r--r--deps/gyp/test/external-cross-compile/src/bogus2.c1
-rw-r--r--deps/gyp/test/external-cross-compile/src/cross.gyp83
-rw-r--r--deps/gyp/test/external-cross-compile/src/cross_compile.gypi23
-rw-r--r--deps/gyp/test/external-cross-compile/src/fake_cross.py18
-rw-r--r--deps/gyp/test/external-cross-compile/src/program.cc16
-rw-r--r--deps/gyp/test/external-cross-compile/src/test1.cc1
-rw-r--r--deps/gyp/test/external-cross-compile/src/test2.c1
-rw-r--r--deps/gyp/test/external-cross-compile/src/test3.cc1
-rw-r--r--deps/gyp/test/external-cross-compile/src/test4.c1
-rw-r--r--deps/gyp/test/external-cross-compile/src/tochar.py13
11 files changed, 159 insertions, 0 deletions
diff --git a/deps/gyp/test/external-cross-compile/src/bogus1.cc b/deps/gyp/test/external-cross-compile/src/bogus1.cc
new file mode 100644
index 0000000000..1b8d01199b
--- /dev/null
+++ b/deps/gyp/test/external-cross-compile/src/bogus1.cc
@@ -0,0 +1 @@
+From bogus1.cc
diff --git a/deps/gyp/test/external-cross-compile/src/bogus2.c b/deps/gyp/test/external-cross-compile/src/bogus2.c
new file mode 100644
index 0000000000..cbf4a123c4
--- /dev/null
+++ b/deps/gyp/test/external-cross-compile/src/bogus2.c
@@ -0,0 +1 @@
+From bogus2.c
diff --git a/deps/gyp/test/external-cross-compile/src/cross.gyp b/deps/gyp/test/external-cross-compile/src/cross.gyp
new file mode 100644
index 0000000000..aeda76b5bd
--- /dev/null
+++ b/deps/gyp/test/external-cross-compile/src/cross.gyp
@@ -0,0 +1,83 @@
+# Copyright (c) 2009 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.
+
+{
+ 'includes': ['cross_compile.gypi'],
+ 'target_defaults': {
+ 'variables': {
+ 'nix_lame%': 0,
+ },
+ 'target_conditions': [
+ ['nix_lame==1', {
+ 'sources/': [
+ ['exclude', 'lame'],
+ ],
+ }],
+ ],
+ },
+ 'targets': [
+ {
+ 'target_name': 'program',
+ 'type': 'executable',
+ 'dependencies': [
+ 'program_inc',
+ ],
+ 'include_dirs': [
+ '<(SHARED_INTERMEDIATE_DIR)',
+ ],
+ 'sources': [
+ 'program.cc',
+ ],
+ },
+ {
+ 'target_name': 'program_inc',
+ 'type': 'none',
+ 'dependencies': ['cross_program'],
+ 'actions': [
+ {
+ 'action_name': 'program_inc',
+ 'inputs': ['<(SHARED_INTERMEDIATE_DIR)/cross_program.fake'],
+ 'outputs': ['<(SHARED_INTERMEDIATE_DIR)/cross_program.h'],
+ 'action': ['python', 'tochar.py', '<@(_inputs)', '<@(_outputs)'],
+ },
+ ],
+ # Allows the test to run without hermetic cygwin on windows.
+ 'msvs_cygwin_shell': 0,
+ },
+ {
+ 'target_name': 'cross_program',
+ 'type': 'none',
+ 'variables': {
+ 'cross': 1,
+ 'nix_lame': 1,
+ },
+ 'dependencies': ['cross_lib'],
+ 'sources': [
+ 'test1.cc',
+ 'test2.c',
+ 'very_lame.cc',
+ '<(SHARED_INTERMEDIATE_DIR)/cross_lib.fake',
+ ],
+ },
+ {
+ 'target_name': 'cross_lib',
+ 'type': 'none',
+ 'variables': {
+ 'cross': 1,
+ 'nix_lame': 1,
+ },
+ 'sources': [
+ 'test3.cc',
+ 'test4.c',
+ 'bogus1.cc',
+ 'bogus2.c',
+ 'sort_of_lame.cc',
+ ],
+ 'sources!': [
+ 'bogus1.cc',
+ 'bogus2.c',
+ ],
+ },
+ ],
+}
diff --git a/deps/gyp/test/external-cross-compile/src/cross_compile.gypi b/deps/gyp/test/external-cross-compile/src/cross_compile.gypi
new file mode 100644
index 0000000000..36e651903f
--- /dev/null
+++ b/deps/gyp/test/external-cross-compile/src/cross_compile.gypi
@@ -0,0 +1,23 @@
+{
+ 'target_defaults': {
+ 'variables': {
+ 'cross%': 0,
+ },
+ 'target_conditions': [
+ ['cross==1', {
+ 'actions': [
+ {
+ 'action_name': 'cross compile >(_target_name)',
+ 'inputs': ['^@(_sources)'],
+ 'outputs': ['<(SHARED_INTERMEDIATE_DIR)/>(_target_name).fake'],
+ 'action': [
+ 'python', 'fake_cross.py', '>@(_outputs)', '^@(_sources)',
+ ],
+ # Allows the test to run without hermetic cygwin on windows.
+ 'msvs_cygwin_shell': 0,
+ },
+ ],
+ }],
+ ],
+ },
+}
diff --git a/deps/gyp/test/external-cross-compile/src/fake_cross.py b/deps/gyp/test/external-cross-compile/src/fake_cross.py
new file mode 100644
index 0000000000..05eacc6a63
--- /dev/null
+++ b/deps/gyp/test/external-cross-compile/src/fake_cross.py
@@ -0,0 +1,18 @@
+#!/usr/bin/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.
+
+import sys
+
+fh = open(sys.argv[1], 'w')
+
+filenames = sys.argv[2:]
+
+for filename in filenames:
+ subfile = open(filename)
+ data = subfile.read()
+ subfile.close()
+ fh.write(data)
+
+fh.close()
diff --git a/deps/gyp/test/external-cross-compile/src/program.cc b/deps/gyp/test/external-cross-compile/src/program.cc
new file mode 100644
index 0000000000..5172ae90fe
--- /dev/null
+++ b/deps/gyp/test/external-cross-compile/src/program.cc
@@ -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.
+ */
+
+#include <stdio.h>
+
+static char data[] = {
+#include "cross_program.h"
+};
+
+int main(void) {
+ fwrite(data, 1, sizeof(data), stdout);
+ return 0;
+}
diff --git a/deps/gyp/test/external-cross-compile/src/test1.cc b/deps/gyp/test/external-cross-compile/src/test1.cc
new file mode 100644
index 0000000000..b584c31d15
--- /dev/null
+++ b/deps/gyp/test/external-cross-compile/src/test1.cc
@@ -0,0 +1 @@
+From test1.cc
diff --git a/deps/gyp/test/external-cross-compile/src/test2.c b/deps/gyp/test/external-cross-compile/src/test2.c
new file mode 100644
index 0000000000..367ae19ea0
--- /dev/null
+++ b/deps/gyp/test/external-cross-compile/src/test2.c
@@ -0,0 +1 @@
+From test2.c
diff --git a/deps/gyp/test/external-cross-compile/src/test3.cc b/deps/gyp/test/external-cross-compile/src/test3.cc
new file mode 100644
index 0000000000..9eb64735b8
--- /dev/null
+++ b/deps/gyp/test/external-cross-compile/src/test3.cc
@@ -0,0 +1 @@
+From test3.cc
diff --git a/deps/gyp/test/external-cross-compile/src/test4.c b/deps/gyp/test/external-cross-compile/src/test4.c
new file mode 100644
index 0000000000..8ecc33ec16
--- /dev/null
+++ b/deps/gyp/test/external-cross-compile/src/test4.c
@@ -0,0 +1 @@
+From test4.c
diff --git a/deps/gyp/test/external-cross-compile/src/tochar.py b/deps/gyp/test/external-cross-compile/src/tochar.py
new file mode 100644
index 0000000000..c0780d984f
--- /dev/null
+++ b/deps/gyp/test/external-cross-compile/src/tochar.py
@@ -0,0 +1,13 @@
+#!/usr/bin/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.
+
+import sys
+
+src = open(sys.argv[1])
+dst = open(sys.argv[2], 'w')
+for ch in src.read():
+ dst.write('%d,\n' % ord(ch))
+src.close()
+dst.close()