From 26a029d407be480d791972afb5975cf62c9360a6 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 02:47:55 +0200 Subject: Adding upstream version 124.0.1. Signed-off-by: Daniel Baumann --- .../gyp/test/external-cross-compile/src/bogus1.cc | 1 + .../gyp/test/external-cross-compile/src/bogus2.c | 1 + .../gyp/test/external-cross-compile/src/cross.gyp | 83 ++++++++++++++++++++++ .../external-cross-compile/src/cross_compile.gypi | 23 ++++++ .../test/external-cross-compile/src/fake_cross.py | 18 +++++ .../gyp/test/external-cross-compile/src/program.cc | 16 +++++ .../gyp/test/external-cross-compile/src/test1.cc | 1 + .../gyp/test/external-cross-compile/src/test2.c | 1 + .../gyp/test/external-cross-compile/src/test3.cc | 1 + .../gyp/test/external-cross-compile/src/test4.c | 1 + .../gyp/test/external-cross-compile/src/tochar.py | 13 ++++ 11 files changed, 159 insertions(+) create mode 100644 third_party/python/gyp/test/external-cross-compile/src/bogus1.cc create mode 100644 third_party/python/gyp/test/external-cross-compile/src/bogus2.c create mode 100644 third_party/python/gyp/test/external-cross-compile/src/cross.gyp create mode 100644 third_party/python/gyp/test/external-cross-compile/src/cross_compile.gypi create mode 100644 third_party/python/gyp/test/external-cross-compile/src/fake_cross.py create mode 100644 third_party/python/gyp/test/external-cross-compile/src/program.cc create mode 100644 third_party/python/gyp/test/external-cross-compile/src/test1.cc create mode 100644 third_party/python/gyp/test/external-cross-compile/src/test2.c create mode 100644 third_party/python/gyp/test/external-cross-compile/src/test3.cc create mode 100644 third_party/python/gyp/test/external-cross-compile/src/test4.c create mode 100644 third_party/python/gyp/test/external-cross-compile/src/tochar.py (limited to 'third_party/python/gyp/test/external-cross-compile/src') diff --git a/third_party/python/gyp/test/external-cross-compile/src/bogus1.cc b/third_party/python/gyp/test/external-cross-compile/src/bogus1.cc new file mode 100644 index 0000000000..1b8d01199b --- /dev/null +++ b/third_party/python/gyp/test/external-cross-compile/src/bogus1.cc @@ -0,0 +1 @@ +From bogus1.cc diff --git a/third_party/python/gyp/test/external-cross-compile/src/bogus2.c b/third_party/python/gyp/test/external-cross-compile/src/bogus2.c new file mode 100644 index 0000000000..cbf4a123c4 --- /dev/null +++ b/third_party/python/gyp/test/external-cross-compile/src/bogus2.c @@ -0,0 +1 @@ +From bogus2.c diff --git a/third_party/python/gyp/test/external-cross-compile/src/cross.gyp b/third_party/python/gyp/test/external-cross-compile/src/cross.gyp new file mode 100644 index 0000000000..aeda76b5bd --- /dev/null +++ b/third_party/python/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/third_party/python/gyp/test/external-cross-compile/src/cross_compile.gypi b/third_party/python/gyp/test/external-cross-compile/src/cross_compile.gypi new file mode 100644 index 0000000000..36e651903f --- /dev/null +++ b/third_party/python/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/third_party/python/gyp/test/external-cross-compile/src/fake_cross.py b/third_party/python/gyp/test/external-cross-compile/src/fake_cross.py new file mode 100644 index 0000000000..05eacc6a63 --- /dev/null +++ b/third_party/python/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/third_party/python/gyp/test/external-cross-compile/src/program.cc b/third_party/python/gyp/test/external-cross-compile/src/program.cc new file mode 100644 index 0000000000..5172ae90fe --- /dev/null +++ b/third_party/python/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 + +static char data[] = { +#include "cross_program.h" +}; + +int main(void) { + fwrite(data, 1, sizeof(data), stdout); + return 0; +} diff --git a/third_party/python/gyp/test/external-cross-compile/src/test1.cc b/third_party/python/gyp/test/external-cross-compile/src/test1.cc new file mode 100644 index 0000000000..b584c31d15 --- /dev/null +++ b/third_party/python/gyp/test/external-cross-compile/src/test1.cc @@ -0,0 +1 @@ +From test1.cc diff --git a/third_party/python/gyp/test/external-cross-compile/src/test2.c b/third_party/python/gyp/test/external-cross-compile/src/test2.c new file mode 100644 index 0000000000..367ae19ea0 --- /dev/null +++ b/third_party/python/gyp/test/external-cross-compile/src/test2.c @@ -0,0 +1 @@ +From test2.c diff --git a/third_party/python/gyp/test/external-cross-compile/src/test3.cc b/third_party/python/gyp/test/external-cross-compile/src/test3.cc new file mode 100644 index 0000000000..9eb64735b8 --- /dev/null +++ b/third_party/python/gyp/test/external-cross-compile/src/test3.cc @@ -0,0 +1 @@ +From test3.cc diff --git a/third_party/python/gyp/test/external-cross-compile/src/test4.c b/third_party/python/gyp/test/external-cross-compile/src/test4.c new file mode 100644 index 0000000000..8ecc33ec16 --- /dev/null +++ b/third_party/python/gyp/test/external-cross-compile/src/test4.c @@ -0,0 +1 @@ +From test4.c diff --git a/third_party/python/gyp/test/external-cross-compile/src/tochar.py b/third_party/python/gyp/test/external-cross-compile/src/tochar.py new file mode 100644 index 0000000000..c0780d984f --- /dev/null +++ b/third_party/python/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() -- cgit v1.2.3