| OLD | NEW |
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 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 config("protobuf_config") { | 5 config("protobuf_config") { |
| 6 include_dirs = [ "src" ] | 6 include_dirs = [ "src" ] |
| 7 defines = [ | 7 defines = [ |
| 8 "GOOGLE_PROTOBUF_NO_RTTI", | 8 "GOOGLE_PROTOBUF_NO_RTTI", |
| 9 "GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER", | 9 "GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER", |
| 10 ] | 10 ] |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 "/wd4244", # implicit conversion, possible loss of data | 129 "/wd4244", # implicit conversion, possible loss of data |
| 130 "/wd4267", # size_t to int truncation | 130 "/wd4267", # size_t to int truncation |
| 131 "/wd4291", # no matching operator delete for a placement new. | 131 "/wd4291", # no matching operator delete for a placement new. |
| 132 "/wd4305", # double to float truncation | 132 "/wd4305", # double to float truncation |
| 133 "/wd4355", # 'this' used in base member initializer list | 133 "/wd4355", # 'this' used in base member initializer list |
| 134 "/wd4506", # no definition for inline function (protobuf issue #240) | 134 "/wd4506", # no definition for inline function (protobuf issue #240) |
| 135 "/wd4715", # not all control paths return a value (fixed in trunk) | 135 "/wd4715", # not all control paths return a value (fixed in trunk) |
| 136 ] | 136 ] |
| 137 } | 137 } |
| 138 | 138 |
| 139 # Do not allow libprotobuf_lite to be dynamically linked on Linux. Later | 139 component("protobuf_lite") { |
| 140 # versions of Ubuntu like Xenial and Yakkety link in the system | |
| 141 # libprotobuf_lite by the following dependency chain: chrome -> gtk -> | |
| 142 # libmirclient -> libmirprotobuf -> libprotobuf-lite. Trying to load | |
| 143 # the system libprotobuf-lite after already having loaded the libprotobuf_lite | |
| 144 # component will result in an immediate crash. (crbug.com/700120) | |
| 145 if (is_linux && !is_chromeos) { | |
| 146 link_target_type = "static_library" | |
| 147 } else { | |
| 148 link_target_type = "component" | |
| 149 } | |
| 150 target(link_target_type, "protobuf_lite") { | |
| 151 sources = protobuf_lite_sources | 140 sources = protobuf_lite_sources |
| 152 | 141 |
| 153 configs -= [ "//build/config/compiler:chromium_code" ] | 142 configs -= [ "//build/config/compiler:chromium_code" ] |
| 154 configs += [ | 143 configs += [ |
| 155 "//build/config/compiler:no_chromium_code", | 144 "//build/config/compiler:no_chromium_code", |
| 156 | 145 |
| 157 # Must be after no_chromium_code for warning flags to be ordered | 146 # Must be after no_chromium_code for warning flags to be ordered |
| 158 # correctly. | 147 # correctly. |
| 159 ":protobuf_warnings", | 148 ":protobuf_warnings", |
| 160 ] | 149 ] |
| 161 | 150 |
| 162 if (is_win) { | 151 if (is_win) { |
| 163 configs -= [ "//build/config/win:lean_and_mean" ] | 152 configs -= [ "//build/config/win:lean_and_mean" ] |
| 164 } | 153 } |
| 165 | 154 |
| 166 public_configs = [ | 155 public_configs = [ |
| 167 ":protobuf_config", | 156 ":protobuf_config", |
| 168 | 157 |
| 169 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. | 158 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. |
| 170 "//build/config/compiler:no_size_t_to_int_warning", | 159 "//build/config/compiler:no_size_t_to_int_warning", |
| 171 ] | 160 ] |
| 172 | 161 |
| 173 deps = [ | 162 deps = [ |
| 174 "//build/config/sanitizers:deps", | 163 "//build/config/sanitizers:deps", |
| 175 ] | 164 ] |
| 176 | 165 |
| 177 cflags = protobuf_lite_cflags | 166 cflags = protobuf_lite_cflags |
| 178 | 167 |
| 179 # Required for component builds. See http://crbug.com/172800. | 168 # Required for component builds. See http://crbug.com/172800. |
| 180 if (is_component_build && (!is_linux || is_chromeos)) { | 169 if (is_component_build) { |
| 181 public_configs += [ ":protobuf_use_dlls" ] | 170 public_configs += [ ":protobuf_use_dlls" ] |
| 182 defines = [ "LIBPROTOBUF_EXPORTS" ] | 171 defines = [ "LIBPROTOBUF_EXPORTS" ] |
| 183 } | 172 } |
| 184 } | 173 } |
| 185 | 174 |
| 186 # This is the full, heavy protobuf lib that's needed for c++ .protos that don't | 175 # This is the full, heavy protobuf lib that's needed for c++ .protos that don't |
| 187 # specify the LITE_RUNTIME option. The protocol compiler itself (protoc) falls | 176 # specify the LITE_RUNTIME option. The protocol compiler itself (protoc) falls |
| 188 # into that category. Do not use in Chrome code. | 177 # into that category. Do not use in Chrome code. |
| 189 static_library("protobuf_full") { | 178 static_library("protobuf_full") { |
| 190 # Prevent people from depending on this outside our file. | 179 # Prevent people from depending on this outside our file. |
| (...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 659 ":copy_google_protobuf_internal", | 648 ":copy_google_protobuf_internal", |
| 660 ":copy_six", | 649 ":copy_six", |
| 661 ] | 650 ] |
| 662 | 651 |
| 663 # Targets that depend on this should depend on the copied data files. | 652 # Targets that depend on this should depend on the copied data files. |
| 664 data = get_target_outputs(":copy_google") | 653 data = get_target_outputs(":copy_google") |
| 665 data += get_target_outputs(":copy_six") | 654 data += get_target_outputs(":copy_six") |
| 666 data += get_target_outputs(":copy_google_protobuf") | 655 data += get_target_outputs(":copy_google_protobuf") |
| 667 data += get_target_outputs(":copy_google_protobuf_internal") | 656 data += get_target_outputs(":copy_google_protobuf_internal") |
| 668 } | 657 } |
| OLD | NEW |