Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(999)

Unified Diff: util/util.gyp

Issue 793323003: Use GYP rules instead of actions to run mig (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: util/util.gyp
diff --git a/util/util.gyp b/util/util.gyp
index e2c4c01a38d201a12f68ce8a5bca0691a0f271e4..0264f63f72b77c0c00e8b49821e9f5978a9a4284 100644
--- a/util/util.gyp
+++ b/util/util.gyp
@@ -40,6 +40,7 @@
'mac/mac_util.h',
'mac/service_management.cc',
'mac/service_management.h',
+ 'mach/child_port.defs',
'mach/child_port_handshake.cc',
'mach/child_port_handshake.h',
'mach/child_port_server.cc',
@@ -113,58 +114,50 @@
],
'conditions': [
['OS=="mac"', {
- 'actions': [
- {
- 'action_name': 'mig child_port.defs',
- 'variables': {
- 'child_port_defs_file': 'mach/child_port.defs',
- },
- 'inputs': [
- 'mach/mig.py',
- '<(child_port_defs_file)',
- ],
- 'outputs': [
- '<(INTERMEDIATE_DIR)/util/mach/child_portUser.c',
- '<(INTERMEDIATE_DIR)/util/mach/child_portServer.c',
- '<(INTERMEDIATE_DIR)/util/mach/child_port.h',
- '<(INTERMEDIATE_DIR)/util/mach/child_portServer.h',
+ 'conditions': [
+ ['GENERATOR=="ninja"', {
+ # ninja’s rules can’t deal with sources that have paths relative
+ # to environment variables like SDKROOT. Copy the .defs files out
+ # of SDKROOT and into a place they can be referenced without any
+ # environment variables.
+ 'copies': [
+ {
+ 'destination': '<(INTERMEDIATE_DIR)/util/mach',
+ 'files': [
+ '$(SDKROOT)/usr/include/mach/exc.defs',
+ '$(SDKROOT)/usr/include/mach/mach_exc.defs',
+ ],
+ },
],
- 'action': [
- 'python', '<@(_inputs)', '<@(_outputs)'
+ 'sources': [
+ '<(INTERMEDIATE_DIR)/util/mach/exc.defs',
+ '<(INTERMEDIATE_DIR)/util/mach/mach_exc.defs',
],
- 'process_outputs_as_sources': 1,
- },
- {
- 'action_name': 'mig exc.defs',
- 'inputs': [
- 'mach/mig.py',
+ }, { # else: GENERATOR!="ninja"
+ # The Xcode generator does copies after rules, so the above trick
+ # won’t work, but its rules tolerate sources with SDKROOT-relative
+ # paths.
+ 'sources': [
'$(SDKROOT)/usr/include/mach/exc.defs',
+ '$(SDKROOT)/usr/include/mach/mach_exc.defs',
],
- 'outputs': [
- '<(INTERMEDIATE_DIR)/util/mach/excUser.c',
- '<(INTERMEDIATE_DIR)/util/mach/excServer.c',
- '<(INTERMEDIATE_DIR)/util/mach/exc.h',
- '<(INTERMEDIATE_DIR)/util/mach/excServer.h',
- ],
- 'action': [
- 'python', '<@(_inputs)', '<@(_outputs)'
- ],
- 'process_outputs_as_sources': 1,
- },
+ }],
+ ],
+ 'rules': [
{
- 'action_name': 'mig mach_exc.defs',
+ 'rule_name': 'mig',
+ 'extension': 'defs',
'inputs': [
'mach/mig.py',
- '$(SDKROOT)/usr/include/mach/mach_exc.defs',
],
'outputs': [
- '<(INTERMEDIATE_DIR)/util/mach/mach_excUser.c',
- '<(INTERMEDIATE_DIR)/util/mach/mach_excServer.c',
- '<(INTERMEDIATE_DIR)/util/mach/mach_exc.h',
- '<(INTERMEDIATE_DIR)/util/mach/mach_excServer.h',
+ '<(INTERMEDIATE_DIR)/util/mach/<(RULE_INPUT_ROOT)User.c',
+ '<(INTERMEDIATE_DIR)/util/mach/<(RULE_INPUT_ROOT)Server.c',
+ '<(INTERMEDIATE_DIR)/util/mach/<(RULE_INPUT_ROOT).h',
+ '<(INTERMEDIATE_DIR)/util/mach/<(RULE_INPUT_ROOT)Server.h',
],
'action': [
- 'python', '<@(_inputs)', '<@(_outputs)'
+ 'python', '<@(_inputs)', '<(RULE_INPUT_PATH)', '<@(_outputs)'
],
'process_outputs_as_sources': 1,
},
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698