Primiano Tucci | ae2879e | 2017-09-27 11:02:09 +0900 | [diff] [blame] | 1 | # Copyright (C) 2017 The Android Open Source Project |
| 2 | # |
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | # you may not use this file except in compliance with the License. |
| 5 | # You may obtain a copy of the License at |
| 6 | # |
| 7 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | # |
| 9 | # Unless required by applicable law or agreed to in writing, software |
| 10 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | # See the License for the specific language governing permissions and |
| 13 | # limitations under the License. |
| 14 | |
Primiano Tucci | 7a40e4d | 2017-12-06 09:51:09 +0000 | [diff] [blame] | 15 | import("//gn/standalone/libc++/libc++.gni") |
Primiano Tucci | 0825bc8 | 2017-09-28 18:50:23 +0100 | [diff] [blame] | 16 | |
Primiano Tucci | 2a29ac7 | 2017-10-24 17:47:19 +0100 | [diff] [blame] | 17 | # Mimimal config to be used in production (i.e. non-test) targets. This is |
| 18 | # really just to allowing include "gtest/gtest_prod.h" for the FRIEND_TEST macro |
| 19 | # and avoid to pull in warning suppressions that are not really necessary for |
| 20 | # production code. |
| 21 | config("googletest_prod_config") { |
| 22 | visibility = [ ":*" ] |
| 23 | include_dirs = [ "googletest/googletest/include" ] |
| 24 | } |
| 25 | |
| 26 | # Config to include gtest.h in test targets. |
Primiano Tucci | ae2879e | 2017-09-27 11:02:09 +0900 | [diff] [blame] | 27 | config("googletest_config") { |
| 28 | visibility = [ ":*" ] |
| 29 | defines = [ "GTEST_LANG_CXX11=1" ] |
| 30 | include_dirs = [ |
| 31 | "googletest/googletest/include", |
| 32 | "googletest/googlemock/include", |
| 33 | ] |
| 34 | cflags = [ |
Primiano Tucci | 1333134 | 2017-10-25 17:08:13 +0100 | [diff] [blame] | 35 | "-Wno-covered-switch-default", |
Primiano Tucci | ae2879e | 2017-09-27 11:02:09 +0900 | [diff] [blame] | 36 | "-Wno-deprecated", |
| 37 | "-Wno-global-constructors", |
Primiano Tucci | ce72002 | 2017-10-30 12:50:06 +0000 | [diff] [blame] | 38 | "-Wno-inconsistent-missing-override", |
Primiano Tucci | ae2879e | 2017-09-27 11:02:09 +0900 | [diff] [blame] | 39 | "-Wno-missing-noreturn", |
Primiano Tucci | 91cc11d | 2017-11-14 18:34:24 +0000 | [diff] [blame] | 40 | "-Wno-overloaded-virtual", |
Primiano Tucci | ae2879e | 2017-09-27 11:02:09 +0900 | [diff] [blame] | 41 | "-Wno-shift-sign-overflow", |
Primiano Tucci | ce72002 | 2017-10-30 12:50:06 +0000 | [diff] [blame] | 42 | "-Wno-sign-conversion", |
Primiano Tucci | ae2879e | 2017-09-27 11:02:09 +0900 | [diff] [blame] | 43 | "-Wno-undef", |
Primiano Tucci | ce72002 | 2017-10-30 12:50:06 +0000 | [diff] [blame] | 44 | "-Wno-unused-member-function", |
Primiano Tucci | ae2879e | 2017-09-27 11:02:09 +0900 | [diff] [blame] | 45 | "-Wno-used-but-marked-unused", |
Primiano Tucci | fd48423 | 2017-10-25 00:15:39 +0100 | [diff] [blame] | 46 | "-Wno-zero-as-null-pointer-constant", |
Primiano Tucci | ae2879e | 2017-09-27 11:02:09 +0900 | [diff] [blame] | 47 | ] |
| 48 | } |
| 49 | |
| 50 | source_set("gtest") { |
| 51 | testonly = true |
| 52 | include_dirs = [ "googletest/googletest" ] |
Primiano Tucci | 7a40e4d | 2017-12-06 09:51:09 +0000 | [diff] [blame] | 53 | configs -= [ "//gn/standalone:extra_warnings" ] |
Primiano Tucci | ae2879e | 2017-09-27 11:02:09 +0900 | [diff] [blame] | 54 | public_configs = [ ":googletest_config" ] |
| 55 | all_dependent_configs = [ ":googletest_config" ] |
| 56 | sources = [ |
| 57 | "googletest/googletest/src/gtest-all.cc", |
| 58 | ] |
| 59 | } |
| 60 | |
| 61 | source_set("gtest_main") { |
| 62 | testonly = true |
Primiano Tucci | 7a40e4d | 2017-12-06 09:51:09 +0000 | [diff] [blame] | 63 | configs -= [ "//gn/standalone:extra_warnings" ] |
Primiano Tucci | ae2879e | 2017-09-27 11:02:09 +0900 | [diff] [blame] | 64 | configs += [ ":googletest_config" ] |
| 65 | sources = [ |
| 66 | "googletest/googletest/src/gtest_main.cc", |
| 67 | ] |
| 68 | } |
| 69 | |
| 70 | source_set("gmock") { |
| 71 | testonly = true |
| 72 | include_dirs = [ "googletest/googlemock" ] |
Primiano Tucci | 7a40e4d | 2017-12-06 09:51:09 +0000 | [diff] [blame] | 73 | configs -= [ "//gn/standalone:extra_warnings" ] |
Primiano Tucci | ae2879e | 2017-09-27 11:02:09 +0900 | [diff] [blame] | 74 | public_configs = [ ":googletest_config" ] |
| 75 | all_dependent_configs = [ ":googletest_config" ] |
| 76 | sources = [ |
| 77 | "googletest/googlemock/src/gmock-all.cc", |
| 78 | ] |
| 79 | } |
| 80 | |
Primiano Tucci | fd48423 | 2017-10-25 00:15:39 +0100 | [diff] [blame] | 81 | # This config is applied to the autogenerated .pb.{cc,h} files in |
Primiano Tucci | 7a40e4d | 2017-12-06 09:51:09 +0000 | [diff] [blame] | 82 | # //gn/standalone/proto_library.gni. This config is propagated up to the source sets |
Primiano Tucci | fd48423 | 2017-10-25 00:15:39 +0100 | [diff] [blame] | 83 | # that depend on generated proto headers. Therefore this should stay as lean and |
| 84 | # clean as possible in terms of -W-no* suppressions. Thankfully the |
| 85 | # autogenerated .pb.h headers violate less warnings than the libprotobuf_* |
| 86 | # library itself. |
| 87 | config("protobuf_gen_config") { |
Primiano Tucci | ae2879e | 2017-09-27 11:02:09 +0900 | [diff] [blame] | 88 | visibility = [ ":*" ] |
| 89 | defines = [ |
| 90 | "GOOGLE_PROTOBUF_NO_RTTI", |
| 91 | "GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER", |
Primiano Tucci | ae2879e | 2017-09-27 11:02:09 +0900 | [diff] [blame] | 92 | ] |
Primiano Tucci | fd48423 | 2017-10-25 00:15:39 +0100 | [diff] [blame] | 93 | include_dirs = [ "protobuf/src" ] |
Primiano Tucci | ae2879e | 2017-09-27 11:02:09 +0900 | [diff] [blame] | 94 | cflags = [ |
| 95 | "-Wno-deprecated", |
Primiano Tucci | fd48423 | 2017-10-25 00:15:39 +0100 | [diff] [blame] | 96 | "-Wno-disabled-macro-expansion", |
Primiano Tucci | d7d1be0 | 2017-10-30 17:41:34 +0000 | [diff] [blame] | 97 | "-Wno-int-to-void-pointer-cast", |
Primiano Tucci | fd48423 | 2017-10-25 00:15:39 +0100 | [diff] [blame] | 98 | "-Wno-missing-variable-declarations", |
| 99 | "-Wno-old-style-cast", |
Primiano Tucci | d7d1be0 | 2017-10-30 17:41:34 +0000 | [diff] [blame] | 100 | "-Wno-shorten-64-to-32", |
Primiano Tucci | d7d1be0 | 2017-10-30 17:41:34 +0000 | [diff] [blame] | 101 | "-Wno-sign-conversion", |
| 102 | "-Wno-undef", |
Primiano Tucci | fd48423 | 2017-10-25 00:15:39 +0100 | [diff] [blame] | 103 | "-Wno-zero-as-null-pointer-constant", |
| 104 | ] |
Oystein Eftevaag | 6eea322 | 2017-12-08 16:58:42 -0800 | [diff] [blame] | 105 | |
| 106 | if (!is_clang) { |
| 107 | cflags += [ |
| 108 | "-Wno-sign-compare", |
| 109 | "-Wno-maybe-uninitialized", |
| 110 | ] |
| 111 | } |
Primiano Tucci | fd48423 | 2017-10-25 00:15:39 +0100 | [diff] [blame] | 112 | } |
| 113 | |
| 114 | # Configuration used to build libprotobuf_* and the protoc compiler. |
| 115 | config("protobuf_config") { |
| 116 | # Apply the lighter supressions and macro definitions from above. |
| 117 | configs = [ ":protobuf_gen_config" ] |
| 118 | |
| 119 | visibility = [ ":*" ] |
| 120 | defines = [ "HAVE_PTHREAD=1" ] |
| 121 | cflags = [ |
| 122 | "-Wno-ignored-qualifiers", |
Primiano Tucci | ae2879e | 2017-09-27 11:02:09 +0900 | [diff] [blame] | 123 | "-Wno-missing-noreturn", |
| 124 | "-Wno-undef", |
Primiano Tucci | ae2879e | 2017-09-27 11:02:09 +0900 | [diff] [blame] | 125 | "-Wno-unused-parameter", |
| 126 | "-Wno-unused", |
Primiano Tucci | ae2879e | 2017-09-27 11:02:09 +0900 | [diff] [blame] | 127 | ] |
Hector Dearman | edb3beb | 2017-10-09 17:53:36 +0100 | [diff] [blame] | 128 | if (is_clang) { |
Primiano Tucci | ae2879e | 2017-09-27 11:02:09 +0900 | [diff] [blame] | 129 | cflags += [ |
Primiano Tucci | b60d4b0 | 2017-11-10 11:03:00 +0000 | [diff] [blame] | 130 | "-Wno-enum-compare-switch", |
Primiano Tucci | ae2879e | 2017-09-27 11:02:09 +0900 | [diff] [blame] | 131 | "-Wno-global-constructors", |
Primiano Tucci | b60d4b0 | 2017-11-10 11:03:00 +0000 | [diff] [blame] | 132 | "-Wno-shift-sign-overflow", |
| 133 | "-Wno-used-but-marked-unused", |
| 134 | "-Wno-user-defined-warnings", |
Primiano Tucci | ae2879e | 2017-09-27 11:02:09 +0900 | [diff] [blame] | 135 | ] |
Hector Dearman | edb3beb | 2017-10-09 17:53:36 +0100 | [diff] [blame] | 136 | } else { |
| 137 | cflags += [ |
| 138 | "-Wno-misleading-indentation", |
| 139 | "-Wno-return-type", |
| 140 | ] |
Primiano Tucci | ae2879e | 2017-09-27 11:02:09 +0900 | [diff] [blame] | 141 | } |
| 142 | } |
| 143 | |
| 144 | source_set("protobuf_lite") { |
| 145 | sources = [ |
| 146 | "protobuf/src/google/protobuf/arena.cc", |
| 147 | "protobuf/src/google/protobuf/arenastring.cc", |
| 148 | "protobuf/src/google/protobuf/extension_set.cc", |
| 149 | "protobuf/src/google/protobuf/generated_message_util.cc", |
| 150 | "protobuf/src/google/protobuf/io/coded_stream.cc", |
| 151 | "protobuf/src/google/protobuf/io/zero_copy_stream.cc", |
| 152 | "protobuf/src/google/protobuf/io/zero_copy_stream_impl_lite.cc", |
| 153 | "protobuf/src/google/protobuf/message_lite.cc", |
| 154 | "protobuf/src/google/protobuf/repeated_field.cc", |
| 155 | "protobuf/src/google/protobuf/stubs/atomicops_internals_x86_gcc.cc", |
| 156 | "protobuf/src/google/protobuf/stubs/atomicops_internals_x86_msvc.cc", |
| 157 | "protobuf/src/google/protobuf/stubs/bytestream.cc", |
| 158 | "protobuf/src/google/protobuf/stubs/common.cc", |
| 159 | "protobuf/src/google/protobuf/stubs/int128.cc", |
| 160 | "protobuf/src/google/protobuf/stubs/once.cc", |
| 161 | "protobuf/src/google/protobuf/stubs/status.cc", |
| 162 | "protobuf/src/google/protobuf/stubs/statusor.cc", |
| 163 | "protobuf/src/google/protobuf/stubs/stringpiece.cc", |
| 164 | "protobuf/src/google/protobuf/stubs/stringprintf.cc", |
| 165 | "protobuf/src/google/protobuf/stubs/structurally_valid.cc", |
| 166 | "protobuf/src/google/protobuf/stubs/strutil.cc", |
| 167 | "protobuf/src/google/protobuf/stubs/time.cc", |
| 168 | "protobuf/src/google/protobuf/wire_format_lite.cc", |
| 169 | ] |
Primiano Tucci | 7a40e4d | 2017-12-06 09:51:09 +0000 | [diff] [blame] | 170 | configs -= [ "//gn/standalone:extra_warnings" ] |
Primiano Tucci | ae2879e | 2017-09-27 11:02:09 +0900 | [diff] [blame] | 171 | public_configs = [ ":protobuf_config" ] |
| 172 | } |
| 173 | |
| 174 | source_set("protobuf_full") { |
Oystein Eftevaag | dd727e4 | 2017-12-05 08:49:55 -0800 | [diff] [blame] | 175 | deps = [ |
| 176 | ":protobuf_lite", |
| 177 | ] |
Primiano Tucci | ae2879e | 2017-09-27 11:02:09 +0900 | [diff] [blame] | 178 | sources = [ |
| 179 | "protobuf/src/google/protobuf/any.cc", |
| 180 | "protobuf/src/google/protobuf/any.pb.cc", |
| 181 | "protobuf/src/google/protobuf/api.pb.cc", |
| 182 | "protobuf/src/google/protobuf/compiler/importer.cc", |
| 183 | "protobuf/src/google/protobuf/compiler/parser.cc", |
| 184 | "protobuf/src/google/protobuf/descriptor.cc", |
| 185 | "protobuf/src/google/protobuf/descriptor.pb.cc", |
| 186 | "protobuf/src/google/protobuf/descriptor_database.cc", |
| 187 | "protobuf/src/google/protobuf/duration.pb.cc", |
| 188 | "protobuf/src/google/protobuf/dynamic_message.cc", |
| 189 | "protobuf/src/google/protobuf/empty.pb.cc", |
| 190 | "protobuf/src/google/protobuf/extension_set_heavy.cc", |
| 191 | "protobuf/src/google/protobuf/field_mask.pb.cc", |
| 192 | "protobuf/src/google/protobuf/generated_message_reflection.cc", |
| 193 | "protobuf/src/google/protobuf/io/gzip_stream.cc", |
| 194 | "protobuf/src/google/protobuf/io/printer.cc", |
| 195 | "protobuf/src/google/protobuf/io/strtod.cc", |
| 196 | "protobuf/src/google/protobuf/io/tokenizer.cc", |
| 197 | "protobuf/src/google/protobuf/io/zero_copy_stream_impl.cc", |
| 198 | "protobuf/src/google/protobuf/map_field.cc", |
| 199 | "protobuf/src/google/protobuf/message.cc", |
| 200 | "protobuf/src/google/protobuf/reflection_ops.cc", |
| 201 | "protobuf/src/google/protobuf/service.cc", |
| 202 | "protobuf/src/google/protobuf/source_context.pb.cc", |
| 203 | "protobuf/src/google/protobuf/struct.pb.cc", |
| 204 | "protobuf/src/google/protobuf/stubs/mathlimits.cc", |
| 205 | "protobuf/src/google/protobuf/stubs/substitute.cc", |
| 206 | "protobuf/src/google/protobuf/text_format.cc", |
| 207 | "protobuf/src/google/protobuf/timestamp.pb.cc", |
| 208 | "protobuf/src/google/protobuf/type.pb.cc", |
| 209 | "protobuf/src/google/protobuf/unknown_field_set.cc", |
| 210 | "protobuf/src/google/protobuf/util/field_comparator.cc", |
| 211 | "protobuf/src/google/protobuf/util/field_mask_util.cc", |
| 212 | "protobuf/src/google/protobuf/util/internal/datapiece.cc", |
| 213 | "protobuf/src/google/protobuf/util/internal/default_value_objectwriter.cc", |
| 214 | "protobuf/src/google/protobuf/util/internal/error_listener.cc", |
| 215 | "protobuf/src/google/protobuf/util/internal/field_mask_utility.cc", |
| 216 | "protobuf/src/google/protobuf/util/internal/json_escaping.cc", |
| 217 | "protobuf/src/google/protobuf/util/internal/json_objectwriter.cc", |
| 218 | "protobuf/src/google/protobuf/util/internal/json_stream_parser.cc", |
| 219 | "protobuf/src/google/protobuf/util/internal/object_writer.cc", |
| 220 | "protobuf/src/google/protobuf/util/internal/proto_writer.cc", |
| 221 | "protobuf/src/google/protobuf/util/internal/protostream_objectsource.cc", |
| 222 | "protobuf/src/google/protobuf/util/internal/protostream_objectwriter.cc", |
| 223 | "protobuf/src/google/protobuf/util/internal/type_info.cc", |
| 224 | "protobuf/src/google/protobuf/util/internal/type_info_test_helper.cc", |
| 225 | "protobuf/src/google/protobuf/util/internal/utility.cc", |
| 226 | "protobuf/src/google/protobuf/util/json_util.cc", |
| 227 | "protobuf/src/google/protobuf/util/message_differencer.cc", |
| 228 | "protobuf/src/google/protobuf/util/time_util.cc", |
| 229 | "protobuf/src/google/protobuf/util/type_resolver_util.cc", |
| 230 | "protobuf/src/google/protobuf/wire_format.cc", |
| 231 | "protobuf/src/google/protobuf/wrappers.pb.cc", |
| 232 | ] |
Primiano Tucci | 7a40e4d | 2017-12-06 09:51:09 +0000 | [diff] [blame] | 233 | configs -= [ "//gn/standalone:extra_warnings" ] |
Primiano Tucci | ae2879e | 2017-09-27 11:02:09 +0900 | [diff] [blame] | 234 | public_configs = [ ":protobuf_config" ] |
| 235 | } |
| 236 | |
| 237 | if (current_toolchain == host_toolchain) { |
Primiano Tucci | fd48423 | 2017-10-25 00:15:39 +0100 | [diff] [blame] | 238 | source_set("protoc_lib") { |
Oystein Eftevaag | dd727e4 | 2017-12-05 08:49:55 -0800 | [diff] [blame] | 239 | deps = [ |
| 240 | ":protobuf_full", |
| 241 | ] |
Primiano Tucci | ae2879e | 2017-09-27 11:02:09 +0900 | [diff] [blame] | 242 | sources = [ |
| 243 | "protobuf/src/google/protobuf/compiler/code_generator.cc", |
| 244 | "protobuf/src/google/protobuf/compiler/command_line_interface.cc", |
| 245 | "protobuf/src/google/protobuf/compiler/cpp/cpp_enum.cc", |
| 246 | "protobuf/src/google/protobuf/compiler/cpp/cpp_enum_field.cc", |
| 247 | "protobuf/src/google/protobuf/compiler/cpp/cpp_extension.cc", |
| 248 | "protobuf/src/google/protobuf/compiler/cpp/cpp_field.cc", |
| 249 | "protobuf/src/google/protobuf/compiler/cpp/cpp_file.cc", |
| 250 | "protobuf/src/google/protobuf/compiler/cpp/cpp_generator.cc", |
| 251 | "protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc", |
| 252 | "protobuf/src/google/protobuf/compiler/cpp/cpp_map_field.cc", |
| 253 | "protobuf/src/google/protobuf/compiler/cpp/cpp_message.cc", |
| 254 | "protobuf/src/google/protobuf/compiler/cpp/cpp_message_field.cc", |
| 255 | "protobuf/src/google/protobuf/compiler/cpp/cpp_primitive_field.cc", |
| 256 | "protobuf/src/google/protobuf/compiler/cpp/cpp_service.cc", |
| 257 | "protobuf/src/google/protobuf/compiler/cpp/cpp_string_field.cc", |
| 258 | "protobuf/src/google/protobuf/compiler/csharp/csharp_doc_comment.cc", |
| 259 | "protobuf/src/google/protobuf/compiler/csharp/csharp_enum.cc", |
| 260 | "protobuf/src/google/protobuf/compiler/csharp/csharp_enum_field.cc", |
| 261 | "protobuf/src/google/protobuf/compiler/csharp/csharp_field_base.cc", |
| 262 | "protobuf/src/google/protobuf/compiler/csharp/csharp_generator.cc", |
| 263 | "protobuf/src/google/protobuf/compiler/csharp/csharp_helpers.cc", |
| 264 | "protobuf/src/google/protobuf/compiler/csharp/csharp_map_field.cc", |
| 265 | "protobuf/src/google/protobuf/compiler/csharp/csharp_message.cc", |
| 266 | "protobuf/src/google/protobuf/compiler/csharp/csharp_message_field.cc", |
| 267 | "protobuf/src/google/protobuf/compiler/csharp/csharp_primitive_field.cc", |
| 268 | "protobuf/src/google/protobuf/compiler/csharp/csharp_reflection_class.cc", |
| 269 | "protobuf/src/google/protobuf/compiler/csharp/csharp_repeated_enum_field.cc", |
| 270 | "protobuf/src/google/protobuf/compiler/csharp/csharp_repeated_message_field.cc", |
| 271 | "protobuf/src/google/protobuf/compiler/csharp/csharp_repeated_primitive_field.cc", |
| 272 | "protobuf/src/google/protobuf/compiler/csharp/csharp_source_generator_base.cc", |
| 273 | "protobuf/src/google/protobuf/compiler/csharp/csharp_wrapper_field.cc", |
| 274 | "protobuf/src/google/protobuf/compiler/java/java_context.cc", |
| 275 | "protobuf/src/google/protobuf/compiler/java/java_doc_comment.cc", |
| 276 | "protobuf/src/google/protobuf/compiler/java/java_enum.cc", |
| 277 | "protobuf/src/google/protobuf/compiler/java/java_enum_field.cc", |
| 278 | "protobuf/src/google/protobuf/compiler/java/java_enum_field_lite.cc", |
| 279 | "protobuf/src/google/protobuf/compiler/java/java_enum_lite.cc", |
| 280 | "protobuf/src/google/protobuf/compiler/java/java_extension.cc", |
| 281 | "protobuf/src/google/protobuf/compiler/java/java_extension_lite.cc", |
| 282 | "protobuf/src/google/protobuf/compiler/java/java_field.cc", |
| 283 | "protobuf/src/google/protobuf/compiler/java/java_file.cc", |
| 284 | "protobuf/src/google/protobuf/compiler/java/java_generator.cc", |
| 285 | "protobuf/src/google/protobuf/compiler/java/java_generator_factory.cc", |
| 286 | "protobuf/src/google/protobuf/compiler/java/java_helpers.cc", |
| 287 | "protobuf/src/google/protobuf/compiler/java/java_lazy_message_field.cc", |
| 288 | "protobuf/src/google/protobuf/compiler/java/java_lazy_message_field_lite.cc", |
| 289 | "protobuf/src/google/protobuf/compiler/java/java_map_field.cc", |
| 290 | "protobuf/src/google/protobuf/compiler/java/java_map_field_lite.cc", |
| 291 | "protobuf/src/google/protobuf/compiler/java/java_message.cc", |
| 292 | "protobuf/src/google/protobuf/compiler/java/java_message_builder.cc", |
| 293 | "protobuf/src/google/protobuf/compiler/java/java_message_builder_lite.cc", |
| 294 | "protobuf/src/google/protobuf/compiler/java/java_message_field.cc", |
| 295 | "protobuf/src/google/protobuf/compiler/java/java_message_field_lite.cc", |
| 296 | "protobuf/src/google/protobuf/compiler/java/java_message_lite.cc", |
| 297 | "protobuf/src/google/protobuf/compiler/java/java_name_resolver.cc", |
| 298 | "protobuf/src/google/protobuf/compiler/java/java_primitive_field.cc", |
| 299 | "protobuf/src/google/protobuf/compiler/java/java_primitive_field_lite.cc", |
| 300 | "protobuf/src/google/protobuf/compiler/java/java_service.cc", |
| 301 | "protobuf/src/google/protobuf/compiler/java/java_shared_code_generator.cc", |
| 302 | "protobuf/src/google/protobuf/compiler/java/java_string_field.cc", |
| 303 | "protobuf/src/google/protobuf/compiler/java/java_string_field_lite.cc", |
| 304 | "protobuf/src/google/protobuf/compiler/javanano/javanano_enum.cc", |
| 305 | "protobuf/src/google/protobuf/compiler/javanano/javanano_enum_field.cc", |
| 306 | "protobuf/src/google/protobuf/compiler/javanano/javanano_extension.cc", |
| 307 | "protobuf/src/google/protobuf/compiler/javanano/javanano_field.cc", |
| 308 | "protobuf/src/google/protobuf/compiler/javanano/javanano_file.cc", |
| 309 | "protobuf/src/google/protobuf/compiler/javanano/javanano_generator.cc", |
| 310 | "protobuf/src/google/protobuf/compiler/javanano/javanano_helpers.cc", |
| 311 | "protobuf/src/google/protobuf/compiler/javanano/javanano_map_field.cc", |
| 312 | "protobuf/src/google/protobuf/compiler/javanano/javanano_message.cc", |
| 313 | "protobuf/src/google/protobuf/compiler/javanano/javanano_message_field.cc", |
| 314 | "protobuf/src/google/protobuf/compiler/javanano/javanano_primitive_field.cc", |
| 315 | "protobuf/src/google/protobuf/compiler/js/js_generator.cc", |
Primiano Tucci | ae2879e | 2017-09-27 11:02:09 +0900 | [diff] [blame] | 316 | "protobuf/src/google/protobuf/compiler/objectivec/objectivec_enum.cc", |
| 317 | "protobuf/src/google/protobuf/compiler/objectivec/objectivec_enum_field.cc", |
| 318 | "protobuf/src/google/protobuf/compiler/objectivec/objectivec_extension.cc", |
| 319 | "protobuf/src/google/protobuf/compiler/objectivec/objectivec_field.cc", |
| 320 | "protobuf/src/google/protobuf/compiler/objectivec/objectivec_file.cc", |
| 321 | "protobuf/src/google/protobuf/compiler/objectivec/objectivec_generator.cc", |
| 322 | "protobuf/src/google/protobuf/compiler/objectivec/objectivec_helpers.cc", |
| 323 | "protobuf/src/google/protobuf/compiler/objectivec/objectivec_map_field.cc", |
| 324 | "protobuf/src/google/protobuf/compiler/objectivec/objectivec_message.cc", |
| 325 | "protobuf/src/google/protobuf/compiler/objectivec/objectivec_message_field.cc", |
| 326 | "protobuf/src/google/protobuf/compiler/objectivec/objectivec_oneof.cc", |
| 327 | "protobuf/src/google/protobuf/compiler/objectivec/objectivec_primitive_field.cc", |
| 328 | "protobuf/src/google/protobuf/compiler/plugin.cc", |
| 329 | "protobuf/src/google/protobuf/compiler/plugin.pb.cc", |
| 330 | "protobuf/src/google/protobuf/compiler/python/python_generator.cc", |
| 331 | "protobuf/src/google/protobuf/compiler/ruby/ruby_generator.cc", |
| 332 | "protobuf/src/google/protobuf/compiler/subprocess.cc", |
| 333 | "protobuf/src/google/protobuf/compiler/zip_writer.cc", |
| 334 | ] |
Primiano Tucci | 7a40e4d | 2017-12-06 09:51:09 +0000 | [diff] [blame] | 335 | configs -= [ "//gn/standalone:extra_warnings" ] |
Primiano Tucci | ae2879e | 2017-09-27 11:02:09 +0900 | [diff] [blame] | 336 | public_configs = [ ":protobuf_config" ] |
| 337 | } |
Primiano Tucci | fd48423 | 2017-10-25 00:15:39 +0100 | [diff] [blame] | 338 | |
| 339 | executable("protoc") { |
Oystein Eftevaag | dd727e4 | 2017-12-05 08:49:55 -0800 | [diff] [blame] | 340 | deps = [ |
| 341 | ":protoc_lib", |
| 342 | "../gn:default_deps", |
| 343 | ] |
Primiano Tucci | fd48423 | 2017-10-25 00:15:39 +0100 | [diff] [blame] | 344 | sources = [ |
| 345 | "protobuf/src/google/protobuf/compiler/main.cc", |
| 346 | ] |
Primiano Tucci | 7a40e4d | 2017-12-06 09:51:09 +0000 | [diff] [blame] | 347 | configs -= [ "//gn/standalone:extra_warnings" ] |
Primiano Tucci | fd48423 | 2017-10-25 00:15:39 +0100 | [diff] [blame] | 348 | } |
Primiano Tucci | ae2879e | 2017-09-27 11:02:09 +0900 | [diff] [blame] | 349 | } # host_toolchain |
Primiano Tucci | 0825bc8 | 2017-09-28 18:50:23 +0100 | [diff] [blame] | 350 | |
| 351 | if (use_custom_libcxx) { |
| 352 | # Config applied to both libc++ and libc++abi targets below. |
| 353 | config("libc++config") { |
| 354 | defines = [ |
| 355 | "LIBCXX_BUILDING_LIBCXXABI", |
| 356 | "_LIBCXXABI_NO_EXCEPTIONS", |
| 357 | "_LIBCPP_OVERRIDABLE_FUNC_VIS=__attribute__((__visibility__(\"default\")))", |
| 358 | ] |
| 359 | cflags = [ |
| 360 | "-fPIC", |
| 361 | "-fstrict-aliasing", |
| 362 | ] |
| 363 | } |
| 364 | |
Primiano Tucci | 7278dea | 2017-10-31 11:50:32 +0000 | [diff] [blame] | 365 | source_set("libunwind") { |
| 366 | sources = [ |
| 367 | "libunwind/src/Unwind-EHABI.cpp", |
| 368 | "libunwind/src/Unwind-sjlj.c", |
| 369 | "libunwind/src/UnwindLevel1-gcc-ext.c", |
| 370 | "libunwind/src/UnwindLevel1.c", |
| 371 | "libunwind/src/UnwindRegistersRestore.S", |
| 372 | "libunwind/src/UnwindRegistersSave.S", |
| 373 | "libunwind/src/libunwind.cpp", |
| 374 | ] |
| 375 | include_dirs = [ "libunwind/include" ] |
| 376 | configs -= [ |
Primiano Tucci | 7a40e4d | 2017-12-06 09:51:09 +0000 | [diff] [blame] | 377 | "//gn/standalone:extra_warnings", |
| 378 | "//gn/standalone:no_exceptions", |
| 379 | "//gn/standalone:no_rtti", |
Primiano Tucci | 7278dea | 2017-10-31 11:50:32 +0000 | [diff] [blame] | 380 | |
| 381 | # When building with msan, libunwind itself triggers memory violations |
| 382 | # that causes msan to get stuck into an infinite loop. Just don't |
| 383 | # instrument libunwind itself. |
Primiano Tucci | 7a40e4d | 2017-12-06 09:51:09 +0000 | [diff] [blame] | 384 | "//gn/standalone/sanitizers:sanitizers_cflags", |
Primiano Tucci | 7278dea | 2017-10-31 11:50:32 +0000 | [diff] [blame] | 385 | ] |
| 386 | configs += [ |
| 387 | ":libc++config", |
Primiano Tucci | 7a40e4d | 2017-12-06 09:51:09 +0000 | [diff] [blame] | 388 | "//gn/standalone/sanitizers:sanitizer_options_link_helper", |
Primiano Tucci | 7278dea | 2017-10-31 11:50:32 +0000 | [diff] [blame] | 389 | ] |
| 390 | } |
| 391 | |
Primiano Tucci | 0825bc8 | 2017-09-28 18:50:23 +0100 | [diff] [blame] | 392 | source_set("libc++abi") { |
| 393 | sources = [ |
| 394 | "libcxxabi/src/abort_message.cpp", |
| 395 | "libcxxabi/src/cxa_aux_runtime.cpp", |
| 396 | "libcxxabi/src/cxa_default_handlers.cpp", |
| 397 | "libcxxabi/src/cxa_demangle.cpp", |
| 398 | "libcxxabi/src/cxa_exception.cpp", |
| 399 | "libcxxabi/src/cxa_exception_storage.cpp", |
| 400 | "libcxxabi/src/cxa_guard.cpp", |
| 401 | "libcxxabi/src/cxa_handlers.cpp", |
| 402 | "libcxxabi/src/cxa_personality.cpp", |
| 403 | "libcxxabi/src/cxa_unexpected.cpp", |
| 404 | "libcxxabi/src/cxa_vector.cpp", |
| 405 | "libcxxabi/src/cxa_virtual.cpp", |
| 406 | "libcxxabi/src/fallback_malloc.cpp", |
| 407 | "libcxxabi/src/private_typeinfo.cpp", |
| 408 | "libcxxabi/src/stdlib_exception.cpp", |
| 409 | "libcxxabi/src/stdlib_stdexcept.cpp", |
| 410 | "libcxxabi/src/stdlib_typeinfo.cpp", |
| 411 | ] |
| 412 | |
| 413 | # On linux this seems to introduce an unwanted glibc 2.18 dependency. |
| 414 | if (is_android) { |
| 415 | sources += [ "libcxxabi/src/cxa_thread_atexit.cpp" ] |
| 416 | } |
| 417 | configs -= [ |
Primiano Tucci | 7a40e4d | 2017-12-06 09:51:09 +0000 | [diff] [blame] | 418 | "//gn/standalone:extra_warnings", |
| 419 | "//gn/standalone:no_exceptions", |
| 420 | "//gn/standalone:no_rtti", |
Primiano Tucci | 5aab758 | 2017-12-07 12:22:03 +0000 | [diff] [blame] | 421 | "//gn/standalone:visibility_hidden", |
Primiano Tucci | 0825bc8 | 2017-09-28 18:50:23 +0100 | [diff] [blame] | 422 | ] |
| 423 | configs += [ |
| 424 | ":libc++config", |
Primiano Tucci | 7a40e4d | 2017-12-06 09:51:09 +0000 | [diff] [blame] | 425 | "//gn/standalone/sanitizers:sanitizer_options_link_helper", |
Primiano Tucci | 0825bc8 | 2017-09-28 18:50:23 +0100 | [diff] [blame] | 426 | ] |
Oystein Eftevaag | dd727e4 | 2017-12-05 08:49:55 -0800 | [diff] [blame] | 427 | deps = [ |
| 428 | ":libunwind", |
| 429 | ] |
Primiano Tucci | 0825bc8 | 2017-09-28 18:50:23 +0100 | [diff] [blame] | 430 | } |
| 431 | |
Primiano Tucci | 7278dea | 2017-10-31 11:50:32 +0000 | [diff] [blame] | 432 | if (custom_libcxx_is_static) { |
| 433 | libcxx_target_type = "source_set" |
| 434 | } else { |
| 435 | libcxx_target_type = "shared_library" |
| 436 | } |
| 437 | |
| 438 | target(libcxx_target_type, "libc++") { |
Primiano Tucci | 0825bc8 | 2017-09-28 18:50:23 +0100 | [diff] [blame] | 439 | sources = [ |
| 440 | "libcxx/src/algorithm.cpp", |
| 441 | "libcxx/src/any.cpp", |
| 442 | "libcxx/src/bind.cpp", |
| 443 | "libcxx/src/chrono.cpp", |
| 444 | "libcxx/src/condition_variable.cpp", |
| 445 | "libcxx/src/debug.cpp", |
| 446 | "libcxx/src/exception.cpp", |
| 447 | "libcxx/src/functional.cpp", |
| 448 | "libcxx/src/future.cpp", |
| 449 | "libcxx/src/hash.cpp", |
| 450 | "libcxx/src/ios.cpp", |
| 451 | "libcxx/src/iostream.cpp", |
| 452 | "libcxx/src/locale.cpp", |
| 453 | "libcxx/src/memory.cpp", |
| 454 | "libcxx/src/mutex.cpp", |
| 455 | "libcxx/src/new.cpp", |
| 456 | "libcxx/src/optional.cpp", |
| 457 | "libcxx/src/random.cpp", |
| 458 | "libcxx/src/regex.cpp", |
| 459 | "libcxx/src/shared_mutex.cpp", |
| 460 | "libcxx/src/stdexcept.cpp", |
| 461 | "libcxx/src/string.cpp", |
| 462 | "libcxx/src/strstream.cpp", |
| 463 | "libcxx/src/system_error.cpp", |
| 464 | "libcxx/src/thread.cpp", |
| 465 | "libcxx/src/typeinfo.cpp", |
| 466 | "libcxx/src/utility.cpp", |
| 467 | "libcxx/src/valarray.cpp", |
| 468 | "libcxx/src/variant.cpp", |
| 469 | ] |
| 470 | configs -= [ |
Primiano Tucci | 7a40e4d | 2017-12-06 09:51:09 +0000 | [diff] [blame] | 471 | "//gn/standalone:extra_warnings", |
| 472 | "//gn/standalone:no_exceptions", |
| 473 | "//gn/standalone:no_rtti", |
Primiano Tucci | 5aab758 | 2017-12-07 12:22:03 +0000 | [diff] [blame] | 474 | "//gn/standalone:visibility_hidden", |
Primiano Tucci | 0825bc8 | 2017-09-28 18:50:23 +0100 | [diff] [blame] | 475 | ] |
| 476 | configs += [ |
| 477 | ":libc++config", |
Primiano Tucci | 7a40e4d | 2017-12-06 09:51:09 +0000 | [diff] [blame] | 478 | "//gn/standalone/sanitizers:sanitizer_options_link_helper", |
Primiano Tucci | 0825bc8 | 2017-09-28 18:50:23 +0100 | [diff] [blame] | 479 | ] |
| 480 | defines = [ "_LIBCPP_BUILDING_LIBRARY" ] |
Oystein Eftevaag | dd727e4 | 2017-12-05 08:49:55 -0800 | [diff] [blame] | 481 | deps = [ |
| 482 | ":libc++abi", |
| 483 | ] |
Primiano Tucci | 0825bc8 | 2017-09-28 18:50:23 +0100 | [diff] [blame] | 484 | } |
| 485 | } # if (use_custom_libcxx) |
Hector Dearman | 88a1011 | 2017-10-12 11:07:10 +0100 | [diff] [blame] | 486 | |
| 487 | config("benchmark_config") { |
| 488 | visibility = [ ":*" ] |
Primiano Tucci | 2a29ac7 | 2017-10-24 17:47:19 +0100 | [diff] [blame] | 489 | include_dirs = [ "benchmark/include" ] |
Hector Dearman | 88a1011 | 2017-10-12 11:07:10 +0100 | [diff] [blame] | 490 | cflags = [ |
| 491 | "-Wno-global-constructors", |
| 492 | "-Wno-covered-switch-default", |
Lalit Maganti | c99d93c | 2018-03-22 15:09:30 +0000 | [diff] [blame] | 493 | "-Wno-used-but-marked-unused", |
Hector Dearman | 88a1011 | 2017-10-12 11:07:10 +0100 | [diff] [blame] | 494 | ] |
| 495 | } |
| 496 | |
| 497 | source_set("benchmark") { |
| 498 | testonly = true |
| 499 | sources = [ |
| 500 | "benchmark/include/benchmark/benchmark.h", |
| 501 | "benchmark/include/benchmark/benchmark_api.h", |
| 502 | "benchmark/include/benchmark/reporter.h", |
| 503 | "benchmark/src/arraysize.h", |
| 504 | "benchmark/src/benchmark.cc", |
| 505 | "benchmark/src/benchmark_api_internal.h", |
| 506 | "benchmark/src/benchmark_register.cc", |
| 507 | "benchmark/src/check.h", |
| 508 | "benchmark/src/colorprint.cc", |
| 509 | "benchmark/src/colorprint.h", |
| 510 | "benchmark/src/commandlineflags.cc", |
| 511 | "benchmark/src/commandlineflags.h", |
| 512 | "benchmark/src/complexity.cc", |
| 513 | "benchmark/src/complexity.h", |
| 514 | "benchmark/src/console_reporter.cc", |
| 515 | "benchmark/src/counter.cc", |
| 516 | "benchmark/src/counter.h", |
| 517 | "benchmark/src/csv_reporter.cc", |
| 518 | "benchmark/src/cycleclock.h", |
| 519 | "benchmark/src/internal_macros.h", |
| 520 | "benchmark/src/json_reporter.cc", |
| 521 | "benchmark/src/log.h", |
| 522 | "benchmark/src/mutex.h", |
| 523 | "benchmark/src/re.h", |
| 524 | "benchmark/src/reporter.cc", |
| 525 | "benchmark/src/sleep.cc", |
| 526 | "benchmark/src/sleep.h", |
Lalit Maganti | c99d93c | 2018-03-22 15:09:30 +0000 | [diff] [blame] | 527 | "benchmark/src/statistics.cc", |
| 528 | "benchmark/src/statistics.h", |
Hector Dearman | 88a1011 | 2017-10-12 11:07:10 +0100 | [diff] [blame] | 529 | "benchmark/src/string_util.cc", |
| 530 | "benchmark/src/string_util.h", |
| 531 | "benchmark/src/sysinfo.cc", |
| 532 | "benchmark/src/sysinfo.h", |
| 533 | "benchmark/src/timers.cc", |
| 534 | "benchmark/src/timers.h", |
| 535 | ] |
| 536 | defines = [ "HAVE_POSIX_REGEX" ] |
| 537 | public_configs = [ ":benchmark_config" ] |
| 538 | all_dependent_configs = [ ":benchmark_config" ] |
Primiano Tucci | 7a40e4d | 2017-12-06 09:51:09 +0000 | [diff] [blame] | 539 | configs -= [ "//gn/standalone:extra_warnings" ] |
Hector Dearman | 88a1011 | 2017-10-12 11:07:10 +0100 | [diff] [blame] | 540 | } |