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/rules-dirname/src/subdir/a/b/c.gencc | 8 ++ .../test/rules-dirname/src/subdir/a/b/c.printvars | 1 + .../rules-dirname/src/subdir/foo/bar/baz.gencc | 8 ++ .../rules-dirname/src/subdir/foo/bar/baz.printvars | 1 + .../src/subdir/input-rule-dirname.gyp | 140 +++++++++++++++++++++ .../gyp/test/rules-dirname/src/subdir/main.cc | 14 +++ .../gyp/test/rules-dirname/src/subdir/nodir.gencc | 8 ++ .../gyp/test/rules-dirname/src/subdir/printvars.py | 14 +++ 8 files changed, 194 insertions(+) create mode 100644 third_party/python/gyp/test/rules-dirname/src/subdir/a/b/c.gencc create mode 100644 third_party/python/gyp/test/rules-dirname/src/subdir/a/b/c.printvars create mode 100644 third_party/python/gyp/test/rules-dirname/src/subdir/foo/bar/baz.gencc create mode 100644 third_party/python/gyp/test/rules-dirname/src/subdir/foo/bar/baz.printvars create mode 100644 third_party/python/gyp/test/rules-dirname/src/subdir/input-rule-dirname.gyp create mode 100644 third_party/python/gyp/test/rules-dirname/src/subdir/main.cc create mode 100644 third_party/python/gyp/test/rules-dirname/src/subdir/nodir.gencc create mode 100755 third_party/python/gyp/test/rules-dirname/src/subdir/printvars.py (limited to 'third_party/python/gyp/test/rules-dirname/src/subdir') diff --git a/third_party/python/gyp/test/rules-dirname/src/subdir/a/b/c.gencc b/third_party/python/gyp/test/rules-dirname/src/subdir/a/b/c.gencc new file mode 100644 index 0000000000..29cb5f79ad --- /dev/null +++ b/third_party/python/gyp/test/rules-dirname/src/subdir/a/b/c.gencc @@ -0,0 +1,8 @@ +// -*- mode: c++ -*- +#include + +namespace gen { + void c() { + printf("hi c\n"); + } +} diff --git a/third_party/python/gyp/test/rules-dirname/src/subdir/a/b/c.printvars b/third_party/python/gyp/test/rules-dirname/src/subdir/a/b/c.printvars new file mode 100644 index 0000000000..cc4561dc41 --- /dev/null +++ b/third_party/python/gyp/test/rules-dirname/src/subdir/a/b/c.printvars @@ -0,0 +1 @@ +# Empty file for testing build rules diff --git a/third_party/python/gyp/test/rules-dirname/src/subdir/foo/bar/baz.gencc b/third_party/python/gyp/test/rules-dirname/src/subdir/foo/bar/baz.gencc new file mode 100644 index 0000000000..90b4ce9243 --- /dev/null +++ b/third_party/python/gyp/test/rules-dirname/src/subdir/foo/bar/baz.gencc @@ -0,0 +1,8 @@ +// -*- mode: c++ -*- +#include + +namespace gen { + void baz() { + printf("hello baz\n"); + } +} diff --git a/third_party/python/gyp/test/rules-dirname/src/subdir/foo/bar/baz.printvars b/third_party/python/gyp/test/rules-dirname/src/subdir/foo/bar/baz.printvars new file mode 100644 index 0000000000..cc4561dc41 --- /dev/null +++ b/third_party/python/gyp/test/rules-dirname/src/subdir/foo/bar/baz.printvars @@ -0,0 +1 @@ +# Empty file for testing build rules diff --git a/third_party/python/gyp/test/rules-dirname/src/subdir/input-rule-dirname.gyp b/third_party/python/gyp/test/rules-dirname/src/subdir/input-rule-dirname.gyp new file mode 100644 index 0000000000..da749a2231 --- /dev/null +++ b/third_party/python/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/third_party/python/gyp/test/rules-dirname/src/subdir/main.cc b/third_party/python/gyp/test/rules-dirname/src/subdir/main.cc new file mode 100644 index 0000000000..3bb8e01395 --- /dev/null +++ b/third_party/python/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/third_party/python/gyp/test/rules-dirname/src/subdir/nodir.gencc b/third_party/python/gyp/test/rules-dirname/src/subdir/nodir.gencc new file mode 100644 index 0000000000..720f589bc2 --- /dev/null +++ b/third_party/python/gyp/test/rules-dirname/src/subdir/nodir.gencc @@ -0,0 +1,8 @@ +// -*- mode: c++ -*- +#include + +namespace gen { + void nodir() { + printf("no dir here\n"); + } +} diff --git a/third_party/python/gyp/test/rules-dirname/src/subdir/printvars.py b/third_party/python/gyp/test/rules-dirname/src/subdir/printvars.py new file mode 100755 index 0000000000..ef3d92e8cf --- /dev/null +++ b/third_party/python/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]); -- cgit v1.2.3