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

Unified Diff: build/protoc.gypi

Issue 2082693002: Plugin support for protobuf compiler (protoc) targets. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 months 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 | third_party/protobuf/proto_library.gni » ('j') | third_party/protobuf/proto_library.gni » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/protoc.gypi
diff --git a/build/protoc.gypi b/build/protoc.gypi
index fafdf9df7ab5c5e49a7825750f900de20d20ea7c..4e67b5b1f7135abd10eee95f3b297ce9a2b556f3 100644
--- a/build/protoc.gypi
+++ b/build/protoc.gypi
@@ -52,6 +52,7 @@
'cc_dir': '<(SHARED_INTERMEDIATE_DIR)/protoc_out/<(proto_out_dir)',
'py_dir': '<(PRODUCT_DIR)/pyproto/<(proto_out_dir)',
'cc_generator_options%': '',
+ 'cc_generator_plugin%': '',
'cc_include%': '',
'proto_in_dir%': '.',
'conditions': [
@@ -88,6 +89,7 @@
# Naively you'd use <(RULE_INPUT_PATH) here, but protoc requires
# --proto_path is a strict prefix of the path given as an argument.
'--proto-in-file','<(RULE_INPUT_ROOT)<(RULE_INPUT_EXT)',
+ '--cc-generator-plugin=<(cc_generator_plugin)',
'--use-system-protobuf=<(use_system_protobuf)',
'--',
'<(protoc)',
@@ -100,7 +102,6 @@
],
'dependencies': [
'<(DEPTH)/third_party/protobuf/protobuf.gyp:protoc#host',
- '<(DEPTH)/third_party/protobuf/protobuf.gyp:protobuf_lite',
],
'include_dirs': [
'<(SHARED_INTERMEDIATE_DIR)/protoc_out',
@@ -112,12 +113,18 @@
'<(DEPTH)',
]
},
- 'export_dependent_settings': [
- # The generated headers reference headers within protobuf_lite,
- # so dependencies must be able to find those headers too.
- '<(DEPTH)/third_party/protobuf/protobuf.gyp:protobuf_lite',
- ],
- # This target exports a hard dependency because it generates header
- # files.
+ # If using built-in cc generator the resulting headers reference headers
+ # within protobuf_lite, hence dependencies require those headers too.
+ # In case of generator plugin such issues should be resolved by invoker.
'hard_dependency': 1,
+ 'conditions': [
+ ['cc_generator_plugin==""', {
+ 'dependencies': [
+ '<(DEPTH)/third_party/protobuf/protobuf.gyp:protobuf_lite',
+ ],
+ 'export_dependent_settings': [
+ '<(DEPTH)/third_party/protobuf/protobuf.gyp:protobuf_lite',
+ ],
+ }],
+ ],
}
« no previous file with comments | « no previous file | third_party/protobuf/proto_library.gni » ('j') | third_party/protobuf/proto_library.gni » ('J')

Powered by Google App Engine
This is Rietveld 408576698