OLD | NEW |
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 { | 5 { |
6 'conditions': [ | 6 'conditions': [ |
7 ['OS!="win"', { | 7 ['OS!="win"', { |
8 'variables': { | 8 'variables': { |
9 'config_h_dir': | 9 'config_h_dir': |
10 '.', # crafted for gcc/linux. | 10 '.', # crafted for gcc/linux. |
11 }, | 11 }, |
12 }, { # else, OS=="win" | 12 }, { # else, OS=="win" |
13 'variables': { | 13 'variables': { |
14 'config_h_dir': | 14 'config_h_dir': |
15 'vsprojects', # crafted for msvc. | 15 'vsprojects', # crafted for msvc. |
16 }, | 16 }, |
17 'target_defaults': { | 17 'target_defaults': { |
18 'msvs_disabled_warnings': [ | 18 'msvs_disabled_warnings': [ |
19 4018, # signed/unsigned mismatch in comparison | 19 4018, # signed/unsigned mismatch in comparison |
20 4244, # implicit conversion, possible loss of data | 20 4244, # implicit conversion, possible loss of data |
21 4355, # 'this' used in base member initializer list | 21 4355, # 'this' used in base member initializer list |
22 ], | 22 ], |
23 'defines!': [ | 23 'defines!': [ |
24 'WIN32_LEAN_AND_MEAN', # Protobuf defines this itself. | 24 'WIN32_LEAN_AND_MEAN', # Protobuf defines this itself. |
25 ], | 25 ], |
26 }, | 26 }, |
27 }] | 27 }], |
| 28 ['OS=="ios"', { |
| 29 'variables': { |
| 30 'ninja_output_dir': 'ninja-protoc', |
| 31 'ninja_product_dir': |
| 32 '<(DEPTH)/xcodebuild/<(ninja_output_dir)/<(CONFIGURATION_NAME)', |
| 33 # Gyp to rerun |
| 34 're_run_targets': [ |
| 35 'third_party/protobuf/protobuf.gyp', |
| 36 ], |
| 37 }, |
| 38 'targets': [ |
| 39 { |
| 40 # On iOS, generating protoc is done via two actions: (1) compiling |
| 41 # the executable with ninja, and (2) copying the executable into a |
| 42 # location that is shared with other projects. These actions are |
| 43 # separated into two targets in order to be able to specify that the |
| 44 # second action should not run until the first action finishes (since |
| 45 # the ordering of multiple actions in one target is defined only by |
| 46 # inputs and outputs, and it's impossible to set correct inputs for |
| 47 # the ninja build, so setting all the inputs and outputs isn't an |
| 48 # option). The first target is given here; the second target is the |
| 49 # normal protoc target under the condition that "OS==iOS". |
| 50 'target_name': 'compile_protoc', |
| 51 'type': 'none', |
| 52 'includes': ['../../build/ios/mac_build.gypi'], |
| 53 'actions': [ |
| 54 { |
| 55 'action_name': 'compile protoc', |
| 56 'inputs': [], |
| 57 'outputs': [], |
| 58 'action': [ |
| 59 '<@(ninja_cmd)', |
| 60 'protoc', |
| 61 ], |
| 62 'message': 'Generating the C++ protocol buffers compiler', |
| 63 }, |
| 64 ], |
| 65 }, |
| 66 ], |
| 67 }], |
28 ], | 68 ], |
29 'targets': [ | 69 'targets': [ |
30 # The "lite" lib is about 1/7th the size of the heavy lib, | 70 # The "lite" lib is about 1/7th the size of the heavy lib, |
31 # but it doesn't support some of the more exotic features of | 71 # but it doesn't support some of the more exotic features of |
32 # protobufs, like reflection. To generate C++ code that can link | 72 # protobufs, like reflection. To generate C++ code that can link |
33 # against the lite version of the library, add the option line: | 73 # against the lite version of the library, add the option line: |
34 # | 74 # |
35 # option optimize_for = LITE_RUNTIME; | 75 # option optimize_for = LITE_RUNTIME; |
36 # | 76 # |
37 # to your .proto file. | 77 # to your .proto file. |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
229 ], | 269 ], |
230 'dependencies': [ | 270 'dependencies': [ |
231 'protobuf_full_do_not_use', | 271 'protobuf_full_do_not_use', |
232 ], | 272 ], |
233 'include_dirs': [ | 273 'include_dirs': [ |
234 '<(config_h_dir)', | 274 '<(config_h_dir)', |
235 'src/src', | 275 'src/src', |
236 ], | 276 ], |
237 }, { # else, OS=="ios" | 277 }, { # else, OS=="ios" |
238 'type': 'none', | 278 'type': 'none', |
239 'variables': { | 279 'dependencies': [ |
240 'ninja_output_dir': 'ninja-protoc', | 280 'compile_protoc', |
241 # Gyp to rerun | 281 ], |
242 're_run_targets': [ | |
243 'third_party/protobuf/protobuf.gyp', | |
244 ], | |
245 }, | |
246 'includes': ['../../build/ios/mac_build.gypi'], | |
247 'actions': [ | 282 'actions': [ |
248 { | 283 { |
249 'action_name': 'compile protoc', | |
250 'inputs': [], | |
251 'outputs': [], | |
252 'action': [ | |
253 '<@(ninja_cmd)', | |
254 'protoc', | |
255 ], | |
256 'message': 'Generating the C++ protocol buffers compiler', | |
257 }, | |
258 { | |
259 'action_name': 'copy protoc', | 284 'action_name': 'copy protoc', |
260 'inputs': [ | 285 'inputs': [ |
261 '<(ninja_product_dir)/protoc', | 286 '<(ninja_product_dir)/protoc', |
262 ], | 287 ], |
263 'outputs': [ | 288 'outputs': [ |
264 '<(PRODUCT_DIR)/protoc', | 289 '<(PRODUCT_DIR)/protoc', |
265 ], | 290 ], |
266 'action': [ | 291 'action': [ |
267 'cp', | 292 'cp', |
268 '<(ninja_product_dir)/protoc', | 293 '<(ninja_product_dir)/protoc', |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
351 # ], | 376 # ], |
352 # 'dependencies': [ | 377 # 'dependencies': [ |
353 # 'protoc#host', | 378 # 'protoc#host', |
354 # ], | 379 # ], |
355 # 'sources': [ | 380 # 'sources': [ |
356 # 'src/google/protobuf/descriptor.proto', | 381 # 'src/google/protobuf/descriptor.proto', |
357 # ], | 382 # ], |
358 }, | 383 }, |
359 ], | 384 ], |
360 } | 385 } |
OLD | NEW |