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") |
Florian Mayer | a2fae26 | 2018-08-31 12:10:01 -0700 | [diff] [blame] | 16 | import("../gn/perfetto.gni") |
Primiano Tucci | 0825bc8 | 2017-09-28 18:50:23 +0100 | [diff] [blame] | 17 | |
Primiano Tucci | 13ae72f | 2019-06-06 10:53:02 +0100 | [diff] [blame] | 18 | # This is to make sure that we don't add accidental dependencies from build |
| 19 | # files in src/ or include/ to buildtools. All deps (outside of /gn/*) should |
| 20 | # go via the groups defined in gn/BUILD.gn, not directly into buildtools. This |
| 21 | # is to allow embedders to re-route targets to their third_party directories. |
| 22 | _buildtools_visibility = [ |
| 23 | "./*", |
| 24 | "../gn:*", |
| 25 | "../gn/standalone:*", |
| 26 | ] |
| 27 | |
Primiano Tucci | 3cbb10a | 2018-04-10 17:52:40 +0100 | [diff] [blame] | 28 | # Used to suppress warnings coming from googletest macros expansions. |
| 29 | config("test_warning_suppressions") { |
Primiano Tucci | 13ae72f | 2019-06-06 10:53:02 +0100 | [diff] [blame] | 30 | visibility = _buildtools_visibility |
Primiano Tucci | 3cbb10a | 2018-04-10 17:52:40 +0100 | [diff] [blame] | 31 | cflags = [ |
| 32 | "-Wno-unknown-warning-option", |
| 33 | "-Wno-global-constructors", |
| 34 | "-Wno-covered-switch-default", |
| 35 | "-Wno-used-but-marked-unused", |
| 36 | "-Wno-covered-switch-default", |
| 37 | "-Wno-global-constructors", |
| 38 | "-Wno-used-but-marked-unused", |
| 39 | "-Wno-inconsistent-missing-override", |
| 40 | "-Wno-unused-member-function", |
| 41 | "-Wno-zero-as-null-pointer-constant", |
| 42 | "-Wno-weak-vtables", |
| 43 | ] |
| 44 | } |
| 45 | |
Primiano Tucci | 2a29ac7 | 2017-10-24 17:47:19 +0100 | [diff] [blame] | 46 | # Mimimal config to be used in production (i.e. non-test) targets. This is |
| 47 | # really just to allowing include "gtest/gtest_prod.h" for the FRIEND_TEST macro |
| 48 | # and avoid to pull in warning suppressions that are not really necessary for |
| 49 | # production code. |
| 50 | config("googletest_prod_config") { |
Primiano Tucci | 13ae72f | 2019-06-06 10:53:02 +0100 | [diff] [blame] | 51 | visibility = _buildtools_visibility |
Primiano Tucci | 3cbb10a | 2018-04-10 17:52:40 +0100 | [diff] [blame] | 52 | cflags = [ |
| 53 | # Using -isystem instead of include_dirs (-I), so we don't need to suppress |
Florian Mayer | bda0c44 | 2018-09-07 10:53:55 +0100 | [diff] [blame] | 54 | # warnings coming from third-party headers. Doing so would mask warnings in |
Primiano Tucci | 3cbb10a | 2018-04-10 17:52:40 +0100 | [diff] [blame] | 55 | # our own code. |
| 56 | "-isystem", |
| 57 | rebase_path("googletest/googletest/include", root_build_dir), |
| 58 | ] |
Primiano Tucci | 2a29ac7 | 2017-10-24 17:47:19 +0100 | [diff] [blame] | 59 | } |
| 60 | |
Florian Mayer | 475bd7e | 2018-08-07 20:04:03 +0100 | [diff] [blame] | 61 | config("libunwindstack_config") { |
Primiano Tucci | 13ae72f | 2019-06-06 10:53:02 +0100 | [diff] [blame] | 62 | visibility = _buildtools_visibility |
Florian Mayer | 475bd7e | 2018-08-07 20:04:03 +0100 | [diff] [blame] | 63 | cflags = [ |
| 64 | # Using -isystem instead of include_dirs (-I), so we don't need to suppress |
Florian Mayer | f833566 | 2018-08-08 11:30:32 +0100 | [diff] [blame] | 65 | # warnings coming from libunwindstack headers. Doing so would mask warnings |
| 66 | # in our own code. |
Florian Mayer | 475bd7e | 2018-08-07 20:04:03 +0100 | [diff] [blame] | 67 | "-isystem", |
Florian Mayer | f833566 | 2018-08-08 11:30:32 +0100 | [diff] [blame] | 68 | rebase_path("android-core/libunwindstack/include", root_build_dir), |
Florian Mayer | b64d6b1 | 2018-08-30 10:46:30 -0700 | [diff] [blame] | 69 | "-isystem", |
| 70 | rebase_path("android-core/libprocinfo/include", root_build_dir), |
| 71 | "-isystem", |
| 72 | rebase_path("android-core/base/include", root_build_dir), |
Florian Mayer | 6140f32 | 2019-01-21 15:10:17 +0000 | [diff] [blame] | 73 | "-isystem", |
| 74 | rebase_path("android-core/demangle/include", root_build_dir), |
Florian Mayer | 475bd7e | 2018-08-07 20:04:03 +0100 | [diff] [blame] | 75 | ] |
Florian Mayer | b64d6b1 | 2018-08-30 10:46:30 -0700 | [diff] [blame] | 76 | if (is_android) { |
| 77 | cflags += [ |
| 78 | "-isystem", |
| 79 | rebase_path("bionic/libc/include", root_build_dir), |
| 80 | ] |
| 81 | } |
Florian Mayer | 12adafd | 2019-03-14 21:58:00 -0700 | [diff] [blame] | 82 | defines = [ "NO_LIBDEXFILE_SUPPORT" ] |
Florian Mayer | 475bd7e | 2018-08-07 20:04:03 +0100 | [diff] [blame] | 83 | } |
| 84 | |
Primiano Tucci | 2a29ac7 | 2017-10-24 17:47:19 +0100 | [diff] [blame] | 85 | # Config to include gtest.h in test targets. |
Primiano Tucci | ae2879e | 2017-09-27 11:02:09 +0900 | [diff] [blame] | 86 | config("googletest_config") { |
Primiano Tucci | 13ae72f | 2019-06-06 10:53:02 +0100 | [diff] [blame] | 87 | visibility = _buildtools_visibility |
Primiano Tucci | ae2879e | 2017-09-27 11:02:09 +0900 | [diff] [blame] | 88 | defines = [ "GTEST_LANG_CXX11=1" ] |
Primiano Tucci | ae2879e | 2017-09-27 11:02:09 +0900 | [diff] [blame] | 89 | cflags = [ |
Primiano Tucci | 3cbb10a | 2018-04-10 17:52:40 +0100 | [diff] [blame] | 90 | # Using -isystem instead of include_dirs (-I), so we don't need to suppress |
Florian Mayer | bda0c44 | 2018-09-07 10:53:55 +0100 | [diff] [blame] | 91 | # warnings coming from third-party headers. Doing so would mask warnings in |
Primiano Tucci | 3cbb10a | 2018-04-10 17:52:40 +0100 | [diff] [blame] | 92 | # our own code. |
| 93 | "-isystem", |
| 94 | rebase_path("googletest/googletest/include", root_build_dir), |
| 95 | "-isystem", |
| 96 | rebase_path("googletest/googlemock/include", root_build_dir), |
Primiano Tucci | ae2879e | 2017-09-27 11:02:09 +0900 | [diff] [blame] | 97 | ] |
Primiano Tucci | 3cbb10a | 2018-04-10 17:52:40 +0100 | [diff] [blame] | 98 | configs = [ ":test_warning_suppressions" ] |
Primiano Tucci | ae2879e | 2017-09-27 11:02:09 +0900 | [diff] [blame] | 99 | } |
| 100 | |
| 101 | source_set("gtest") { |
Primiano Tucci | 13ae72f | 2019-06-06 10:53:02 +0100 | [diff] [blame] | 102 | visibility = _buildtools_visibility |
Primiano Tucci | ae2879e | 2017-09-27 11:02:09 +0900 | [diff] [blame] | 103 | testonly = true |
| 104 | include_dirs = [ "googletest/googletest" ] |
Primiano Tucci | 7a40e4d | 2017-12-06 09:51:09 +0000 | [diff] [blame] | 105 | configs -= [ "//gn/standalone:extra_warnings" ] |
Primiano Tucci | ae2879e | 2017-09-27 11:02:09 +0900 | [diff] [blame] | 106 | public_configs = [ ":googletest_config" ] |
| 107 | all_dependent_configs = [ ":googletest_config" ] |
| 108 | sources = [ |
| 109 | "googletest/googletest/src/gtest-all.cc", |
| 110 | ] |
| 111 | } |
| 112 | |
| 113 | source_set("gtest_main") { |
Primiano Tucci | 13ae72f | 2019-06-06 10:53:02 +0100 | [diff] [blame] | 114 | visibility = _buildtools_visibility |
Primiano Tucci | ae2879e | 2017-09-27 11:02:09 +0900 | [diff] [blame] | 115 | testonly = true |
Primiano Tucci | 7a40e4d | 2017-12-06 09:51:09 +0000 | [diff] [blame] | 116 | configs -= [ "//gn/standalone:extra_warnings" ] |
Primiano Tucci | ae2879e | 2017-09-27 11:02:09 +0900 | [diff] [blame] | 117 | configs += [ ":googletest_config" ] |
| 118 | sources = [ |
| 119 | "googletest/googletest/src/gtest_main.cc", |
| 120 | ] |
| 121 | } |
| 122 | |
| 123 | source_set("gmock") { |
Primiano Tucci | 13ae72f | 2019-06-06 10:53:02 +0100 | [diff] [blame] | 124 | visibility = _buildtools_visibility |
Primiano Tucci | ae2879e | 2017-09-27 11:02:09 +0900 | [diff] [blame] | 125 | testonly = true |
| 126 | include_dirs = [ "googletest/googlemock" ] |
Primiano Tucci | 7a40e4d | 2017-12-06 09:51:09 +0000 | [diff] [blame] | 127 | configs -= [ "//gn/standalone:extra_warnings" ] |
Primiano Tucci | ae2879e | 2017-09-27 11:02:09 +0900 | [diff] [blame] | 128 | public_configs = [ ":googletest_config" ] |
| 129 | all_dependent_configs = [ ":googletest_config" ] |
| 130 | sources = [ |
| 131 | "googletest/googlemock/src/gmock-all.cc", |
| 132 | ] |
| 133 | } |
| 134 | |
Primiano Tucci | fd48423 | 2017-10-25 00:15:39 +0100 | [diff] [blame] | 135 | # This config is applied to the autogenerated .pb.{cc,h} files in |
Primiano Tucci | 7a40e4d | 2017-12-06 09:51:09 +0000 | [diff] [blame] | 136 | # //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] | 137 | # that depend on generated proto headers. Therefore this should stay as lean and |
| 138 | # clean as possible in terms of -W-no* suppressions. Thankfully the |
| 139 | # autogenerated .pb.h headers violate less warnings than the libprotobuf_* |
| 140 | # library itself. |
| 141 | config("protobuf_gen_config") { |
Primiano Tucci | 13ae72f | 2019-06-06 10:53:02 +0100 | [diff] [blame] | 142 | visibility = [ "*" ] # This is injected by standalone/proto_library.gni |
Primiano Tucci | ae2879e | 2017-09-27 11:02:09 +0900 | [diff] [blame] | 143 | defines = [ |
| 144 | "GOOGLE_PROTOBUF_NO_RTTI", |
| 145 | "GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER", |
Primiano Tucci | ae2879e | 2017-09-27 11:02:09 +0900 | [diff] [blame] | 146 | ] |
Primiano Tucci | ae2879e | 2017-09-27 11:02:09 +0900 | [diff] [blame] | 147 | cflags = [ |
Primiano Tucci | 3cbb10a | 2018-04-10 17:52:40 +0100 | [diff] [blame] | 148 | # Using -isystem instead of include_dirs (-I), so we don't need to suppress |
| 149 | # warnings coming from libprotobuf headers. Doing so would mask warnings in |
| 150 | # our own code. |
| 151 | "-isystem", |
| 152 | rebase_path("protobuf/src", root_build_dir), |
| 153 | "-Wno-unknown-warning-option", |
Primiano Tucci | ae2879e | 2017-09-27 11:02:09 +0900 | [diff] [blame] | 154 | "-Wno-deprecated", |
Primiano Tucci | d7d1be0 | 2017-10-30 17:41:34 +0000 | [diff] [blame] | 155 | "-Wno-undef", |
Primiano Tucci | fd48423 | 2017-10-25 00:15:39 +0100 | [diff] [blame] | 156 | "-Wno-zero-as-null-pointer-constant", |
| 157 | ] |
Primiano Tucci | fd48423 | 2017-10-25 00:15:39 +0100 | [diff] [blame] | 158 | } |
| 159 | |
| 160 | # Configuration used to build libprotobuf_* and the protoc compiler. |
| 161 | config("protobuf_config") { |
Primiano Tucci | 13ae72f | 2019-06-06 10:53:02 +0100 | [diff] [blame] | 162 | visibility = _buildtools_visibility |
| 163 | |
Primiano Tucci | fd48423 | 2017-10-25 00:15:39 +0100 | [diff] [blame] | 164 | # Apply the lighter supressions and macro definitions from above. |
| 165 | configs = [ ":protobuf_gen_config" ] |
| 166 | |
Primiano Tucci | fd48423 | 2017-10-25 00:15:39 +0100 | [diff] [blame] | 167 | defines = [ "HAVE_PTHREAD=1" ] |
Hector Dearman | edb3beb | 2017-10-09 17:53:36 +0100 | [diff] [blame] | 168 | if (is_clang) { |
Primiano Tucci | 3cbb10a | 2018-04-10 17:52:40 +0100 | [diff] [blame] | 169 | cflags = [ |
| 170 | "-Wno-unknown-warning-option", |
Primiano Tucci | b60d4b0 | 2017-11-10 11:03:00 +0000 | [diff] [blame] | 171 | "-Wno-enum-compare-switch", |
Primiano Tucci | b60d4b0 | 2017-11-10 11:03:00 +0000 | [diff] [blame] | 172 | "-Wno-user-defined-warnings", |
Florian Mayer | aa5316b | 2018-08-20 17:45:12 -0700 | [diff] [blame] | 173 | "-Wno-tautological-constant-compare", |
Primiano Tucci | ae2879e | 2017-09-27 11:02:09 +0900 | [diff] [blame] | 174 | ] |
| 175 | } |
| 176 | } |
| 177 | |
| 178 | source_set("protobuf_lite") { |
Primiano Tucci | 13ae72f | 2019-06-06 10:53:02 +0100 | [diff] [blame] | 179 | visibility = _buildtools_visibility |
Primiano Tucci | ae2879e | 2017-09-27 11:02:09 +0900 | [diff] [blame] | 180 | sources = [ |
| 181 | "protobuf/src/google/protobuf/arena.cc", |
| 182 | "protobuf/src/google/protobuf/arenastring.cc", |
| 183 | "protobuf/src/google/protobuf/extension_set.cc", |
| 184 | "protobuf/src/google/protobuf/generated_message_util.cc", |
| 185 | "protobuf/src/google/protobuf/io/coded_stream.cc", |
| 186 | "protobuf/src/google/protobuf/io/zero_copy_stream.cc", |
| 187 | "protobuf/src/google/protobuf/io/zero_copy_stream_impl_lite.cc", |
| 188 | "protobuf/src/google/protobuf/message_lite.cc", |
| 189 | "protobuf/src/google/protobuf/repeated_field.cc", |
| 190 | "protobuf/src/google/protobuf/stubs/atomicops_internals_x86_gcc.cc", |
| 191 | "protobuf/src/google/protobuf/stubs/atomicops_internals_x86_msvc.cc", |
| 192 | "protobuf/src/google/protobuf/stubs/bytestream.cc", |
| 193 | "protobuf/src/google/protobuf/stubs/common.cc", |
| 194 | "protobuf/src/google/protobuf/stubs/int128.cc", |
| 195 | "protobuf/src/google/protobuf/stubs/once.cc", |
| 196 | "protobuf/src/google/protobuf/stubs/status.cc", |
| 197 | "protobuf/src/google/protobuf/stubs/statusor.cc", |
| 198 | "protobuf/src/google/protobuf/stubs/stringpiece.cc", |
| 199 | "protobuf/src/google/protobuf/stubs/stringprintf.cc", |
| 200 | "protobuf/src/google/protobuf/stubs/structurally_valid.cc", |
| 201 | "protobuf/src/google/protobuf/stubs/strutil.cc", |
| 202 | "protobuf/src/google/protobuf/stubs/time.cc", |
| 203 | "protobuf/src/google/protobuf/wire_format_lite.cc", |
| 204 | ] |
Primiano Tucci | 7a40e4d | 2017-12-06 09:51:09 +0000 | [diff] [blame] | 205 | configs -= [ "//gn/standalone:extra_warnings" ] |
Primiano Tucci | 3cbb10a | 2018-04-10 17:52:40 +0100 | [diff] [blame] | 206 | configs += [ ":protobuf_config" ] |
| 207 | public_configs = [ ":protobuf_gen_config" ] |
Primiano Tucci | ae2879e | 2017-09-27 11:02:09 +0900 | [diff] [blame] | 208 | } |
| 209 | |
| 210 | source_set("protobuf_full") { |
Primiano Tucci | 13ae72f | 2019-06-06 10:53:02 +0100 | [diff] [blame] | 211 | visibility = _buildtools_visibility |
Oystein Eftevaag | dd727e4 | 2017-12-05 08:49:55 -0800 | [diff] [blame] | 212 | deps = [ |
| 213 | ":protobuf_lite", |
| 214 | ] |
Primiano Tucci | ae2879e | 2017-09-27 11:02:09 +0900 | [diff] [blame] | 215 | sources = [ |
| 216 | "protobuf/src/google/protobuf/any.cc", |
| 217 | "protobuf/src/google/protobuf/any.pb.cc", |
| 218 | "protobuf/src/google/protobuf/api.pb.cc", |
| 219 | "protobuf/src/google/protobuf/compiler/importer.cc", |
| 220 | "protobuf/src/google/protobuf/compiler/parser.cc", |
| 221 | "protobuf/src/google/protobuf/descriptor.cc", |
| 222 | "protobuf/src/google/protobuf/descriptor.pb.cc", |
| 223 | "protobuf/src/google/protobuf/descriptor_database.cc", |
| 224 | "protobuf/src/google/protobuf/duration.pb.cc", |
| 225 | "protobuf/src/google/protobuf/dynamic_message.cc", |
| 226 | "protobuf/src/google/protobuf/empty.pb.cc", |
| 227 | "protobuf/src/google/protobuf/extension_set_heavy.cc", |
| 228 | "protobuf/src/google/protobuf/field_mask.pb.cc", |
| 229 | "protobuf/src/google/protobuf/generated_message_reflection.cc", |
| 230 | "protobuf/src/google/protobuf/io/gzip_stream.cc", |
| 231 | "protobuf/src/google/protobuf/io/printer.cc", |
| 232 | "protobuf/src/google/protobuf/io/strtod.cc", |
| 233 | "protobuf/src/google/protobuf/io/tokenizer.cc", |
| 234 | "protobuf/src/google/protobuf/io/zero_copy_stream_impl.cc", |
| 235 | "protobuf/src/google/protobuf/map_field.cc", |
| 236 | "protobuf/src/google/protobuf/message.cc", |
| 237 | "protobuf/src/google/protobuf/reflection_ops.cc", |
| 238 | "protobuf/src/google/protobuf/service.cc", |
| 239 | "protobuf/src/google/protobuf/source_context.pb.cc", |
| 240 | "protobuf/src/google/protobuf/struct.pb.cc", |
| 241 | "protobuf/src/google/protobuf/stubs/mathlimits.cc", |
| 242 | "protobuf/src/google/protobuf/stubs/substitute.cc", |
| 243 | "protobuf/src/google/protobuf/text_format.cc", |
| 244 | "protobuf/src/google/protobuf/timestamp.pb.cc", |
| 245 | "protobuf/src/google/protobuf/type.pb.cc", |
| 246 | "protobuf/src/google/protobuf/unknown_field_set.cc", |
| 247 | "protobuf/src/google/protobuf/util/field_comparator.cc", |
| 248 | "protobuf/src/google/protobuf/util/field_mask_util.cc", |
| 249 | "protobuf/src/google/protobuf/util/internal/datapiece.cc", |
| 250 | "protobuf/src/google/protobuf/util/internal/default_value_objectwriter.cc", |
| 251 | "protobuf/src/google/protobuf/util/internal/error_listener.cc", |
| 252 | "protobuf/src/google/protobuf/util/internal/field_mask_utility.cc", |
| 253 | "protobuf/src/google/protobuf/util/internal/json_escaping.cc", |
| 254 | "protobuf/src/google/protobuf/util/internal/json_objectwriter.cc", |
| 255 | "protobuf/src/google/protobuf/util/internal/json_stream_parser.cc", |
| 256 | "protobuf/src/google/protobuf/util/internal/object_writer.cc", |
| 257 | "protobuf/src/google/protobuf/util/internal/proto_writer.cc", |
| 258 | "protobuf/src/google/protobuf/util/internal/protostream_objectsource.cc", |
| 259 | "protobuf/src/google/protobuf/util/internal/protostream_objectwriter.cc", |
| 260 | "protobuf/src/google/protobuf/util/internal/type_info.cc", |
| 261 | "protobuf/src/google/protobuf/util/internal/type_info_test_helper.cc", |
| 262 | "protobuf/src/google/protobuf/util/internal/utility.cc", |
| 263 | "protobuf/src/google/protobuf/util/json_util.cc", |
| 264 | "protobuf/src/google/protobuf/util/message_differencer.cc", |
| 265 | "protobuf/src/google/protobuf/util/time_util.cc", |
| 266 | "protobuf/src/google/protobuf/util/type_resolver_util.cc", |
| 267 | "protobuf/src/google/protobuf/wire_format.cc", |
| 268 | "protobuf/src/google/protobuf/wrappers.pb.cc", |
| 269 | ] |
Primiano Tucci | 7a40e4d | 2017-12-06 09:51:09 +0000 | [diff] [blame] | 270 | configs -= [ "//gn/standalone:extra_warnings" ] |
Primiano Tucci | 3cbb10a | 2018-04-10 17:52:40 +0100 | [diff] [blame] | 271 | configs += [ ":protobuf_config" ] |
| 272 | public_configs = [ ":protobuf_gen_config" ] |
Primiano Tucci | ae2879e | 2017-09-27 11:02:09 +0900 | [diff] [blame] | 273 | } |
| 274 | |
| 275 | if (current_toolchain == host_toolchain) { |
Primiano Tucci | fd48423 | 2017-10-25 00:15:39 +0100 | [diff] [blame] | 276 | source_set("protoc_lib") { |
Primiano Tucci | 13ae72f | 2019-06-06 10:53:02 +0100 | [diff] [blame] | 277 | visibility = _buildtools_visibility |
Oystein Eftevaag | dd727e4 | 2017-12-05 08:49:55 -0800 | [diff] [blame] | 278 | deps = [ |
| 279 | ":protobuf_full", |
| 280 | ] |
Primiano Tucci | ae2879e | 2017-09-27 11:02:09 +0900 | [diff] [blame] | 281 | sources = [ |
| 282 | "protobuf/src/google/protobuf/compiler/code_generator.cc", |
| 283 | "protobuf/src/google/protobuf/compiler/command_line_interface.cc", |
| 284 | "protobuf/src/google/protobuf/compiler/cpp/cpp_enum.cc", |
| 285 | "protobuf/src/google/protobuf/compiler/cpp/cpp_enum_field.cc", |
| 286 | "protobuf/src/google/protobuf/compiler/cpp/cpp_extension.cc", |
| 287 | "protobuf/src/google/protobuf/compiler/cpp/cpp_field.cc", |
| 288 | "protobuf/src/google/protobuf/compiler/cpp/cpp_file.cc", |
| 289 | "protobuf/src/google/protobuf/compiler/cpp/cpp_generator.cc", |
| 290 | "protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc", |
| 291 | "protobuf/src/google/protobuf/compiler/cpp/cpp_map_field.cc", |
| 292 | "protobuf/src/google/protobuf/compiler/cpp/cpp_message.cc", |
| 293 | "protobuf/src/google/protobuf/compiler/cpp/cpp_message_field.cc", |
| 294 | "protobuf/src/google/protobuf/compiler/cpp/cpp_primitive_field.cc", |
| 295 | "protobuf/src/google/protobuf/compiler/cpp/cpp_service.cc", |
| 296 | "protobuf/src/google/protobuf/compiler/cpp/cpp_string_field.cc", |
| 297 | "protobuf/src/google/protobuf/compiler/csharp/csharp_doc_comment.cc", |
| 298 | "protobuf/src/google/protobuf/compiler/csharp/csharp_enum.cc", |
| 299 | "protobuf/src/google/protobuf/compiler/csharp/csharp_enum_field.cc", |
| 300 | "protobuf/src/google/protobuf/compiler/csharp/csharp_field_base.cc", |
| 301 | "protobuf/src/google/protobuf/compiler/csharp/csharp_generator.cc", |
| 302 | "protobuf/src/google/protobuf/compiler/csharp/csharp_helpers.cc", |
| 303 | "protobuf/src/google/protobuf/compiler/csharp/csharp_map_field.cc", |
| 304 | "protobuf/src/google/protobuf/compiler/csharp/csharp_message.cc", |
| 305 | "protobuf/src/google/protobuf/compiler/csharp/csharp_message_field.cc", |
| 306 | "protobuf/src/google/protobuf/compiler/csharp/csharp_primitive_field.cc", |
| 307 | "protobuf/src/google/protobuf/compiler/csharp/csharp_reflection_class.cc", |
| 308 | "protobuf/src/google/protobuf/compiler/csharp/csharp_repeated_enum_field.cc", |
| 309 | "protobuf/src/google/protobuf/compiler/csharp/csharp_repeated_message_field.cc", |
| 310 | "protobuf/src/google/protobuf/compiler/csharp/csharp_repeated_primitive_field.cc", |
| 311 | "protobuf/src/google/protobuf/compiler/csharp/csharp_source_generator_base.cc", |
| 312 | "protobuf/src/google/protobuf/compiler/csharp/csharp_wrapper_field.cc", |
| 313 | "protobuf/src/google/protobuf/compiler/java/java_context.cc", |
| 314 | "protobuf/src/google/protobuf/compiler/java/java_doc_comment.cc", |
| 315 | "protobuf/src/google/protobuf/compiler/java/java_enum.cc", |
| 316 | "protobuf/src/google/protobuf/compiler/java/java_enum_field.cc", |
| 317 | "protobuf/src/google/protobuf/compiler/java/java_enum_field_lite.cc", |
| 318 | "protobuf/src/google/protobuf/compiler/java/java_enum_lite.cc", |
| 319 | "protobuf/src/google/protobuf/compiler/java/java_extension.cc", |
| 320 | "protobuf/src/google/protobuf/compiler/java/java_extension_lite.cc", |
| 321 | "protobuf/src/google/protobuf/compiler/java/java_field.cc", |
| 322 | "protobuf/src/google/protobuf/compiler/java/java_file.cc", |
| 323 | "protobuf/src/google/protobuf/compiler/java/java_generator.cc", |
| 324 | "protobuf/src/google/protobuf/compiler/java/java_generator_factory.cc", |
| 325 | "protobuf/src/google/protobuf/compiler/java/java_helpers.cc", |
| 326 | "protobuf/src/google/protobuf/compiler/java/java_lazy_message_field.cc", |
| 327 | "protobuf/src/google/protobuf/compiler/java/java_lazy_message_field_lite.cc", |
| 328 | "protobuf/src/google/protobuf/compiler/java/java_map_field.cc", |
| 329 | "protobuf/src/google/protobuf/compiler/java/java_map_field_lite.cc", |
| 330 | "protobuf/src/google/protobuf/compiler/java/java_message.cc", |
| 331 | "protobuf/src/google/protobuf/compiler/java/java_message_builder.cc", |
| 332 | "protobuf/src/google/protobuf/compiler/java/java_message_builder_lite.cc", |
| 333 | "protobuf/src/google/protobuf/compiler/java/java_message_field.cc", |
| 334 | "protobuf/src/google/protobuf/compiler/java/java_message_field_lite.cc", |
| 335 | "protobuf/src/google/protobuf/compiler/java/java_message_lite.cc", |
| 336 | "protobuf/src/google/protobuf/compiler/java/java_name_resolver.cc", |
| 337 | "protobuf/src/google/protobuf/compiler/java/java_primitive_field.cc", |
| 338 | "protobuf/src/google/protobuf/compiler/java/java_primitive_field_lite.cc", |
| 339 | "protobuf/src/google/protobuf/compiler/java/java_service.cc", |
| 340 | "protobuf/src/google/protobuf/compiler/java/java_shared_code_generator.cc", |
| 341 | "protobuf/src/google/protobuf/compiler/java/java_string_field.cc", |
| 342 | "protobuf/src/google/protobuf/compiler/java/java_string_field_lite.cc", |
| 343 | "protobuf/src/google/protobuf/compiler/javanano/javanano_enum.cc", |
| 344 | "protobuf/src/google/protobuf/compiler/javanano/javanano_enum_field.cc", |
| 345 | "protobuf/src/google/protobuf/compiler/javanano/javanano_extension.cc", |
| 346 | "protobuf/src/google/protobuf/compiler/javanano/javanano_field.cc", |
| 347 | "protobuf/src/google/protobuf/compiler/javanano/javanano_file.cc", |
| 348 | "protobuf/src/google/protobuf/compiler/javanano/javanano_generator.cc", |
| 349 | "protobuf/src/google/protobuf/compiler/javanano/javanano_helpers.cc", |
| 350 | "protobuf/src/google/protobuf/compiler/javanano/javanano_map_field.cc", |
| 351 | "protobuf/src/google/protobuf/compiler/javanano/javanano_message.cc", |
| 352 | "protobuf/src/google/protobuf/compiler/javanano/javanano_message_field.cc", |
| 353 | "protobuf/src/google/protobuf/compiler/javanano/javanano_primitive_field.cc", |
| 354 | "protobuf/src/google/protobuf/compiler/js/js_generator.cc", |
Primiano Tucci | ae2879e | 2017-09-27 11:02:09 +0900 | [diff] [blame] | 355 | "protobuf/src/google/protobuf/compiler/objectivec/objectivec_enum.cc", |
| 356 | "protobuf/src/google/protobuf/compiler/objectivec/objectivec_enum_field.cc", |
| 357 | "protobuf/src/google/protobuf/compiler/objectivec/objectivec_extension.cc", |
| 358 | "protobuf/src/google/protobuf/compiler/objectivec/objectivec_field.cc", |
| 359 | "protobuf/src/google/protobuf/compiler/objectivec/objectivec_file.cc", |
| 360 | "protobuf/src/google/protobuf/compiler/objectivec/objectivec_generator.cc", |
| 361 | "protobuf/src/google/protobuf/compiler/objectivec/objectivec_helpers.cc", |
| 362 | "protobuf/src/google/protobuf/compiler/objectivec/objectivec_map_field.cc", |
| 363 | "protobuf/src/google/protobuf/compiler/objectivec/objectivec_message.cc", |
| 364 | "protobuf/src/google/protobuf/compiler/objectivec/objectivec_message_field.cc", |
| 365 | "protobuf/src/google/protobuf/compiler/objectivec/objectivec_oneof.cc", |
| 366 | "protobuf/src/google/protobuf/compiler/objectivec/objectivec_primitive_field.cc", |
| 367 | "protobuf/src/google/protobuf/compiler/plugin.cc", |
| 368 | "protobuf/src/google/protobuf/compiler/plugin.pb.cc", |
| 369 | "protobuf/src/google/protobuf/compiler/python/python_generator.cc", |
| 370 | "protobuf/src/google/protobuf/compiler/ruby/ruby_generator.cc", |
| 371 | "protobuf/src/google/protobuf/compiler/subprocess.cc", |
| 372 | "protobuf/src/google/protobuf/compiler/zip_writer.cc", |
| 373 | ] |
Primiano Tucci | 7a40e4d | 2017-12-06 09:51:09 +0000 | [diff] [blame] | 374 | configs -= [ "//gn/standalone:extra_warnings" ] |
Primiano Tucci | 3cbb10a | 2018-04-10 17:52:40 +0100 | [diff] [blame] | 375 | configs += [ ":protobuf_config" ] |
| 376 | public_configs = [ ":protobuf_gen_config" ] |
Primiano Tucci | ae2879e | 2017-09-27 11:02:09 +0900 | [diff] [blame] | 377 | } |
Primiano Tucci | fd48423 | 2017-10-25 00:15:39 +0100 | [diff] [blame] | 378 | |
| 379 | executable("protoc") { |
Primiano Tucci | 13ae72f | 2019-06-06 10:53:02 +0100 | [diff] [blame] | 380 | visibility = _buildtools_visibility |
Oystein Eftevaag | dd727e4 | 2017-12-05 08:49:55 -0800 | [diff] [blame] | 381 | deps = [ |
| 382 | ":protoc_lib", |
Primiano Tucci | 3cbb10a | 2018-04-10 17:52:40 +0100 | [diff] [blame] | 383 | "//gn:default_deps", |
Oystein Eftevaag | dd727e4 | 2017-12-05 08:49:55 -0800 | [diff] [blame] | 384 | ] |
Primiano Tucci | fd48423 | 2017-10-25 00:15:39 +0100 | [diff] [blame] | 385 | sources = [ |
| 386 | "protobuf/src/google/protobuf/compiler/main.cc", |
| 387 | ] |
Primiano Tucci | 7a40e4d | 2017-12-06 09:51:09 +0000 | [diff] [blame] | 388 | configs -= [ "//gn/standalone:extra_warnings" ] |
Primiano Tucci | fd48423 | 2017-10-25 00:15:39 +0100 | [diff] [blame] | 389 | } |
Primiano Tucci | ae2879e | 2017-09-27 11:02:09 +0900 | [diff] [blame] | 390 | } # host_toolchain |
Primiano Tucci | 0825bc8 | 2017-09-28 18:50:23 +0100 | [diff] [blame] | 391 | |
| 392 | if (use_custom_libcxx) { |
| 393 | # Config applied to both libc++ and libc++abi targets below. |
| 394 | config("libc++config") { |
Primiano Tucci | 13ae72f | 2019-06-06 10:53:02 +0100 | [diff] [blame] | 395 | visibility = _buildtools_visibility |
Primiano Tucci | 0825bc8 | 2017-09-28 18:50:23 +0100 | [diff] [blame] | 396 | defines = [ |
| 397 | "LIBCXX_BUILDING_LIBCXXABI", |
| 398 | "_LIBCXXABI_NO_EXCEPTIONS", |
| 399 | "_LIBCPP_OVERRIDABLE_FUNC_VIS=__attribute__((__visibility__(\"default\")))", |
| 400 | ] |
| 401 | cflags = [ |
| 402 | "-fPIC", |
| 403 | "-fstrict-aliasing", |
| 404 | ] |
| 405 | } |
| 406 | |
Primiano Tucci | 7278dea | 2017-10-31 11:50:32 +0000 | [diff] [blame] | 407 | source_set("libunwind") { |
Primiano Tucci | 13ae72f | 2019-06-06 10:53:02 +0100 | [diff] [blame] | 408 | visibility = _buildtools_visibility |
Primiano Tucci | 7278dea | 2017-10-31 11:50:32 +0000 | [diff] [blame] | 409 | sources = [ |
| 410 | "libunwind/src/Unwind-EHABI.cpp", |
| 411 | "libunwind/src/Unwind-sjlj.c", |
| 412 | "libunwind/src/UnwindLevel1-gcc-ext.c", |
| 413 | "libunwind/src/UnwindLevel1.c", |
| 414 | "libunwind/src/UnwindRegistersRestore.S", |
| 415 | "libunwind/src/UnwindRegistersSave.S", |
| 416 | "libunwind/src/libunwind.cpp", |
| 417 | ] |
| 418 | include_dirs = [ "libunwind/include" ] |
| 419 | configs -= [ |
Primiano Tucci | 7a40e4d | 2017-12-06 09:51:09 +0000 | [diff] [blame] | 420 | "//gn/standalone:extra_warnings", |
| 421 | "//gn/standalone:no_exceptions", |
| 422 | "//gn/standalone:no_rtti", |
Primiano Tucci | 7278dea | 2017-10-31 11:50:32 +0000 | [diff] [blame] | 423 | |
| 424 | # When building with msan, libunwind itself triggers memory violations |
| 425 | # that causes msan to get stuck into an infinite loop. Just don't |
| 426 | # instrument libunwind itself. |
Primiano Tucci | 7a40e4d | 2017-12-06 09:51:09 +0000 | [diff] [blame] | 427 | "//gn/standalone/sanitizers:sanitizers_cflags", |
Primiano Tucci | 7278dea | 2017-10-31 11:50:32 +0000 | [diff] [blame] | 428 | ] |
| 429 | configs += [ |
| 430 | ":libc++config", |
Primiano Tucci | 7a40e4d | 2017-12-06 09:51:09 +0000 | [diff] [blame] | 431 | "//gn/standalone/sanitizers:sanitizer_options_link_helper", |
Primiano Tucci | 7278dea | 2017-10-31 11:50:32 +0000 | [diff] [blame] | 432 | ] |
| 433 | } |
| 434 | |
Primiano Tucci | 0825bc8 | 2017-09-28 18:50:23 +0100 | [diff] [blame] | 435 | source_set("libc++abi") { |
Primiano Tucci | 13ae72f | 2019-06-06 10:53:02 +0100 | [diff] [blame] | 436 | visibility = _buildtools_visibility |
Primiano Tucci | 0825bc8 | 2017-09-28 18:50:23 +0100 | [diff] [blame] | 437 | sources = [ |
| 438 | "libcxxabi/src/abort_message.cpp", |
| 439 | "libcxxabi/src/cxa_aux_runtime.cpp", |
| 440 | "libcxxabi/src/cxa_default_handlers.cpp", |
| 441 | "libcxxabi/src/cxa_demangle.cpp", |
| 442 | "libcxxabi/src/cxa_exception.cpp", |
| 443 | "libcxxabi/src/cxa_exception_storage.cpp", |
| 444 | "libcxxabi/src/cxa_guard.cpp", |
| 445 | "libcxxabi/src/cxa_handlers.cpp", |
| 446 | "libcxxabi/src/cxa_personality.cpp", |
| 447 | "libcxxabi/src/cxa_unexpected.cpp", |
| 448 | "libcxxabi/src/cxa_vector.cpp", |
| 449 | "libcxxabi/src/cxa_virtual.cpp", |
| 450 | "libcxxabi/src/fallback_malloc.cpp", |
| 451 | "libcxxabi/src/private_typeinfo.cpp", |
| 452 | "libcxxabi/src/stdlib_exception.cpp", |
| 453 | "libcxxabi/src/stdlib_stdexcept.cpp", |
| 454 | "libcxxabi/src/stdlib_typeinfo.cpp", |
| 455 | ] |
| 456 | |
| 457 | # On linux this seems to introduce an unwanted glibc 2.18 dependency. |
| 458 | if (is_android) { |
| 459 | sources += [ "libcxxabi/src/cxa_thread_atexit.cpp" ] |
| 460 | } |
| 461 | configs -= [ |
Primiano Tucci | 7a40e4d | 2017-12-06 09:51:09 +0000 | [diff] [blame] | 462 | "//gn/standalone:extra_warnings", |
| 463 | "//gn/standalone:no_exceptions", |
| 464 | "//gn/standalone:no_rtti", |
Primiano Tucci | 5aab758 | 2017-12-07 12:22:03 +0000 | [diff] [blame] | 465 | "//gn/standalone:visibility_hidden", |
Primiano Tucci | 0825bc8 | 2017-09-28 18:50:23 +0100 | [diff] [blame] | 466 | ] |
| 467 | configs += [ |
| 468 | ":libc++config", |
Primiano Tucci | 7a40e4d | 2017-12-06 09:51:09 +0000 | [diff] [blame] | 469 | "//gn/standalone/sanitizers:sanitizer_options_link_helper", |
Primiano Tucci | 0825bc8 | 2017-09-28 18:50:23 +0100 | [diff] [blame] | 470 | ] |
Oystein Eftevaag | dd727e4 | 2017-12-05 08:49:55 -0800 | [diff] [blame] | 471 | deps = [ |
| 472 | ":libunwind", |
| 473 | ] |
Primiano Tucci | 0825bc8 | 2017-09-28 18:50:23 +0100 | [diff] [blame] | 474 | } |
| 475 | |
Primiano Tucci | 7278dea | 2017-10-31 11:50:32 +0000 | [diff] [blame] | 476 | if (custom_libcxx_is_static) { |
| 477 | libcxx_target_type = "source_set" |
| 478 | } else { |
| 479 | libcxx_target_type = "shared_library" |
| 480 | } |
| 481 | |
| 482 | target(libcxx_target_type, "libc++") { |
Primiano Tucci | 13ae72f | 2019-06-06 10:53:02 +0100 | [diff] [blame] | 483 | visibility = _buildtools_visibility |
| 484 | visibility += [ "../gn/standalone/libc++:*" ] |
Primiano Tucci | 0825bc8 | 2017-09-28 18:50:23 +0100 | [diff] [blame] | 485 | sources = [ |
| 486 | "libcxx/src/algorithm.cpp", |
| 487 | "libcxx/src/any.cpp", |
| 488 | "libcxx/src/bind.cpp", |
| 489 | "libcxx/src/chrono.cpp", |
| 490 | "libcxx/src/condition_variable.cpp", |
| 491 | "libcxx/src/debug.cpp", |
| 492 | "libcxx/src/exception.cpp", |
| 493 | "libcxx/src/functional.cpp", |
| 494 | "libcxx/src/future.cpp", |
| 495 | "libcxx/src/hash.cpp", |
| 496 | "libcxx/src/ios.cpp", |
| 497 | "libcxx/src/iostream.cpp", |
| 498 | "libcxx/src/locale.cpp", |
| 499 | "libcxx/src/memory.cpp", |
| 500 | "libcxx/src/mutex.cpp", |
| 501 | "libcxx/src/new.cpp", |
| 502 | "libcxx/src/optional.cpp", |
| 503 | "libcxx/src/random.cpp", |
| 504 | "libcxx/src/regex.cpp", |
| 505 | "libcxx/src/shared_mutex.cpp", |
| 506 | "libcxx/src/stdexcept.cpp", |
| 507 | "libcxx/src/string.cpp", |
| 508 | "libcxx/src/strstream.cpp", |
| 509 | "libcxx/src/system_error.cpp", |
| 510 | "libcxx/src/thread.cpp", |
| 511 | "libcxx/src/typeinfo.cpp", |
| 512 | "libcxx/src/utility.cpp", |
| 513 | "libcxx/src/valarray.cpp", |
| 514 | "libcxx/src/variant.cpp", |
Primiano Tucci | c2eb510 | 2018-05-15 10:40:01 +0100 | [diff] [blame] | 515 | "libcxx/src/vector.cpp", |
Primiano Tucci | 0825bc8 | 2017-09-28 18:50:23 +0100 | [diff] [blame] | 516 | ] |
| 517 | configs -= [ |
Primiano Tucci | 7a40e4d | 2017-12-06 09:51:09 +0000 | [diff] [blame] | 518 | "//gn/standalone:extra_warnings", |
| 519 | "//gn/standalone:no_exceptions", |
| 520 | "//gn/standalone:no_rtti", |
Primiano Tucci | 5aab758 | 2017-12-07 12:22:03 +0000 | [diff] [blame] | 521 | "//gn/standalone:visibility_hidden", |
Primiano Tucci | 0825bc8 | 2017-09-28 18:50:23 +0100 | [diff] [blame] | 522 | ] |
| 523 | configs += [ |
| 524 | ":libc++config", |
Primiano Tucci | 7a40e4d | 2017-12-06 09:51:09 +0000 | [diff] [blame] | 525 | "//gn/standalone/sanitizers:sanitizer_options_link_helper", |
Primiano Tucci | 0825bc8 | 2017-09-28 18:50:23 +0100 | [diff] [blame] | 526 | ] |
| 527 | defines = [ "_LIBCPP_BUILDING_LIBRARY" ] |
Oystein Eftevaag | dd727e4 | 2017-12-05 08:49:55 -0800 | [diff] [blame] | 528 | deps = [ |
| 529 | ":libc++abi", |
| 530 | ] |
Primiano Tucci | 0825bc8 | 2017-09-28 18:50:23 +0100 | [diff] [blame] | 531 | } |
| 532 | } # if (use_custom_libcxx) |
Hector Dearman | 88a1011 | 2017-10-12 11:07:10 +0100 | [diff] [blame] | 533 | |
| 534 | config("benchmark_config") { |
Primiano Tucci | 13ae72f | 2019-06-06 10:53:02 +0100 | [diff] [blame] | 535 | visibility = _buildtools_visibility |
Primiano Tucci | 2a29ac7 | 2017-10-24 17:47:19 +0100 | [diff] [blame] | 536 | include_dirs = [ "benchmark/include" ] |
Primiano Tucci | 3cbb10a | 2018-04-10 17:52:40 +0100 | [diff] [blame] | 537 | configs = [ ":test_warning_suppressions" ] |
Hector Dearman | 88a1011 | 2017-10-12 11:07:10 +0100 | [diff] [blame] | 538 | } |
| 539 | |
| 540 | source_set("benchmark") { |
Primiano Tucci | 13ae72f | 2019-06-06 10:53:02 +0100 | [diff] [blame] | 541 | visibility = _buildtools_visibility |
Hector Dearman | 88a1011 | 2017-10-12 11:07:10 +0100 | [diff] [blame] | 542 | testonly = true |
| 543 | sources = [ |
| 544 | "benchmark/include/benchmark/benchmark.h", |
| 545 | "benchmark/include/benchmark/benchmark_api.h", |
| 546 | "benchmark/include/benchmark/reporter.h", |
| 547 | "benchmark/src/arraysize.h", |
| 548 | "benchmark/src/benchmark.cc", |
| 549 | "benchmark/src/benchmark_api_internal.h", |
| 550 | "benchmark/src/benchmark_register.cc", |
| 551 | "benchmark/src/check.h", |
| 552 | "benchmark/src/colorprint.cc", |
| 553 | "benchmark/src/colorprint.h", |
| 554 | "benchmark/src/commandlineflags.cc", |
| 555 | "benchmark/src/commandlineflags.h", |
| 556 | "benchmark/src/complexity.cc", |
| 557 | "benchmark/src/complexity.h", |
| 558 | "benchmark/src/console_reporter.cc", |
| 559 | "benchmark/src/counter.cc", |
| 560 | "benchmark/src/counter.h", |
| 561 | "benchmark/src/csv_reporter.cc", |
| 562 | "benchmark/src/cycleclock.h", |
| 563 | "benchmark/src/internal_macros.h", |
| 564 | "benchmark/src/json_reporter.cc", |
| 565 | "benchmark/src/log.h", |
| 566 | "benchmark/src/mutex.h", |
| 567 | "benchmark/src/re.h", |
| 568 | "benchmark/src/reporter.cc", |
| 569 | "benchmark/src/sleep.cc", |
| 570 | "benchmark/src/sleep.h", |
Lalit Maganti | c99d93c | 2018-03-22 15:09:30 +0000 | [diff] [blame] | 571 | "benchmark/src/statistics.cc", |
| 572 | "benchmark/src/statistics.h", |
Hector Dearman | 88a1011 | 2017-10-12 11:07:10 +0100 | [diff] [blame] | 573 | "benchmark/src/string_util.cc", |
| 574 | "benchmark/src/string_util.h", |
| 575 | "benchmark/src/sysinfo.cc", |
| 576 | "benchmark/src/sysinfo.h", |
| 577 | "benchmark/src/timers.cc", |
| 578 | "benchmark/src/timers.h", |
| 579 | ] |
| 580 | defines = [ "HAVE_POSIX_REGEX" ] |
| 581 | public_configs = [ ":benchmark_config" ] |
| 582 | all_dependent_configs = [ ":benchmark_config" ] |
Primiano Tucci | 7a40e4d | 2017-12-06 09:51:09 +0000 | [diff] [blame] | 583 | configs -= [ "//gn/standalone:extra_warnings" ] |
Hector Dearman | 88a1011 | 2017-10-12 11:07:10 +0100 | [diff] [blame] | 584 | } |
Primiano Tucci | 38faa6f | 2018-04-01 20:12:08 +0200 | [diff] [blame] | 585 | |
| 586 | # On Linux/Android use libbacktrace in debug builds for better stacktraces. |
| 587 | if (is_linux || is_android) { |
| 588 | config("libbacktrace_config") { |
Primiano Tucci | 13ae72f | 2019-06-06 10:53:02 +0100 | [diff] [blame] | 589 | visibility = _buildtools_visibility |
Primiano Tucci | 38faa6f | 2018-04-01 20:12:08 +0200 | [diff] [blame] | 590 | include_dirs = [ |
| 591 | "libbacktrace_config", |
| 592 | "libbacktrace", |
| 593 | ] |
| 594 | cflags = [ |
Primiano Tucci | 3cbb10a | 2018-04-10 17:52:40 +0100 | [diff] [blame] | 595 | # We force include this config file because "config.h" is too generic as a |
| 596 | # file name and on some platforms #include "config.h" ends up colliding |
| 597 | # importing some other project's config.h. |
Primiano Tucci | 38faa6f | 2018-04-01 20:12:08 +0200 | [diff] [blame] | 598 | "-include", |
| 599 | rebase_path("libbacktrace_config/config.h", root_build_dir), |
| 600 | ] |
| 601 | } |
| 602 | |
| 603 | source_set("libbacktrace") { |
Primiano Tucci | 13ae72f | 2019-06-06 10:53:02 +0100 | [diff] [blame] | 604 | visibility = _buildtools_visibility |
Primiano Tucci | 38faa6f | 2018-04-01 20:12:08 +0200 | [diff] [blame] | 605 | sources = [ |
Primiano Tucci | 38faa6f | 2018-04-01 20:12:08 +0200 | [diff] [blame] | 606 | "libbacktrace/dwarf.c", |
| 607 | "libbacktrace/elf.c", |
| 608 | "libbacktrace/fileline.c", |
| 609 | "libbacktrace/mmap.c", |
| 610 | "libbacktrace/mmapio.c", |
| 611 | "libbacktrace/posix.c", |
Primiano Tucci | 38faa6f | 2018-04-01 20:12:08 +0200 | [diff] [blame] | 612 | "libbacktrace/sort.c", |
| 613 | "libbacktrace/state.c", |
| 614 | ] |
| 615 | configs -= [ "//gn/standalone:extra_warnings" ] |
| 616 | public_configs = [ ":libbacktrace_config" ] |
| 617 | } |
| 618 | } |
Lalit Maganti | b123f26 | 2018-05-22 14:05:03 +0100 | [diff] [blame] | 619 | |
| 620 | config("sqlite_config") { |
Primiano Tucci | 13ae72f | 2019-06-06 10:53:02 +0100 | [diff] [blame] | 621 | visibility = _buildtools_visibility |
Lalit Maganti | b123f26 | 2018-05-22 14:05:03 +0100 | [diff] [blame] | 622 | include_dirs = [ "sqlite" ] |
| 623 | cflags = [ |
| 624 | "-DSQLITE_THREADSAFE=0", |
| 625 | "-DQLITE_DEFAULT_MEMSTATUS=0", |
| 626 | "-DSQLITE_LIKE_DOESNT_MATCH_BLOBS", |
Lalit Maganti | b123f26 | 2018-05-22 14:05:03 +0100 | [diff] [blame] | 627 | "-DSQLITE_OMIT_DEPRECATED", |
| 628 | "-DSQLITE_OMIT_SHARED_CACHE", |
| 629 | "-DHAVE_USLEEP", |
| 630 | "-DHAVE_UTIME", |
| 631 | "-DSQLITE_BYTEORDER=1234", |
| 632 | "-DSQLITE_DEFAULT_AUTOVACUUM=0", |
| 633 | "-DSQLITE_DEFAULT_MMAP_SIZE=0", |
| 634 | "-DSQLITE_CORE", |
Lalit Maganti | 8d31c73 | 2018-06-21 14:23:04 +0100 | [diff] [blame] | 635 | "-DSQLITE_TEMP_STORE=3", |
Lalit Maganti | c6347f0 | 2018-06-25 14:03:46 +0100 | [diff] [blame] | 636 | "-DSQLITE_OMIT_LOAD_EXTENSION", |
Hector Dearman | 7af3357 | 2018-09-19 17:42:25 +0100 | [diff] [blame] | 637 | "-DSQLITE_OMIT_RANDOMNESS", |
Lalit Maganti | b123f26 | 2018-05-22 14:05:03 +0100 | [diff] [blame] | 638 | ] |
| 639 | } |
| 640 | |
| 641 | source_set("sqlite") { |
Primiano Tucci | 13ae72f | 2019-06-06 10:53:02 +0100 | [diff] [blame] | 642 | visibility = _buildtools_visibility |
Lalit Maganti | b123f26 | 2018-05-22 14:05:03 +0100 | [diff] [blame] | 643 | sources = [ |
| 644 | "sqlite/sqlite3.c", |
| 645 | "sqlite/sqlite3.h", |
| 646 | "sqlite/sqlite3ext.h", |
Ioannis Ilkos | 178535e | 2018-11-05 17:32:45 +0000 | [diff] [blame] | 647 | "sqlite_src/ext/misc/percentile.c", |
Lalit Maganti | b123f26 | 2018-05-22 14:05:03 +0100 | [diff] [blame] | 648 | ] |
| 649 | configs -= [ "//gn/standalone:extra_warnings" ] |
| 650 | public_configs = [ ":sqlite_config" ] |
| 651 | } |
| 652 | |
| 653 | source_set("sqlite_shell") { |
Primiano Tucci | 13ae72f | 2019-06-06 10:53:02 +0100 | [diff] [blame] | 654 | visibility = _buildtools_visibility |
Lalit Maganti | b123f26 | 2018-05-22 14:05:03 +0100 | [diff] [blame] | 655 | testonly = true |
| 656 | sources = [ |
| 657 | "sqlite/shell.c", |
| 658 | ] |
| 659 | configs -= [ "//gn/standalone:extra_warnings" ] |
| 660 | deps = [ |
| 661 | ":sqlite", |
| 662 | ] |
| 663 | } |
Primiano Tucci | 0d72a31 | 2018-08-07 14:42:45 +0100 | [diff] [blame] | 664 | |
Florian Mayer | 475bd7e | 2018-08-07 20:04:03 +0100 | [diff] [blame] | 665 | source_set("lzma") { |
Primiano Tucci | 13ae72f | 2019-06-06 10:53:02 +0100 | [diff] [blame] | 666 | visibility = _buildtools_visibility |
Florian Mayer | 475bd7e | 2018-08-07 20:04:03 +0100 | [diff] [blame] | 667 | defines = [ "_7ZIP_ST" ] |
| 668 | sources = [ |
| 669 | "lzma/C/7zAlloc.c", |
| 670 | "lzma/C/7zArcIn.c", |
| 671 | "lzma/C/7zBuf.c", |
| 672 | "lzma/C/7zBuf2.c", |
| 673 | "lzma/C/7zCrc.c", |
| 674 | "lzma/C/7zCrcOpt.c", |
| 675 | "lzma/C/7zDec.c", |
| 676 | "lzma/C/7zFile.c", |
| 677 | "lzma/C/7zStream.c", |
| 678 | "lzma/C/Aes.c", |
| 679 | "lzma/C/AesOpt.c", |
| 680 | "lzma/C/Alloc.c", |
| 681 | "lzma/C/Bcj2.c", |
| 682 | "lzma/C/Bra.c", |
| 683 | "lzma/C/Bra86.c", |
| 684 | "lzma/C/BraIA64.c", |
| 685 | "lzma/C/CpuArch.c", |
| 686 | "lzma/C/Delta.c", |
| 687 | "lzma/C/LzFind.c", |
| 688 | "lzma/C/Lzma2Dec.c", |
| 689 | "lzma/C/Lzma2Enc.c", |
| 690 | "lzma/C/Lzma86Dec.c", |
| 691 | "lzma/C/Lzma86Enc.c", |
| 692 | "lzma/C/LzmaDec.c", |
| 693 | "lzma/C/LzmaEnc.c", |
| 694 | "lzma/C/LzmaLib.c", |
| 695 | "lzma/C/Ppmd7.c", |
| 696 | "lzma/C/Ppmd7Dec.c", |
| 697 | "lzma/C/Ppmd7Enc.c", |
| 698 | "lzma/C/Sha256.c", |
| 699 | "lzma/C/Sort.c", |
| 700 | "lzma/C/Xz.c", |
| 701 | "lzma/C/XzCrc64.c", |
| 702 | "lzma/C/XzCrc64Opt.c", |
| 703 | "lzma/C/XzDec.c", |
| 704 | "lzma/C/XzEnc.c", |
| 705 | "lzma/C/XzIn.c", |
| 706 | ] |
| 707 | configs -= [ "//gn/standalone:extra_warnings" ] |
| 708 | cflags = [ |
| 709 | "-Wno-empty-body", |
| 710 | "-Wno-enum-conversion", |
| 711 | ] |
| 712 | } |
Florian Mayer | a2fae26 | 2018-08-31 12:10:01 -0700 | [diff] [blame] | 713 | |
Hector Dearman | e0b993f | 2019-05-24 18:48:16 +0100 | [diff] [blame] | 714 | source_set("zlib") { |
Primiano Tucci | 13ae72f | 2019-06-06 10:53:02 +0100 | [diff] [blame] | 715 | visibility = _buildtools_visibility |
Hector Dearman | e0b993f | 2019-05-24 18:48:16 +0100 | [diff] [blame] | 716 | sources = [ |
| 717 | "zlib/src/adler32.c", |
| 718 | "zlib/src/compress.c", |
| 719 | "zlib/src/crc32.c", |
| 720 | "zlib/src/deflate.c", |
| 721 | "zlib/src/gzclose.c", |
| 722 | "zlib/src/gzlib.c", |
| 723 | "zlib/src/gzread.c", |
| 724 | "zlib/src/gzwrite.c", |
| 725 | "zlib/src/infback.c", |
| 726 | "zlib/src/inffast.c", |
| 727 | "zlib/src/inflate.c", |
| 728 | "zlib/src/inftrees.c", |
| 729 | "zlib/src/trees.c", |
| 730 | "zlib/src/uncompr.c", |
| 731 | "zlib/src/zutil.c", |
| 732 | ] |
| 733 | configs -= [ "//gn/standalone:extra_warnings" ] |
| 734 | cflags = [] |
| 735 | public_configs = [ ":zlib_config" ] |
| 736 | } |
| 737 | |
| 738 | config("zlib_config") { |
Primiano Tucci | 13ae72f | 2019-06-06 10:53:02 +0100 | [diff] [blame] | 739 | visibility = _buildtools_visibility |
Primiano Tucci | 225a4e6 | 2019-06-06 11:13:57 +0100 | [diff] [blame] | 740 | defines = [ "HAVE_HIDDEN" ] |
Hector Dearman | 554627f | 2019-06-04 17:58:22 +0100 | [diff] [blame] | 741 | cflags = [ |
| 742 | # Using -isystem instead of include_dirs (-I), so we don't need to suppress |
| 743 | # warnings coming from third-party headers. Doing so would mask warnings in |
| 744 | # our own code. |
| 745 | "-isystem", |
| 746 | rebase_path("zlib/src", root_build_dir), |
| 747 | ] |
Hector Dearman | e0b993f | 2019-05-24 18:48:16 +0100 | [diff] [blame] | 748 | } |
| 749 | |
Florian Mayer | 475bd7e | 2018-08-07 20:04:03 +0100 | [diff] [blame] | 750 | source_set("libunwindstack") { |
Primiano Tucci | 13ae72f | 2019-06-06 10:53:02 +0100 | [diff] [blame] | 751 | visibility = _buildtools_visibility |
Florian Mayer | 475bd7e | 2018-08-07 20:04:03 +0100 | [diff] [blame] | 752 | include_dirs = [ |
Florian Mayer | f833566 | 2018-08-08 11:30:32 +0100 | [diff] [blame] | 753 | "android-core/libunwindstack/include", |
| 754 | "android-core/libunwindstack", |
| 755 | "android-core/base/include", |
| 756 | "android-core/liblog/include", |
| 757 | "android-core/libprocinfo/include", |
| 758 | "android-core/include", |
Florian Mayer | 475bd7e | 2018-08-07 20:04:03 +0100 | [diff] [blame] | 759 | "lzma/C", |
| 760 | ] |
| 761 | deps = [ |
| 762 | ":lzma", |
| 763 | ] |
Florian Mayer | 475bd7e | 2018-08-07 20:04:03 +0100 | [diff] [blame] | 764 | sources = [ |
Florian Mayer | f833566 | 2018-08-08 11:30:32 +0100 | [diff] [blame] | 765 | "android-core/base/file.cpp", |
| 766 | "android-core/base/logging.cpp", |
| 767 | "android-core/base/stringprintf.cpp", |
| 768 | "android-core/base/strings.cpp", |
| 769 | "android-core/base/threads.cpp", |
Florian Mayer | 6140f32 | 2019-01-21 15:10:17 +0000 | [diff] [blame] | 770 | "android-core/demangle/Demangler.cpp", |
Florian Mayer | f833566 | 2018-08-08 11:30:32 +0100 | [diff] [blame] | 771 | "android-core/libunwindstack/ArmExidx.cpp", |
| 772 | "android-core/libunwindstack/DwarfCfa.cpp", |
| 773 | "android-core/libunwindstack/DwarfEhFrameWithHdr.cpp", |
| 774 | "android-core/libunwindstack/DwarfMemory.cpp", |
| 775 | "android-core/libunwindstack/DwarfOp.cpp", |
| 776 | "android-core/libunwindstack/DwarfSection.cpp", |
| 777 | "android-core/libunwindstack/Elf.cpp", |
| 778 | "android-core/libunwindstack/ElfInterface.cpp", |
| 779 | "android-core/libunwindstack/ElfInterfaceArm.cpp", |
Florian Mayer | 86120f6 | 2018-10-23 15:19:46 +0100 | [diff] [blame] | 780 | "android-core/libunwindstack/Global.cpp", |
Florian Mayer | f833566 | 2018-08-08 11:30:32 +0100 | [diff] [blame] | 781 | "android-core/libunwindstack/JitDebug.cpp", |
| 782 | "android-core/libunwindstack/LocalUnwinder.cpp", |
| 783 | "android-core/libunwindstack/Log.cpp", |
| 784 | "android-core/libunwindstack/MapInfo.cpp", |
| 785 | "android-core/libunwindstack/Maps.cpp", |
| 786 | "android-core/libunwindstack/Memory.cpp", |
| 787 | "android-core/libunwindstack/Regs.cpp", |
| 788 | "android-core/libunwindstack/RegsArm.cpp", |
| 789 | "android-core/libunwindstack/RegsArm64.cpp", |
| 790 | "android-core/libunwindstack/RegsMips.cpp", |
| 791 | "android-core/libunwindstack/RegsMips64.cpp", |
| 792 | "android-core/libunwindstack/RegsX86.cpp", |
| 793 | "android-core/libunwindstack/RegsX86_64.cpp", |
| 794 | "android-core/libunwindstack/Symbols.cpp", |
| 795 | "android-core/libunwindstack/Unwinder.cpp", |
| 796 | "android-core/libunwindstack/tests/LogFake.cpp", |
Florian Mayer | 475bd7e | 2018-08-07 20:04:03 +0100 | [diff] [blame] | 797 | ] |
| 798 | if (current_cpu == "x86") { |
Florian Mayer | f833566 | 2018-08-08 11:30:32 +0100 | [diff] [blame] | 799 | sources += [ "android-core/libunwindstack/AsmGetRegsX86.S" ] |
Florian Mayer | 475bd7e | 2018-08-07 20:04:03 +0100 | [diff] [blame] | 800 | } else if (current_cpu == "x64") { |
Florian Mayer | f833566 | 2018-08-08 11:30:32 +0100 | [diff] [blame] | 801 | sources += [ "android-core/libunwindstack/AsmGetRegsX86_64.S" ] |
Florian Mayer | 475bd7e | 2018-08-07 20:04:03 +0100 | [diff] [blame] | 802 | } |
| 803 | configs -= [ |
| 804 | "//gn/standalone:extra_warnings", |
| 805 | "//gn/standalone:c++11", |
Florian Mayer | a2fae26 | 2018-08-31 12:10:01 -0700 | [diff] [blame] | 806 | "//gn/standalone:visibility_hidden", |
Florian Mayer | 475bd7e | 2018-08-07 20:04:03 +0100 | [diff] [blame] | 807 | ] |
| 808 | configs += [ "//gn/standalone:c++17" ] |
| 809 | public_configs = [ ":libunwindstack_config" ] |
| 810 | } |
| 811 | |
Primiano Tucci | 0d72a31 | 2018-08-07 14:42:45 +0100 | [diff] [blame] | 812 | config("jsoncpp_config") { |
Primiano Tucci | 13ae72f | 2019-06-06 10:53:02 +0100 | [diff] [blame] | 813 | visibility = _buildtools_visibility |
Primiano Tucci | 0d72a31 | 2018-08-07 14:42:45 +0100 | [diff] [blame] | 814 | cflags = [ |
| 815 | "-DJSON_USE_EXCEPTION=0", |
| 816 | |
| 817 | # Using -isystem instead of include_dirs (-I), so we don't need to suppress |
Florian Mayer | bda0c44 | 2018-09-07 10:53:55 +0100 | [diff] [blame] | 818 | # warnings coming from third-party headers. Doing so would mask warnings in |
Primiano Tucci | 0d72a31 | 2018-08-07 14:42:45 +0100 | [diff] [blame] | 819 | # our own code. |
| 820 | "-isystem", |
| 821 | rebase_path("jsoncpp/include", root_build_dir), |
| 822 | ] |
| 823 | } |
| 824 | |
| 825 | source_set("jsoncpp") { |
Primiano Tucci | 13ae72f | 2019-06-06 10:53:02 +0100 | [diff] [blame] | 826 | visibility = _buildtools_visibility |
Primiano Tucci | 0d72a31 | 2018-08-07 14:42:45 +0100 | [diff] [blame] | 827 | sources = [ |
| 828 | "jsoncpp/src/lib_json/json_reader.cpp", |
| 829 | "jsoncpp/src/lib_json/json_value.cpp", |
| 830 | "jsoncpp/src/lib_json/json_writer.cpp", |
| 831 | ] |
| 832 | configs -= [ "//gn/standalone:extra_warnings" ] |
| 833 | public_configs = [ ":jsoncpp_config" ] |
| 834 | } |
Hector Dearman | e44ad45 | 2018-09-21 11:51:57 +0100 | [diff] [blame] | 835 | |
| 836 | config("linenoise_config") { |
Primiano Tucci | 13ae72f | 2019-06-06 10:53:02 +0100 | [diff] [blame] | 837 | visibility = _buildtools_visibility |
Hector Dearman | e44ad45 | 2018-09-21 11:51:57 +0100 | [diff] [blame] | 838 | cflags = [ |
| 839 | # Using -isystem instead of include_dirs (-I), so we don't need to suppress |
| 840 | # warnings coming from third-party headers. Doing so would mask warnings in |
| 841 | # our own code. |
| 842 | "-isystem", |
| 843 | rebase_path("linenoise", root_build_dir), |
| 844 | ] |
| 845 | } |
| 846 | |
| 847 | source_set("linenoise") { |
Primiano Tucci | 13ae72f | 2019-06-06 10:53:02 +0100 | [diff] [blame] | 848 | visibility = _buildtools_visibility |
Hector Dearman | e44ad45 | 2018-09-21 11:51:57 +0100 | [diff] [blame] | 849 | sources = [ |
| 850 | "linenoise/linenoise.c", |
| 851 | "linenoise/linenoise.h", |
| 852 | ] |
| 853 | configs -= [ "//gn/standalone:extra_warnings" ] |
| 854 | public_configs = [ ":linenoise_config" ] |
| 855 | } |
Primiano Tucci | a65497e | 2018-09-26 19:53:58 +0100 | [diff] [blame] | 856 | |
Primiano Tucci | 780deea | 2018-10-11 09:28:05 +0100 | [diff] [blame] | 857 | if (use_libfuzzer) { |
| 858 | source_set("libfuzzer") { |
Primiano Tucci | 13ae72f | 2019-06-06 10:53:02 +0100 | [diff] [blame] | 859 | visibility = _buildtools_visibility |
Primiano Tucci | 780deea | 2018-10-11 09:28:05 +0100 | [diff] [blame] | 860 | configs -= [ |
| 861 | "//gn/standalone:extra_warnings", |
| 862 | "//gn/standalone/sanitizers:sanitizers_cflags", |
| 863 | ] |
| 864 | sources = [ |
| 865 | "libfuzzer/FuzzerCrossOver.cpp", |
| 866 | "libfuzzer/FuzzerDataFlowTrace.cpp", |
| 867 | "libfuzzer/FuzzerDriver.cpp", |
| 868 | "libfuzzer/FuzzerExtFunctionsDlsym.cpp", |
| 869 | "libfuzzer/FuzzerExtFunctionsWeak.cpp", |
| 870 | "libfuzzer/FuzzerExtFunctionsWeakAlias.cpp", |
| 871 | "libfuzzer/FuzzerExtraCounters.cpp", |
| 872 | "libfuzzer/FuzzerIO.cpp", |
| 873 | "libfuzzer/FuzzerIOPosix.cpp", |
| 874 | "libfuzzer/FuzzerIOWindows.cpp", |
| 875 | "libfuzzer/FuzzerLoop.cpp", |
| 876 | "libfuzzer/FuzzerMain.cpp", |
| 877 | "libfuzzer/FuzzerMerge.cpp", |
| 878 | "libfuzzer/FuzzerMutate.cpp", |
| 879 | "libfuzzer/FuzzerSHA1.cpp", |
| 880 | "libfuzzer/FuzzerShmemPosix.cpp", |
| 881 | "libfuzzer/FuzzerTracePC.cpp", |
| 882 | "libfuzzer/FuzzerUtil.cpp", |
| 883 | "libfuzzer/FuzzerUtilDarwin.cpp", |
| 884 | "libfuzzer/FuzzerUtilFuchsia.cpp", |
| 885 | "libfuzzer/FuzzerUtilLinux.cpp", |
| 886 | "libfuzzer/FuzzerUtilPosix.cpp", |
| 887 | "libfuzzer/FuzzerUtilWindows.cpp", |
| 888 | ] |
| 889 | } |
Primiano Tucci | a65497e | 2018-09-26 19:53:58 +0100 | [diff] [blame] | 890 | } |