# Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. { 'conditions': [ ['use_system_protobuf==0', { 'conditions': [ ['OS!="win"', { 'variables': { 'config_h_dir': '.', # crafted for gcc/linux. }, }, { # else, OS=="win" 'variables': { 'config_h_dir': 'vsprojects', # crafted for msvc. }, 'target_defaults': { 'msvs_disabled_warnings': [ 4018, # signed/unsigned mismatch in comparison 4244, # implicit conversion, possible loss of data 4355, # 'this' used in base member initializer list 4267, # size_t to int truncation 4291, # no matching operator delete for a placement new ], 'defines!': [ 'WIN32_LEAN_AND_MEAN', # Protobuf defines this itself. ], }, }], ['OS=="ios" and "<(GENERATOR)"!="ninja"', { 'variables': { 'ninja_output_dir': 'ninja-protoc', 'ninja_product_dir': '<(DEPTH)/xcodebuild/<(ninja_output_dir)/<(CONFIGURATION_NAME)', # Gyp to rerun 're_run_targets': [ 'third_party/protobuf/protobuf.gyp', ], }, 'targets': [ { # On iOS, generating protoc is done via two actions: (1) compiling # the executable with ninja, and (2) copying the executable into a # location that is shared with other projects. These actions are # separated into two targets in order to be able to specify that the # second action should not run until the first action finishes (since # the ordering of multiple actions in one target is defined only by # inputs and outputs, and it's impossible to set correct inputs for # the ninja build, so setting all the inputs and outputs isn't an # option). The first target is given here; the second target is the # normal protoc target under the condition that "OS==iOS". 'target_name': 'compile_protoc', 'type': 'none', 'includes': ['../../build/ios/mac_build.gypi'], 'actions': [ { 'action_name': 'compile protoc', 'inputs': [], 'outputs': [], 'action': [ '<@(ninja_cmd)', 'protoc', ], 'message': 'Generating the C++ protocol buffers compiler', }, ], }, ], }], ['OS=="android"', { 'targets': [ { 'target_name': 'protobuf_lite_javalib', 'type' : 'none', 'dependencies': [ 'protoc#host', ], 'variables': { 'script_descriptors': './protobuf_lite_java_descriptor_proto.py', 'script_pom': './protobuf_lite_java_parse_pom.py', 'protoc': '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)protoc<(EXECUTABLE_SUFFIX)', # Variables needed by java.gypi below. 'java_out_dir': '<(PRODUCT_DIR)/java_proto/protobuf_lite_java_descriptor_proto', 'generated_src_dirs': ['<(java_out_dir)'], 'java_in_dir': 'java', 'maven_pom': '<(java_in_dir)/pom.xml', 'javac_includes': [', which requires RTTI. 'GOOGLE_PROTOBUF_NO_RTTI', 'GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER', ], }, 'link_settings': { # Use full protobuf, because vanilla protobuf doesn't have # our custom patch to retain unknown fields in lite mode. 'ldflags': [ '