blob: a59c4922f4253846947624bc1fae187bcb1b5b7a [file] [log] [blame]
Primiano Tucciae2879e2017-09-27 11:02:09 +09001# 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
Florian Mayera2fae262018-08-31 12:10:01 -070015import("../gn/perfetto.gni")
Primiano Tucci02c11762019-08-30 00:57:59 +020016import("../gn/standalone/libc++/libc++.gni")
Florian Mayer0bea7972019-09-02 15:28:13 +010017import("../gn/standalone/sanitizers/vars.gni")
Primiano Tucci02c11762019-08-30 00:57:59 +020018
19# We should never get here in embedder builds.
20assert(perfetto_build_standalone || is_perfetto_build_generator)
Primiano Tucci0825bc82017-09-28 18:50:23 +010021
Primiano Tucci13ae72f2019-06-06 10:53:02 +010022# This is to make sure that we don't add accidental dependencies from build
23# files in src/ or include/ to buildtools. All deps (outside of /gn/*) should
24# go via the groups defined in gn/BUILD.gn, not directly into buildtools. This
25# is to allow embedders to re-route targets to their third_party directories.
26_buildtools_visibility = [
27 "./*",
28 "../gn:*",
29 "../gn/standalone:*",
30]
31
Primiano Tucci3cbb10a2018-04-10 17:52:40 +010032# Used to suppress warnings coming from googletest macros expansions.
Primiano Tucci919ca1e2019-08-21 20:26:58 +020033# These suppressions apply both to gtest/gmock haders and to perfetto's
34# test translation units. See test/gtest_and_gmock.h for the subset of
35# suppressions that apply only to the gmock/gtest headers.
Primiano Tucci3cbb10a2018-04-10 17:52:40 +010036config("test_warning_suppressions") {
Primiano Tucci13ae72f2019-06-06 10:53:02 +010037 visibility = _buildtools_visibility
Primiano Tucci919ca1e2019-08-21 20:26:58 +020038 if (is_clang) {
39 cflags = [
Primiano Tucci919ca1e2019-08-21 20:26:58 +020040 "-Wno-covered-switch-default",
Primiano Tucci2f811552020-12-07 16:48:22 +010041 "-Wno-deprecated-copy-dtor",
42 "-Wno-global-constructors",
Primiano Tucci919ca1e2019-08-21 20:26:58 +020043 "-Wno-inconsistent-missing-override",
Primiano Tucci2f811552020-12-07 16:48:22 +010044 "-Wno-language-extension-token",
Primiano Tuccif68444a2020-08-05 11:53:39 +020045 "-Wno-suggest-destructor-override",
Primiano Tucci2f811552020-12-07 16:48:22 +010046 "-Wno-suggest-override",
47 "-Wno-undef",
48 "-Wno-unknown-warning-option",
49 "-Wno-unused-member-function",
50 "-Wno-used-but-marked-unused",
51 "-Wno-weak-vtables",
52 "-Wno-zero-as-null-pointer-constant",
Primiano Tucci919ca1e2019-08-21 20:26:58 +020053 ]
Primiano Tucci2f811552020-12-07 16:48:22 +010054 } else if (!is_win) {
Matthew Clarkson83987d22019-10-03 17:30:53 +010055 cflags = [
56 "-Wno-unknown-warning-option",
57 "-Wno-deprecated-copy",
58 ]
Primiano Tucci919ca1e2019-08-21 20:26:58 +020059 }
Primiano Tucci2a29ac72017-10-24 17:47:19 +010060}
61
Florian Mayer475bd7e2018-08-07 20:04:03 +010062config("libunwindstack_config") {
Primiano Tucci13ae72f2019-06-06 10:53:02 +010063 visibility = _buildtools_visibility
Florian Mayer475bd7e2018-08-07 20:04:03 +010064 cflags = [
65 # Using -isystem instead of include_dirs (-I), so we don't need to suppress
Florian Mayerf8335662018-08-08 11:30:32 +010066 # warnings coming from libunwindstack headers. Doing so would mask warnings
67 # in our own code.
Primiano Tucci2f811552020-12-07 16:48:22 +010068 perfetto_isystem_cflag,
Florian Mayere02b2722020-11-12 10:50:43 +000069 rebase_path("android-unwinding/libunwindstack/include", root_build_dir),
Primiano Tucci2f811552020-12-07 16:48:22 +010070 perfetto_isystem_cflag,
Florian Mayere02b2722020-11-12 10:50:43 +000071 rebase_path("android-libprocinfo/include", root_build_dir),
Primiano Tucci2f811552020-12-07 16:48:22 +010072 perfetto_isystem_cflag,
Florian Mayere02b2722020-11-12 10:50:43 +000073 rebase_path("android-libbase/include", root_build_dir),
Primiano Tucci2f811552020-12-07 16:48:22 +010074 perfetto_isystem_cflag,
Florian Mayer6140f322019-01-21 15:10:17 +000075 rebase_path("android-core/demangle/include", root_build_dir),
Florian Mayer475bd7e2018-08-07 20:04:03 +010076 ]
Florian Mayerb64d6b12018-08-30 10:46:30 -070077 if (is_android) {
78 cflags += [
Primiano Tucci2f811552020-12-07 16:48:22 +010079 perfetto_isystem_cflag,
Florian Mayerb64d6b12018-08-30 10:46:30 -070080 rebase_path("bionic/libc/include", root_build_dir),
81 ]
82 }
Florian Mayer12adafd2019-03-14 21:58:00 -070083 defines = [ "NO_LIBDEXFILE_SUPPORT" ]
Florian Mayer475bd7e2018-08-07 20:04:03 +010084}
85
Primiano Tucci2a29ac72017-10-24 17:47:19 +010086# Config to include gtest.h in test targets.
Primiano Tucciae2879e2017-09-27 11:02:09 +090087config("googletest_config") {
Primiano Tucci13ae72f2019-06-06 10:53:02 +010088 visibility = _buildtools_visibility
Primiano Tucciae2879e2017-09-27 11:02:09 +090089 defines = [ "GTEST_LANG_CXX11=1" ]
Primiano Tucci919ca1e2019-08-21 20:26:58 +020090 include_dirs = [
91 "googletest/googletest/include",
92 "googletest/googlemock/include",
Primiano Tucciae2879e2017-09-27 11:02:09 +090093 ]
Primiano Tucci3cbb10a2018-04-10 17:52:40 +010094 configs = [ ":test_warning_suppressions" ]
Primiano Tucciae2879e2017-09-27 11:02:09 +090095}
96
97source_set("gtest") {
Primiano Tucci13ae72f2019-06-06 10:53:02 +010098 visibility = _buildtools_visibility
Primiano Tucciae2879e2017-09-27 11:02:09 +090099 testonly = true
100 include_dirs = [ "googletest/googletest" ]
Primiano Tucci7a40e4d2017-12-06 09:51:09 +0000101 configs -= [ "//gn/standalone:extra_warnings" ]
Primiano Tucciae2879e2017-09-27 11:02:09 +0900102 public_configs = [ ":googletest_config" ]
103 all_dependent_configs = [ ":googletest_config" ]
Primiano Tucci5e2dbac2020-01-27 10:35:27 +0000104 sources = [ "googletest/googletest/src/gtest-all.cc" ]
105 deps = [ "//gn:default_deps" ]
Primiano Tucciae2879e2017-09-27 11:02:09 +0900106}
107
108source_set("gtest_main") {
Primiano Tucci13ae72f2019-06-06 10:53:02 +0100109 visibility = _buildtools_visibility
Primiano Tucciae2879e2017-09-27 11:02:09 +0900110 testonly = true
Primiano Tucci7a40e4d2017-12-06 09:51:09 +0000111 configs -= [ "//gn/standalone:extra_warnings" ]
Primiano Tucciae2879e2017-09-27 11:02:09 +0900112 configs += [ ":googletest_config" ]
Primiano Tucci5e2dbac2020-01-27 10:35:27 +0000113 sources = [ "googletest/googletest/src/gtest_main.cc" ]
114 deps = [ "//gn:default_deps" ]
Primiano Tucciae2879e2017-09-27 11:02:09 +0900115}
116
117source_set("gmock") {
Primiano Tucci13ae72f2019-06-06 10:53:02 +0100118 visibility = _buildtools_visibility
Primiano Tucciae2879e2017-09-27 11:02:09 +0900119 testonly = true
120 include_dirs = [ "googletest/googlemock" ]
Primiano Tucci7a40e4d2017-12-06 09:51:09 +0000121 configs -= [ "//gn/standalone:extra_warnings" ]
Primiano Tucciae2879e2017-09-27 11:02:09 +0900122 public_configs = [ ":googletest_config" ]
123 all_dependent_configs = [ ":googletest_config" ]
Primiano Tucci5e2dbac2020-01-27 10:35:27 +0000124 sources = [ "googletest/googlemock/src/gmock-all.cc" ]
125 deps = [ "//gn:default_deps" ]
Primiano Tucciae2879e2017-09-27 11:02:09 +0900126}
127
Primiano Tuccifd484232017-10-25 00:15:39 +0100128# Configuration used to build libprotobuf_* and the protoc compiler.
129config("protobuf_config") {
Primiano Tucci13ae72f2019-06-06 10:53:02 +0100130 visibility = _buildtools_visibility
131
Primiano Tuccifd484232017-10-25 00:15:39 +0100132 # Apply the lighter supressions and macro definitions from above.
Joel Fernandes80fc3cd2020-04-01 18:02:57 -0400133 configs = [ "//gn:protobuf_gen_config" ]
Primiano Tuccifd484232017-10-25 00:15:39 +0100134
Primiano Tuccifd484232017-10-25 00:15:39 +0100135 defines = [ "HAVE_PTHREAD=1" ]
Primiano Tucci2f811552020-12-07 16:48:22 +0100136 cflags = []
Hector Dearmanedb3beb2017-10-09 17:53:36 +0100137 if (is_clang) {
Primiano Tucci2f811552020-12-07 16:48:22 +0100138 # We do NOT build libprotobuf with -Wextra or -Weverything. But still it
139 # hits some warnings that we need to suppress.
140 cflags += [
Primiano Tucci3cbb10a2018-04-10 17:52:40 +0100141 "-Wno-unknown-warning-option",
Primiano Tuccib60d4b02017-11-10 11:03:00 +0000142 "-Wno-enum-compare-switch",
Primiano Tuccib60d4b02017-11-10 11:03:00 +0000143 "-Wno-user-defined-warnings",
Florian Mayeraa5316b2018-08-20 17:45:12 -0700144 "-Wno-tautological-constant-compare",
Primiano Tucci2f811552020-12-07 16:48:22 +0100145 "-Wno-inconsistent-missing-override",
Primiano Tucciae2879e2017-09-27 11:02:09 +0900146 ]
Primiano Tucci2f811552020-12-07 16:48:22 +0100147 } else if (!is_win) { # implies gcc
148 cflags += [ "-Wno-return-type" ]
149 }
150 if (is_win) {
151 cflags += [ "/W0" ]
152 }
153}
154
155# Configuration propagated to targets depending on protobuf_full.
156config("protobuf_full_public_config") {
157 visibility = _buildtools_visibility
158 cflags = []
159 if (is_clang) {
160 cflags += [ "-Wno-switch-enum" ]
Primiano Tucciae2879e2017-09-27 11:02:09 +0900161 }
162}
163
164source_set("protobuf_lite") {
Primiano Tucci13ae72f2019-06-06 10:53:02 +0100165 visibility = _buildtools_visibility
Primiano Tucciae2879e2017-09-27 11:02:09 +0900166 sources = [
Primiano Tuccif550b252019-12-03 11:06:02 +0000167 "protobuf/src/google/protobuf/any_lite.cc",
Primiano Tucciae2879e2017-09-27 11:02:09 +0900168 "protobuf/src/google/protobuf/arena.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000169 "protobuf/src/google/protobuf/arena.h",
170 "protobuf/src/google/protobuf/arena_impl.h",
171 "protobuf/src/google/protobuf/arenastring.h",
Primiano Tucciae2879e2017-09-27 11:02:09 +0900172 "protobuf/src/google/protobuf/extension_set.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000173 "protobuf/src/google/protobuf/extension_set.h",
174 "protobuf/src/google/protobuf/generated_enum_util.cc",
175 "protobuf/src/google/protobuf/generated_enum_util.h",
176 "protobuf/src/google/protobuf/generated_message_table_driven_lite.cc",
177 "protobuf/src/google/protobuf/generated_message_table_driven_lite.h",
Primiano Tucciae2879e2017-09-27 11:02:09 +0900178 "protobuf/src/google/protobuf/generated_message_util.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000179 "protobuf/src/google/protobuf/generated_message_util.h",
180 "protobuf/src/google/protobuf/has_bits.h",
181 "protobuf/src/google/protobuf/implicit_weak_message.cc",
182 "protobuf/src/google/protobuf/implicit_weak_message.h",
183 "protobuf/src/google/protobuf/inlined_string_field.h",
Primiano Tucciae2879e2017-09-27 11:02:09 +0900184 "protobuf/src/google/protobuf/io/coded_stream.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000185 "protobuf/src/google/protobuf/io/coded_stream.h",
186 "protobuf/src/google/protobuf/io/coded_stream_inl.h",
187 "protobuf/src/google/protobuf/io/io_win32.cc",
188 "protobuf/src/google/protobuf/io/io_win32.h",
189 "protobuf/src/google/protobuf/io/strtod.cc",
190 "protobuf/src/google/protobuf/io/strtod.h",
Primiano Tucciae2879e2017-09-27 11:02:09 +0900191 "protobuf/src/google/protobuf/io/zero_copy_stream.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000192 "protobuf/src/google/protobuf/io/zero_copy_stream.h",
193 "protobuf/src/google/protobuf/io/zero_copy_stream_impl.cc",
194 "protobuf/src/google/protobuf/io/zero_copy_stream_impl.h",
Primiano Tucciae2879e2017-09-27 11:02:09 +0900195 "protobuf/src/google/protobuf/io/zero_copy_stream_impl_lite.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000196 "protobuf/src/google/protobuf/io/zero_copy_stream_impl_lite.h",
197 "protobuf/src/google/protobuf/map.h",
198 "protobuf/src/google/protobuf/map_entry_lite.h",
199 "protobuf/src/google/protobuf/map_field_lite.h",
200 "protobuf/src/google/protobuf/map_type_handler.h",
Primiano Tucciae2879e2017-09-27 11:02:09 +0900201 "protobuf/src/google/protobuf/message_lite.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000202 "protobuf/src/google/protobuf/message_lite.h",
Primiano Tucciae2879e2017-09-27 11:02:09 +0900203 "protobuf/src/google/protobuf/repeated_field.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000204 "protobuf/src/google/protobuf/repeated_field.h",
Primiano Tucciae2879e2017-09-27 11:02:09 +0900205 "protobuf/src/google/protobuf/stubs/bytestream.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000206 "protobuf/src/google/protobuf/stubs/bytestream.h",
207 "protobuf/src/google/protobuf/stubs/callback.h",
208 "protobuf/src/google/protobuf/stubs/casts.h",
Primiano Tucciae2879e2017-09-27 11:02:09 +0900209 "protobuf/src/google/protobuf/stubs/common.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000210 "protobuf/src/google/protobuf/stubs/common.h",
211 "protobuf/src/google/protobuf/stubs/fastmem.h",
212 "protobuf/src/google/protobuf/stubs/hash.h",
Primiano Tucciae2879e2017-09-27 11:02:09 +0900213 "protobuf/src/google/protobuf/stubs/int128.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000214 "protobuf/src/google/protobuf/stubs/int128.h",
215 "protobuf/src/google/protobuf/stubs/logging.h",
216 "protobuf/src/google/protobuf/stubs/macros.h",
217 "protobuf/src/google/protobuf/stubs/map_util.h",
218 "protobuf/src/google/protobuf/stubs/mutex.h",
219 "protobuf/src/google/protobuf/stubs/once.h",
220 "protobuf/src/google/protobuf/stubs/platform_macros.h",
221 "protobuf/src/google/protobuf/stubs/port.h",
Primiano Tucciae2879e2017-09-27 11:02:09 +0900222 "protobuf/src/google/protobuf/stubs/status.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000223 "protobuf/src/google/protobuf/stubs/status.h",
224 "protobuf/src/google/protobuf/stubs/status_macros.h",
Primiano Tucciae2879e2017-09-27 11:02:09 +0900225 "protobuf/src/google/protobuf/stubs/statusor.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000226 "protobuf/src/google/protobuf/stubs/statusor.h",
227 "protobuf/src/google/protobuf/stubs/stl_util.h",
Primiano Tucciae2879e2017-09-27 11:02:09 +0900228 "protobuf/src/google/protobuf/stubs/stringpiece.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000229 "protobuf/src/google/protobuf/stubs/stringpiece.h",
Primiano Tucciae2879e2017-09-27 11:02:09 +0900230 "protobuf/src/google/protobuf/stubs/stringprintf.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000231 "protobuf/src/google/protobuf/stubs/stringprintf.h",
Primiano Tucciae2879e2017-09-27 11:02:09 +0900232 "protobuf/src/google/protobuf/stubs/structurally_valid.cc",
233 "protobuf/src/google/protobuf/stubs/strutil.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000234 "protobuf/src/google/protobuf/stubs/strutil.h",
235 "protobuf/src/google/protobuf/stubs/template_util.h",
Primiano Tucciae2879e2017-09-27 11:02:09 +0900236 "protobuf/src/google/protobuf/stubs/time.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000237 "protobuf/src/google/protobuf/stubs/time.h",
Primiano Tucciae2879e2017-09-27 11:02:09 +0900238 "protobuf/src/google/protobuf/wire_format_lite.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000239 "protobuf/src/google/protobuf/wire_format_lite.h",
Primiano Tucciae2879e2017-09-27 11:02:09 +0900240 ]
Primiano Tucci7a40e4d2017-12-06 09:51:09 +0000241 configs -= [ "//gn/standalone:extra_warnings" ]
Primiano Tucci2f811552020-12-07 16:48:22 +0100242 if (is_win) {
243 # Protobuf has its own #define WIN32_LEAN_AND_MEAN.
244 configs -= [ "//gn/standalone:win32_lean_and_mean" ]
245 }
Primiano Tucci3cbb10a2018-04-10 17:52:40 +0100246 configs += [ ":protobuf_config" ]
Joel Fernandes80fc3cd2020-04-01 18:02:57 -0400247 public_configs = [ "//gn:protobuf_gen_config" ]
Primiano Tucci5e2dbac2020-01-27 10:35:27 +0000248 deps = [ "//gn:default_deps" ]
Primiano Tucciae2879e2017-09-27 11:02:09 +0900249}
250
251source_set("protobuf_full") {
Primiano Tucci13ae72f2019-06-06 10:53:02 +0100252 visibility = _buildtools_visibility
Oystein Eftevaagdd727e42017-12-05 08:49:55 -0800253 deps = [
254 ":protobuf_lite",
Florian Mayera85b8fa2019-07-11 11:00:48 +0100255 "//gn:default_deps",
Oystein Eftevaagdd727e42017-12-05 08:49:55 -0800256 ]
Primiano Tucciae2879e2017-09-27 11:02:09 +0900257 sources = [
258 "protobuf/src/google/protobuf/any.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000259 "protobuf/src/google/protobuf/any.h",
Primiano Tucciae2879e2017-09-27 11:02:09 +0900260 "protobuf/src/google/protobuf/any.pb.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000261 "protobuf/src/google/protobuf/any.pb.h",
Primiano Tucciae2879e2017-09-27 11:02:09 +0900262 "protobuf/src/google/protobuf/api.pb.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000263 "protobuf/src/google/protobuf/api.pb.h",
Primiano Tucciae2879e2017-09-27 11:02:09 +0900264 "protobuf/src/google/protobuf/compiler/importer.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000265 "protobuf/src/google/protobuf/compiler/importer.h",
Primiano Tucciae2879e2017-09-27 11:02:09 +0900266 "protobuf/src/google/protobuf/compiler/parser.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000267 "protobuf/src/google/protobuf/compiler/parser.h",
Primiano Tucciae2879e2017-09-27 11:02:09 +0900268 "protobuf/src/google/protobuf/descriptor.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000269 "protobuf/src/google/protobuf/descriptor.h",
Primiano Tucciae2879e2017-09-27 11:02:09 +0900270 "protobuf/src/google/protobuf/descriptor.pb.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000271 "protobuf/src/google/protobuf/descriptor.pb.h",
Primiano Tucciae2879e2017-09-27 11:02:09 +0900272 "protobuf/src/google/protobuf/descriptor_database.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000273 "protobuf/src/google/protobuf/descriptor_database.h",
Primiano Tucciae2879e2017-09-27 11:02:09 +0900274 "protobuf/src/google/protobuf/duration.pb.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000275 "protobuf/src/google/protobuf/duration.pb.h",
Primiano Tucciae2879e2017-09-27 11:02:09 +0900276 "protobuf/src/google/protobuf/dynamic_message.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000277 "protobuf/src/google/protobuf/dynamic_message.h",
Primiano Tucciae2879e2017-09-27 11:02:09 +0900278 "protobuf/src/google/protobuf/empty.pb.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000279 "protobuf/src/google/protobuf/empty.pb.h",
Primiano Tucciae2879e2017-09-27 11:02:09 +0900280 "protobuf/src/google/protobuf/extension_set_heavy.cc",
281 "protobuf/src/google/protobuf/field_mask.pb.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000282 "protobuf/src/google/protobuf/field_mask.pb.h",
283 "protobuf/src/google/protobuf/generated_enum_reflection.h",
Primiano Tucciae2879e2017-09-27 11:02:09 +0900284 "protobuf/src/google/protobuf/generated_message_reflection.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000285 "protobuf/src/google/protobuf/generated_message_reflection.h",
Primiano Tucciae2879e2017-09-27 11:02:09 +0900286 "protobuf/src/google/protobuf/io/gzip_stream.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000287 "protobuf/src/google/protobuf/io/gzip_stream.h",
Primiano Tucciae2879e2017-09-27 11:02:09 +0900288 "protobuf/src/google/protobuf/io/printer.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000289 "protobuf/src/google/protobuf/io/printer.h",
Primiano Tucciae2879e2017-09-27 11:02:09 +0900290 "protobuf/src/google/protobuf/io/tokenizer.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000291 "protobuf/src/google/protobuf/io/tokenizer.h",
292 "protobuf/src/google/protobuf/map_entry.h",
Primiano Tucciae2879e2017-09-27 11:02:09 +0900293 "protobuf/src/google/protobuf/map_field.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000294 "protobuf/src/google/protobuf/map_field.h",
295 "protobuf/src/google/protobuf/map_field_inl.h",
Primiano Tucciae2879e2017-09-27 11:02:09 +0900296 "protobuf/src/google/protobuf/message.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000297 "protobuf/src/google/protobuf/message.h",
298 "protobuf/src/google/protobuf/metadata.h",
299 "protobuf/src/google/protobuf/reflection.h",
300 "protobuf/src/google/protobuf/reflection_internal.h",
Primiano Tucciae2879e2017-09-27 11:02:09 +0900301 "protobuf/src/google/protobuf/reflection_ops.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000302 "protobuf/src/google/protobuf/reflection_ops.h",
Primiano Tucciae2879e2017-09-27 11:02:09 +0900303 "protobuf/src/google/protobuf/service.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000304 "protobuf/src/google/protobuf/service.h",
Primiano Tucciae2879e2017-09-27 11:02:09 +0900305 "protobuf/src/google/protobuf/source_context.pb.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000306 "protobuf/src/google/protobuf/source_context.pb.h",
Primiano Tucciae2879e2017-09-27 11:02:09 +0900307 "protobuf/src/google/protobuf/struct.pb.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000308 "protobuf/src/google/protobuf/struct.pb.h",
Primiano Tucciae2879e2017-09-27 11:02:09 +0900309 "protobuf/src/google/protobuf/stubs/mathlimits.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000310 "protobuf/src/google/protobuf/stubs/mathlimits.h",
311 "protobuf/src/google/protobuf/stubs/mathutil.h",
Primiano Tucciae2879e2017-09-27 11:02:09 +0900312 "protobuf/src/google/protobuf/stubs/substitute.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000313 "protobuf/src/google/protobuf/stubs/substitute.h",
Primiano Tucciae2879e2017-09-27 11:02:09 +0900314 "protobuf/src/google/protobuf/text_format.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000315 "protobuf/src/google/protobuf/text_format.h",
Primiano Tucciae2879e2017-09-27 11:02:09 +0900316 "protobuf/src/google/protobuf/timestamp.pb.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000317 "protobuf/src/google/protobuf/timestamp.pb.h",
Primiano Tucciae2879e2017-09-27 11:02:09 +0900318 "protobuf/src/google/protobuf/type.pb.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000319 "protobuf/src/google/protobuf/type.pb.h",
Primiano Tucciae2879e2017-09-27 11:02:09 +0900320 "protobuf/src/google/protobuf/unknown_field_set.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000321 "protobuf/src/google/protobuf/unknown_field_set.h",
Primiano Tucciae2879e2017-09-27 11:02:09 +0900322 "protobuf/src/google/protobuf/util/field_comparator.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000323 "protobuf/src/google/protobuf/util/field_comparator.h",
Primiano Tucciae2879e2017-09-27 11:02:09 +0900324 "protobuf/src/google/protobuf/util/field_mask_util.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000325 "protobuf/src/google/protobuf/util/field_mask_util.h",
326 "protobuf/src/google/protobuf/util/internal/constants.h",
Primiano Tucciae2879e2017-09-27 11:02:09 +0900327 "protobuf/src/google/protobuf/util/internal/datapiece.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000328 "protobuf/src/google/protobuf/util/internal/datapiece.h",
Primiano Tucciae2879e2017-09-27 11:02:09 +0900329 "protobuf/src/google/protobuf/util/internal/default_value_objectwriter.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000330 "protobuf/src/google/protobuf/util/internal/default_value_objectwriter.h",
Primiano Tucciae2879e2017-09-27 11:02:09 +0900331 "protobuf/src/google/protobuf/util/internal/error_listener.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000332 "protobuf/src/google/protobuf/util/internal/error_listener.h",
Primiano Tucciae2879e2017-09-27 11:02:09 +0900333 "protobuf/src/google/protobuf/util/internal/field_mask_utility.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000334 "protobuf/src/google/protobuf/util/internal/field_mask_utility.h",
Primiano Tucciae2879e2017-09-27 11:02:09 +0900335 "protobuf/src/google/protobuf/util/internal/json_escaping.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000336 "protobuf/src/google/protobuf/util/internal/json_escaping.h",
Primiano Tucciae2879e2017-09-27 11:02:09 +0900337 "protobuf/src/google/protobuf/util/internal/json_objectwriter.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000338 "protobuf/src/google/protobuf/util/internal/json_objectwriter.h",
Primiano Tucciae2879e2017-09-27 11:02:09 +0900339 "protobuf/src/google/protobuf/util/internal/json_stream_parser.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000340 "protobuf/src/google/protobuf/util/internal/json_stream_parser.h",
341 "protobuf/src/google/protobuf/util/internal/location_tracker.h",
342 "protobuf/src/google/protobuf/util/internal/object_location_tracker.h",
343 "protobuf/src/google/protobuf/util/internal/object_source.h",
Primiano Tucciae2879e2017-09-27 11:02:09 +0900344 "protobuf/src/google/protobuf/util/internal/object_writer.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000345 "protobuf/src/google/protobuf/util/internal/object_writer.h",
Primiano Tucciae2879e2017-09-27 11:02:09 +0900346 "protobuf/src/google/protobuf/util/internal/proto_writer.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000347 "protobuf/src/google/protobuf/util/internal/proto_writer.h",
Primiano Tucciae2879e2017-09-27 11:02:09 +0900348 "protobuf/src/google/protobuf/util/internal/protostream_objectsource.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000349 "protobuf/src/google/protobuf/util/internal/protostream_objectsource.h",
Primiano Tucciae2879e2017-09-27 11:02:09 +0900350 "protobuf/src/google/protobuf/util/internal/protostream_objectwriter.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000351 "protobuf/src/google/protobuf/util/internal/protostream_objectwriter.h",
352 "protobuf/src/google/protobuf/util/internal/structured_objectwriter.h",
Primiano Tucciae2879e2017-09-27 11:02:09 +0900353 "protobuf/src/google/protobuf/util/internal/type_info.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000354 "protobuf/src/google/protobuf/util/internal/type_info.h",
Primiano Tucciae2879e2017-09-27 11:02:09 +0900355 "protobuf/src/google/protobuf/util/internal/type_info_test_helper.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000356 "protobuf/src/google/protobuf/util/internal/type_info_test_helper.h",
Primiano Tucciae2879e2017-09-27 11:02:09 +0900357 "protobuf/src/google/protobuf/util/internal/utility.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000358 "protobuf/src/google/protobuf/util/internal/utility.h",
Primiano Tucciae2879e2017-09-27 11:02:09 +0900359 "protobuf/src/google/protobuf/util/json_util.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000360 "protobuf/src/google/protobuf/util/json_util.h",
Primiano Tucciae2879e2017-09-27 11:02:09 +0900361 "protobuf/src/google/protobuf/util/message_differencer.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000362 "protobuf/src/google/protobuf/util/message_differencer.h",
Primiano Tucciae2879e2017-09-27 11:02:09 +0900363 "protobuf/src/google/protobuf/util/time_util.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000364 "protobuf/src/google/protobuf/util/time_util.h",
365 "protobuf/src/google/protobuf/util/type_resolver.h",
Primiano Tucciae2879e2017-09-27 11:02:09 +0900366 "protobuf/src/google/protobuf/util/type_resolver_util.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000367 "protobuf/src/google/protobuf/util/type_resolver_util.h",
Primiano Tucciae2879e2017-09-27 11:02:09 +0900368 "protobuf/src/google/protobuf/wire_format.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000369 "protobuf/src/google/protobuf/wire_format.h",
Primiano Tucciae2879e2017-09-27 11:02:09 +0900370 "protobuf/src/google/protobuf/wrappers.pb.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000371 "protobuf/src/google/protobuf/wrappers.pb.h",
Primiano Tucciae2879e2017-09-27 11:02:09 +0900372 ]
Primiano Tucci7a40e4d2017-12-06 09:51:09 +0000373 configs -= [ "//gn/standalone:extra_warnings" ]
Primiano Tucci2f811552020-12-07 16:48:22 +0100374 if (is_win) {
375 # Protobuf has its own #define WIN32_LEAN_AND_MEAN.
376 configs -= [ "//gn/standalone:win32_lean_and_mean" ]
377 }
Primiano Tucci3cbb10a2018-04-10 17:52:40 +0100378 configs += [ ":protobuf_config" ]
Primiano Tucci2f811552020-12-07 16:48:22 +0100379 public_configs = [
380 "//gn:protobuf_gen_config",
381 ":protobuf_full_public_config",
382 ]
Primiano Tucciae2879e2017-09-27 11:02:09 +0900383}
384
Primiano Tuccid0001c32019-09-08 22:45:58 -0700385source_set("protoc_lib") {
386 visibility = _buildtools_visibility
387 deps = [
388 ":protobuf_full",
389 "//gn:default_deps",
390 ]
391 sources = [
392 "protobuf/src/google/protobuf/compiler/code_generator.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000393 "protobuf/src/google/protobuf/compiler/code_generator.h",
Primiano Tuccid0001c32019-09-08 22:45:58 -0700394 "protobuf/src/google/protobuf/compiler/command_line_interface.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000395 "protobuf/src/google/protobuf/compiler/command_line_interface.h",
Primiano Tuccid0001c32019-09-08 22:45:58 -0700396 "protobuf/src/google/protobuf/compiler/cpp/cpp_enum.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000397 "protobuf/src/google/protobuf/compiler/cpp/cpp_enum.h",
Primiano Tuccid0001c32019-09-08 22:45:58 -0700398 "protobuf/src/google/protobuf/compiler/cpp/cpp_enum_field.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000399 "protobuf/src/google/protobuf/compiler/cpp/cpp_enum_field.h",
Primiano Tuccid0001c32019-09-08 22:45:58 -0700400 "protobuf/src/google/protobuf/compiler/cpp/cpp_extension.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000401 "protobuf/src/google/protobuf/compiler/cpp/cpp_extension.h",
Primiano Tuccid0001c32019-09-08 22:45:58 -0700402 "protobuf/src/google/protobuf/compiler/cpp/cpp_field.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000403 "protobuf/src/google/protobuf/compiler/cpp/cpp_field.h",
Primiano Tuccid0001c32019-09-08 22:45:58 -0700404 "protobuf/src/google/protobuf/compiler/cpp/cpp_file.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000405 "protobuf/src/google/protobuf/compiler/cpp/cpp_file.h",
Primiano Tuccid0001c32019-09-08 22:45:58 -0700406 "protobuf/src/google/protobuf/compiler/cpp/cpp_generator.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000407 "protobuf/src/google/protobuf/compiler/cpp/cpp_generator.h",
Primiano Tuccid0001c32019-09-08 22:45:58 -0700408 "protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000409 "protobuf/src/google/protobuf/compiler/cpp/cpp_helpers.h",
Primiano Tuccid0001c32019-09-08 22:45:58 -0700410 "protobuf/src/google/protobuf/compiler/cpp/cpp_map_field.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000411 "protobuf/src/google/protobuf/compiler/cpp/cpp_map_field.h",
Primiano Tuccid0001c32019-09-08 22:45:58 -0700412 "protobuf/src/google/protobuf/compiler/cpp/cpp_message.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000413 "protobuf/src/google/protobuf/compiler/cpp/cpp_message.h",
Primiano Tuccid0001c32019-09-08 22:45:58 -0700414 "protobuf/src/google/protobuf/compiler/cpp/cpp_message_field.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000415 "protobuf/src/google/protobuf/compiler/cpp/cpp_message_field.h",
416 "protobuf/src/google/protobuf/compiler/cpp/cpp_message_layout_helper.h",
417 "protobuf/src/google/protobuf/compiler/cpp/cpp_options.h",
418 "protobuf/src/google/protobuf/compiler/cpp/cpp_padding_optimizer.cc",
419 "protobuf/src/google/protobuf/compiler/cpp/cpp_padding_optimizer.h",
Primiano Tuccid0001c32019-09-08 22:45:58 -0700420 "protobuf/src/google/protobuf/compiler/cpp/cpp_primitive_field.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000421 "protobuf/src/google/protobuf/compiler/cpp/cpp_primitive_field.h",
Primiano Tuccid0001c32019-09-08 22:45:58 -0700422 "protobuf/src/google/protobuf/compiler/cpp/cpp_service.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000423 "protobuf/src/google/protobuf/compiler/cpp/cpp_service.h",
Primiano Tuccid0001c32019-09-08 22:45:58 -0700424 "protobuf/src/google/protobuf/compiler/cpp/cpp_string_field.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000425 "protobuf/src/google/protobuf/compiler/cpp/cpp_string_field.h",
Primiano Tuccid0001c32019-09-08 22:45:58 -0700426 "protobuf/src/google/protobuf/compiler/csharp/csharp_doc_comment.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000427 "protobuf/src/google/protobuf/compiler/csharp/csharp_doc_comment.h",
Primiano Tuccid0001c32019-09-08 22:45:58 -0700428 "protobuf/src/google/protobuf/compiler/csharp/csharp_enum.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000429 "protobuf/src/google/protobuf/compiler/csharp/csharp_enum.h",
Primiano Tuccid0001c32019-09-08 22:45:58 -0700430 "protobuf/src/google/protobuf/compiler/csharp/csharp_enum_field.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000431 "protobuf/src/google/protobuf/compiler/csharp/csharp_enum_field.h",
Primiano Tuccid0001c32019-09-08 22:45:58 -0700432 "protobuf/src/google/protobuf/compiler/csharp/csharp_field_base.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000433 "protobuf/src/google/protobuf/compiler/csharp/csharp_field_base.h",
Primiano Tuccid0001c32019-09-08 22:45:58 -0700434 "protobuf/src/google/protobuf/compiler/csharp/csharp_generator.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000435 "protobuf/src/google/protobuf/compiler/csharp/csharp_generator.h",
Primiano Tuccid0001c32019-09-08 22:45:58 -0700436 "protobuf/src/google/protobuf/compiler/csharp/csharp_helpers.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000437 "protobuf/src/google/protobuf/compiler/csharp/csharp_helpers.h",
Primiano Tuccid0001c32019-09-08 22:45:58 -0700438 "protobuf/src/google/protobuf/compiler/csharp/csharp_map_field.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000439 "protobuf/src/google/protobuf/compiler/csharp/csharp_map_field.h",
Primiano Tuccid0001c32019-09-08 22:45:58 -0700440 "protobuf/src/google/protobuf/compiler/csharp/csharp_message.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000441 "protobuf/src/google/protobuf/compiler/csharp/csharp_message.h",
Primiano Tuccid0001c32019-09-08 22:45:58 -0700442 "protobuf/src/google/protobuf/compiler/csharp/csharp_message_field.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000443 "protobuf/src/google/protobuf/compiler/csharp/csharp_message_field.h",
444 "protobuf/src/google/protobuf/compiler/csharp/csharp_options.h",
Primiano Tuccid0001c32019-09-08 22:45:58 -0700445 "protobuf/src/google/protobuf/compiler/csharp/csharp_primitive_field.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000446 "protobuf/src/google/protobuf/compiler/csharp/csharp_primitive_field.h",
Primiano Tuccid0001c32019-09-08 22:45:58 -0700447 "protobuf/src/google/protobuf/compiler/csharp/csharp_reflection_class.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000448 "protobuf/src/google/protobuf/compiler/csharp/csharp_reflection_class.h",
Primiano Tuccid0001c32019-09-08 22:45:58 -0700449 "protobuf/src/google/protobuf/compiler/csharp/csharp_repeated_enum_field.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000450 "protobuf/src/google/protobuf/compiler/csharp/csharp_repeated_enum_field.h",
Primiano Tuccid0001c32019-09-08 22:45:58 -0700451 "protobuf/src/google/protobuf/compiler/csharp/csharp_repeated_message_field.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000452 "protobuf/src/google/protobuf/compiler/csharp/csharp_repeated_message_field.h",
Primiano Tuccid0001c32019-09-08 22:45:58 -0700453 "protobuf/src/google/protobuf/compiler/csharp/csharp_repeated_primitive_field.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000454 "protobuf/src/google/protobuf/compiler/csharp/csharp_repeated_primitive_field.h",
Primiano Tuccid0001c32019-09-08 22:45:58 -0700455 "protobuf/src/google/protobuf/compiler/csharp/csharp_source_generator_base.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000456 "protobuf/src/google/protobuf/compiler/csharp/csharp_source_generator_base.h",
Primiano Tuccid0001c32019-09-08 22:45:58 -0700457 "protobuf/src/google/protobuf/compiler/csharp/csharp_wrapper_field.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000458 "protobuf/src/google/protobuf/compiler/csharp/csharp_wrapper_field.h",
Primiano Tuccid0001c32019-09-08 22:45:58 -0700459 "protobuf/src/google/protobuf/compiler/java/java_context.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000460 "protobuf/src/google/protobuf/compiler/java/java_context.h",
Primiano Tuccid0001c32019-09-08 22:45:58 -0700461 "protobuf/src/google/protobuf/compiler/java/java_doc_comment.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000462 "protobuf/src/google/protobuf/compiler/java/java_doc_comment.h",
Primiano Tuccid0001c32019-09-08 22:45:58 -0700463 "protobuf/src/google/protobuf/compiler/java/java_enum.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000464 "protobuf/src/google/protobuf/compiler/java/java_enum.h",
Primiano Tuccid0001c32019-09-08 22:45:58 -0700465 "protobuf/src/google/protobuf/compiler/java/java_enum_field.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000466 "protobuf/src/google/protobuf/compiler/java/java_enum_field.h",
Primiano Tuccid0001c32019-09-08 22:45:58 -0700467 "protobuf/src/google/protobuf/compiler/java/java_enum_field_lite.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000468 "protobuf/src/google/protobuf/compiler/java/java_enum_field_lite.h",
Primiano Tuccid0001c32019-09-08 22:45:58 -0700469 "protobuf/src/google/protobuf/compiler/java/java_enum_lite.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000470 "protobuf/src/google/protobuf/compiler/java/java_enum_lite.h",
Primiano Tuccid0001c32019-09-08 22:45:58 -0700471 "protobuf/src/google/protobuf/compiler/java/java_extension.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000472 "protobuf/src/google/protobuf/compiler/java/java_extension.h",
Primiano Tuccid0001c32019-09-08 22:45:58 -0700473 "protobuf/src/google/protobuf/compiler/java/java_extension_lite.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000474 "protobuf/src/google/protobuf/compiler/java/java_extension_lite.h",
Primiano Tuccid0001c32019-09-08 22:45:58 -0700475 "protobuf/src/google/protobuf/compiler/java/java_field.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000476 "protobuf/src/google/protobuf/compiler/java/java_field.h",
Primiano Tuccid0001c32019-09-08 22:45:58 -0700477 "protobuf/src/google/protobuf/compiler/java/java_file.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000478 "protobuf/src/google/protobuf/compiler/java/java_file.h",
Primiano Tuccid0001c32019-09-08 22:45:58 -0700479 "protobuf/src/google/protobuf/compiler/java/java_generator.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000480 "protobuf/src/google/protobuf/compiler/java/java_generator.h",
Primiano Tuccid0001c32019-09-08 22:45:58 -0700481 "protobuf/src/google/protobuf/compiler/java/java_generator_factory.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000482 "protobuf/src/google/protobuf/compiler/java/java_generator_factory.h",
Primiano Tuccid0001c32019-09-08 22:45:58 -0700483 "protobuf/src/google/protobuf/compiler/java/java_helpers.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000484 "protobuf/src/google/protobuf/compiler/java/java_helpers.h",
Primiano Tuccid0001c32019-09-08 22:45:58 -0700485 "protobuf/src/google/protobuf/compiler/java/java_map_field.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000486 "protobuf/src/google/protobuf/compiler/java/java_map_field.h",
Primiano Tuccid0001c32019-09-08 22:45:58 -0700487 "protobuf/src/google/protobuf/compiler/java/java_map_field_lite.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000488 "protobuf/src/google/protobuf/compiler/java/java_map_field_lite.h",
Primiano Tuccid0001c32019-09-08 22:45:58 -0700489 "protobuf/src/google/protobuf/compiler/java/java_message.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000490 "protobuf/src/google/protobuf/compiler/java/java_message.h",
Primiano Tuccid0001c32019-09-08 22:45:58 -0700491 "protobuf/src/google/protobuf/compiler/java/java_message_builder.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000492 "protobuf/src/google/protobuf/compiler/java/java_message_builder.h",
Primiano Tuccid0001c32019-09-08 22:45:58 -0700493 "protobuf/src/google/protobuf/compiler/java/java_message_builder_lite.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000494 "protobuf/src/google/protobuf/compiler/java/java_message_builder_lite.h",
Primiano Tuccid0001c32019-09-08 22:45:58 -0700495 "protobuf/src/google/protobuf/compiler/java/java_message_field.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000496 "protobuf/src/google/protobuf/compiler/java/java_message_field.h",
Primiano Tuccid0001c32019-09-08 22:45:58 -0700497 "protobuf/src/google/protobuf/compiler/java/java_message_field_lite.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000498 "protobuf/src/google/protobuf/compiler/java/java_message_field_lite.h",
Primiano Tuccid0001c32019-09-08 22:45:58 -0700499 "protobuf/src/google/protobuf/compiler/java/java_message_lite.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000500 "protobuf/src/google/protobuf/compiler/java/java_message_lite.h",
Primiano Tuccid0001c32019-09-08 22:45:58 -0700501 "protobuf/src/google/protobuf/compiler/java/java_name_resolver.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000502 "protobuf/src/google/protobuf/compiler/java/java_name_resolver.h",
503 "protobuf/src/google/protobuf/compiler/java/java_options.h",
Primiano Tuccid0001c32019-09-08 22:45:58 -0700504 "protobuf/src/google/protobuf/compiler/java/java_primitive_field.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000505 "protobuf/src/google/protobuf/compiler/java/java_primitive_field.h",
Primiano Tuccid0001c32019-09-08 22:45:58 -0700506 "protobuf/src/google/protobuf/compiler/java/java_primitive_field_lite.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000507 "protobuf/src/google/protobuf/compiler/java/java_primitive_field_lite.h",
Primiano Tuccid0001c32019-09-08 22:45:58 -0700508 "protobuf/src/google/protobuf/compiler/java/java_service.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000509 "protobuf/src/google/protobuf/compiler/java/java_service.h",
Primiano Tuccid0001c32019-09-08 22:45:58 -0700510 "protobuf/src/google/protobuf/compiler/java/java_shared_code_generator.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000511 "protobuf/src/google/protobuf/compiler/java/java_shared_code_generator.h",
Primiano Tuccid0001c32019-09-08 22:45:58 -0700512 "protobuf/src/google/protobuf/compiler/java/java_string_field.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000513 "protobuf/src/google/protobuf/compiler/java/java_string_field.h",
Primiano Tuccid0001c32019-09-08 22:45:58 -0700514 "protobuf/src/google/protobuf/compiler/java/java_string_field_lite.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000515 "protobuf/src/google/protobuf/compiler/java/java_string_field_lite.h",
Primiano Tuccid0001c32019-09-08 22:45:58 -0700516 "protobuf/src/google/protobuf/compiler/js/js_generator.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000517 "protobuf/src/google/protobuf/compiler/js/js_generator.h",
518 "protobuf/src/google/protobuf/compiler/js/well_known_types_embed.cc",
519 "protobuf/src/google/protobuf/compiler/js/well_known_types_embed.h",
Primiano Tuccid0001c32019-09-08 22:45:58 -0700520 "protobuf/src/google/protobuf/compiler/objectivec/objectivec_enum.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000521 "protobuf/src/google/protobuf/compiler/objectivec/objectivec_enum.h",
Primiano Tuccid0001c32019-09-08 22:45:58 -0700522 "protobuf/src/google/protobuf/compiler/objectivec/objectivec_enum_field.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000523 "protobuf/src/google/protobuf/compiler/objectivec/objectivec_enum_field.h",
Primiano Tuccid0001c32019-09-08 22:45:58 -0700524 "protobuf/src/google/protobuf/compiler/objectivec/objectivec_extension.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000525 "protobuf/src/google/protobuf/compiler/objectivec/objectivec_extension.h",
Primiano Tuccid0001c32019-09-08 22:45:58 -0700526 "protobuf/src/google/protobuf/compiler/objectivec/objectivec_field.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000527 "protobuf/src/google/protobuf/compiler/objectivec/objectivec_field.h",
Primiano Tuccid0001c32019-09-08 22:45:58 -0700528 "protobuf/src/google/protobuf/compiler/objectivec/objectivec_file.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000529 "protobuf/src/google/protobuf/compiler/objectivec/objectivec_file.h",
Primiano Tuccid0001c32019-09-08 22:45:58 -0700530 "protobuf/src/google/protobuf/compiler/objectivec/objectivec_generator.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000531 "protobuf/src/google/protobuf/compiler/objectivec/objectivec_generator.h",
Primiano Tuccid0001c32019-09-08 22:45:58 -0700532 "protobuf/src/google/protobuf/compiler/objectivec/objectivec_helpers.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000533 "protobuf/src/google/protobuf/compiler/objectivec/objectivec_helpers.h",
Primiano Tuccid0001c32019-09-08 22:45:58 -0700534 "protobuf/src/google/protobuf/compiler/objectivec/objectivec_map_field.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000535 "protobuf/src/google/protobuf/compiler/objectivec/objectivec_map_field.h",
Primiano Tuccid0001c32019-09-08 22:45:58 -0700536 "protobuf/src/google/protobuf/compiler/objectivec/objectivec_message.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000537 "protobuf/src/google/protobuf/compiler/objectivec/objectivec_message.h",
Primiano Tuccid0001c32019-09-08 22:45:58 -0700538 "protobuf/src/google/protobuf/compiler/objectivec/objectivec_message_field.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000539 "protobuf/src/google/protobuf/compiler/objectivec/objectivec_message_field.h",
Primiano Tuccid0001c32019-09-08 22:45:58 -0700540 "protobuf/src/google/protobuf/compiler/objectivec/objectivec_oneof.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000541 "protobuf/src/google/protobuf/compiler/objectivec/objectivec_oneof.h",
Primiano Tuccid0001c32019-09-08 22:45:58 -0700542 "protobuf/src/google/protobuf/compiler/objectivec/objectivec_primitive_field.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000543 "protobuf/src/google/protobuf/compiler/objectivec/objectivec_primitive_field.h",
544 "protobuf/src/google/protobuf/compiler/php/php_generator.cc",
545 "protobuf/src/google/protobuf/compiler/php/php_generator.h",
Primiano Tuccid0001c32019-09-08 22:45:58 -0700546 "protobuf/src/google/protobuf/compiler/plugin.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000547 "protobuf/src/google/protobuf/compiler/plugin.h",
Primiano Tuccid0001c32019-09-08 22:45:58 -0700548 "protobuf/src/google/protobuf/compiler/plugin.pb.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000549 "protobuf/src/google/protobuf/compiler/plugin.pb.h",
Primiano Tuccid0001c32019-09-08 22:45:58 -0700550 "protobuf/src/google/protobuf/compiler/python/python_generator.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000551 "protobuf/src/google/protobuf/compiler/python/python_generator.h",
Primiano Tuccid0001c32019-09-08 22:45:58 -0700552 "protobuf/src/google/protobuf/compiler/ruby/ruby_generator.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000553 "protobuf/src/google/protobuf/compiler/ruby/ruby_generator.h",
Primiano Tuccid0001c32019-09-08 22:45:58 -0700554 "protobuf/src/google/protobuf/compiler/subprocess.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000555 "protobuf/src/google/protobuf/compiler/subprocess.h",
Primiano Tuccid0001c32019-09-08 22:45:58 -0700556 "protobuf/src/google/protobuf/compiler/zip_writer.cc",
Primiano Tuccif550b252019-12-03 11:06:02 +0000557 "protobuf/src/google/protobuf/compiler/zip_writer.h",
Primiano Tuccid0001c32019-09-08 22:45:58 -0700558 ]
559 configs -= [ "//gn/standalone:extra_warnings" ]
Primiano Tucci2f811552020-12-07 16:48:22 +0100560 if (is_win) {
561 # Protobuf does has its own #define WIN32_LEAN_AND_MEAN.
562 configs -= [ "//gn/standalone:win32_lean_and_mean" ]
563 }
Primiano Tuccid0001c32019-09-08 22:45:58 -0700564 configs += [ ":protobuf_config" ]
Primiano Tucci2f811552020-12-07 16:48:22 +0100565 public_configs = [
566 "//gn:protobuf_gen_config",
567 ":protobuf_full_public_config",
568 ]
Primiano Tuccid0001c32019-09-08 22:45:58 -0700569}
Primiano Tuccifd484232017-10-25 00:15:39 +0100570
Primiano Tuccid0001c32019-09-08 22:45:58 -0700571if (current_toolchain == host_toolchain) {
Primiano Tuccifd484232017-10-25 00:15:39 +0100572 executable("protoc") {
Primiano Tucci13ae72f2019-06-06 10:53:02 +0100573 visibility = _buildtools_visibility
Oystein Eftevaagdd727e42017-12-05 08:49:55 -0800574 deps = [
575 ":protoc_lib",
Primiano Tucci3cbb10a2018-04-10 17:52:40 +0100576 "//gn:default_deps",
Oystein Eftevaagdd727e42017-12-05 08:49:55 -0800577 ]
Primiano Tucci5e2dbac2020-01-27 10:35:27 +0000578 sources = [ "protobuf/src/google/protobuf/compiler/main.cc" ]
Primiano Tucci7a40e4d2017-12-06 09:51:09 +0000579 configs -= [ "//gn/standalone:extra_warnings" ]
Primiano Tucci2f811552020-12-07 16:48:22 +0100580 if (is_win) {
581 # Protobuf does has its own #define WIN32_LEAN_AND_MEAN.
582 configs -= [ "//gn/standalone:win32_lean_and_mean" ]
583 }
Primiano Tuccifd484232017-10-25 00:15:39 +0100584 }
Primiano Tucciae2879e2017-09-27 11:02:09 +0900585} # host_toolchain
Primiano Tucci0825bc82017-09-28 18:50:23 +0100586
587if (use_custom_libcxx) {
588 # Config applied to both libc++ and libc++abi targets below.
589 config("libc++config") {
Primiano Tucci13ae72f2019-06-06 10:53:02 +0100590 visibility = _buildtools_visibility
Primiano Tucci0825bc82017-09-28 18:50:23 +0100591 defines = [
592 "LIBCXX_BUILDING_LIBCXXABI",
593 "_LIBCXXABI_NO_EXCEPTIONS",
594 "_LIBCPP_OVERRIDABLE_FUNC_VIS=__attribute__((__visibility__(\"default\")))",
595 ]
Primiano Tucci2f811552020-12-07 16:48:22 +0100596 cflags = [ "-fstrict-aliasing" ]
Primiano Tucci0825bc82017-09-28 18:50:23 +0100597 }
598
Primiano Tucci7278dea2017-10-31 11:50:32 +0000599 source_set("libunwind") {
Primiano Tucci13ae72f2019-06-06 10:53:02 +0100600 visibility = _buildtools_visibility
Primiano Tucci4e8d6c92020-09-23 14:40:33 +0200601 cflags = [
602 # libunwind expects to be compiled with unwind tables so it can
603 # unwind its own frames.
604 "-funwind-tables",
605 "-fstrict-aliasing",
606 ]
Primiano Tucci7278dea2017-10-31 11:50:32 +0000607 sources = [
608 "libunwind/src/Unwind-EHABI.cpp",
609 "libunwind/src/Unwind-sjlj.c",
610 "libunwind/src/UnwindLevel1-gcc-ext.c",
611 "libunwind/src/UnwindLevel1.c",
612 "libunwind/src/UnwindRegistersRestore.S",
613 "libunwind/src/UnwindRegistersSave.S",
614 "libunwind/src/libunwind.cpp",
615 ]
616 include_dirs = [ "libunwind/include" ]
617 configs -= [
Primiano Tucci7a40e4d2017-12-06 09:51:09 +0000618 "//gn/standalone:extra_warnings",
619 "//gn/standalone:no_exceptions",
620 "//gn/standalone:no_rtti",
Primiano Tucci7278dea2017-10-31 11:50:32 +0000621
622 # When building with msan, libunwind itself triggers memory violations
623 # that causes msan to get stuck into an infinite loop. Just don't
624 # instrument libunwind itself.
Primiano Tucci7a40e4d2017-12-06 09:51:09 +0000625 "//gn/standalone/sanitizers:sanitizers_cflags",
Primiano Tucci7278dea2017-10-31 11:50:32 +0000626 ]
627 configs += [
628 ":libc++config",
Primiano Tucci7a40e4d2017-12-06 09:51:09 +0000629 "//gn/standalone/sanitizers:sanitizer_options_link_helper",
Primiano Tucci7278dea2017-10-31 11:50:32 +0000630 ]
631 }
632
Primiano Tucci0825bc82017-09-28 18:50:23 +0100633 source_set("libc++abi") {
Primiano Tucci13ae72f2019-06-06 10:53:02 +0100634 visibility = _buildtools_visibility
Primiano Tucci0825bc82017-09-28 18:50:23 +0100635 sources = [
636 "libcxxabi/src/abort_message.cpp",
637 "libcxxabi/src/cxa_aux_runtime.cpp",
638 "libcxxabi/src/cxa_default_handlers.cpp",
639 "libcxxabi/src/cxa_demangle.cpp",
640 "libcxxabi/src/cxa_exception.cpp",
641 "libcxxabi/src/cxa_exception_storage.cpp",
642 "libcxxabi/src/cxa_guard.cpp",
643 "libcxxabi/src/cxa_handlers.cpp",
644 "libcxxabi/src/cxa_personality.cpp",
645 "libcxxabi/src/cxa_unexpected.cpp",
646 "libcxxabi/src/cxa_vector.cpp",
647 "libcxxabi/src/cxa_virtual.cpp",
648 "libcxxabi/src/fallback_malloc.cpp",
649 "libcxxabi/src/private_typeinfo.cpp",
650 "libcxxabi/src/stdlib_exception.cpp",
651 "libcxxabi/src/stdlib_stdexcept.cpp",
652 "libcxxabi/src/stdlib_typeinfo.cpp",
653 ]
654
655 # On linux this seems to introduce an unwanted glibc 2.18 dependency.
656 if (is_android) {
657 sources += [ "libcxxabi/src/cxa_thread_atexit.cpp" ]
658 }
659 configs -= [
Primiano Tucci7a40e4d2017-12-06 09:51:09 +0000660 "//gn/standalone:extra_warnings",
661 "//gn/standalone:no_exceptions",
662 "//gn/standalone:no_rtti",
Primiano Tucci5aab7582017-12-07 12:22:03 +0000663 "//gn/standalone:visibility_hidden",
Primiano Tucci0825bc82017-09-28 18:50:23 +0100664 ]
665 configs += [
666 ":libc++config",
Primiano Tucci7a40e4d2017-12-06 09:51:09 +0000667 "//gn/standalone/sanitizers:sanitizer_options_link_helper",
Primiano Tucci0825bc82017-09-28 18:50:23 +0100668 ]
Primiano Tucci5e2dbac2020-01-27 10:35:27 +0000669 deps = [ ":libunwind" ]
Primiano Tucci0825bc82017-09-28 18:50:23 +0100670 }
671
Primiano Tucci7278dea2017-10-31 11:50:32 +0000672 if (custom_libcxx_is_static) {
673 libcxx_target_type = "source_set"
674 } else {
675 libcxx_target_type = "shared_library"
676 }
677
678 target(libcxx_target_type, "libc++") {
Primiano Tucci13ae72f2019-06-06 10:53:02 +0100679 visibility = _buildtools_visibility
680 visibility += [ "../gn/standalone/libc++:*" ]
Primiano Tucci0825bc82017-09-28 18:50:23 +0100681 sources = [
682 "libcxx/src/algorithm.cpp",
683 "libcxx/src/any.cpp",
684 "libcxx/src/bind.cpp",
Primiano Tucci5e2dbac2020-01-27 10:35:27 +0000685 "libcxx/src/charconv.cpp",
Primiano Tucci0825bc82017-09-28 18:50:23 +0100686 "libcxx/src/chrono.cpp",
687 "libcxx/src/condition_variable.cpp",
Primiano Tucci5e2dbac2020-01-27 10:35:27 +0000688 "libcxx/src/condition_variable_destructor.cpp",
Primiano Tucci0825bc82017-09-28 18:50:23 +0100689 "libcxx/src/debug.cpp",
690 "libcxx/src/exception.cpp",
691 "libcxx/src/functional.cpp",
692 "libcxx/src/future.cpp",
693 "libcxx/src/hash.cpp",
694 "libcxx/src/ios.cpp",
695 "libcxx/src/iostream.cpp",
696 "libcxx/src/locale.cpp",
697 "libcxx/src/memory.cpp",
698 "libcxx/src/mutex.cpp",
Primiano Tucci5e2dbac2020-01-27 10:35:27 +0000699 "libcxx/src/mutex_destructor.cpp",
Primiano Tucci0825bc82017-09-28 18:50:23 +0100700 "libcxx/src/new.cpp",
701 "libcxx/src/optional.cpp",
702 "libcxx/src/random.cpp",
703 "libcxx/src/regex.cpp",
704 "libcxx/src/shared_mutex.cpp",
705 "libcxx/src/stdexcept.cpp",
706 "libcxx/src/string.cpp",
707 "libcxx/src/strstream.cpp",
708 "libcxx/src/system_error.cpp",
709 "libcxx/src/thread.cpp",
710 "libcxx/src/typeinfo.cpp",
711 "libcxx/src/utility.cpp",
712 "libcxx/src/valarray.cpp",
713 "libcxx/src/variant.cpp",
Primiano Tuccic2eb5102018-05-15 10:40:01 +0100714 "libcxx/src/vector.cpp",
Primiano Tucci0825bc82017-09-28 18:50:23 +0100715 ]
716 configs -= [
Primiano Tucci7a40e4d2017-12-06 09:51:09 +0000717 "//gn/standalone:extra_warnings",
718 "//gn/standalone:no_exceptions",
719 "//gn/standalone:no_rtti",
Primiano Tucci5aab7582017-12-07 12:22:03 +0000720 "//gn/standalone:visibility_hidden",
Primiano Tucci0825bc82017-09-28 18:50:23 +0100721 ]
722 configs += [
723 ":libc++config",
Primiano Tucci7a40e4d2017-12-06 09:51:09 +0000724 "//gn/standalone/sanitizers:sanitizer_options_link_helper",
Primiano Tucci0825bc82017-09-28 18:50:23 +0100725 ]
726 defines = [ "_LIBCPP_BUILDING_LIBRARY" ]
Primiano Tucci5e2dbac2020-01-27 10:35:27 +0000727 if ((is_linux || is_android) && (is_asan || is_tsan || is_msan)) {
728 # In {a,t,m}san configurations, operator new and operator delete will be
729 # provided by the sanitizer runtime library. Since libc++ defines these
730 # symbols with weak linkage, and the *san runtime uses strong linkage, it
731 # should technically be OK to omit this, but it's added to be explicit.
732 defines += [ "_LIBCPP_DISABLE_NEW_DELETE_DEFINITIONS" ]
733 }
734 deps = [ ":libc++abi" ]
Primiano Tucci0825bc82017-09-28 18:50:23 +0100735 }
736} # if (use_custom_libcxx)
Hector Dearman88a10112017-10-12 11:07:10 +0100737
738config("benchmark_config") {
Primiano Tucci13ae72f2019-06-06 10:53:02 +0100739 visibility = _buildtools_visibility
Primiano Tucci2a29ac72017-10-24 17:47:19 +0100740 include_dirs = [ "benchmark/include" ]
Primiano Tucci3cbb10a2018-04-10 17:52:40 +0100741 configs = [ ":test_warning_suppressions" ]
Hector Dearman88a10112017-10-12 11:07:10 +0100742}
743
744source_set("benchmark") {
Primiano Tucci13ae72f2019-06-06 10:53:02 +0100745 visibility = _buildtools_visibility
Hector Dearman88a10112017-10-12 11:07:10 +0100746 testonly = true
747 sources = [
748 "benchmark/include/benchmark/benchmark.h",
Hector Dearman88a10112017-10-12 11:07:10 +0100749 "benchmark/src/arraysize.h",
750 "benchmark/src/benchmark.cc",
Primiano Tucci5acece02020-06-04 10:39:53 +0100751 "benchmark/src/benchmark_api_internal.cc",
Hector Dearman88a10112017-10-12 11:07:10 +0100752 "benchmark/src/benchmark_api_internal.h",
Primiano Tucci5acece02020-06-04 10:39:53 +0100753 "benchmark/src/benchmark_name.cc",
Hector Dearman88a10112017-10-12 11:07:10 +0100754 "benchmark/src/benchmark_register.cc",
Primiano Tucci5acece02020-06-04 10:39:53 +0100755 "benchmark/src/benchmark_register.h",
756 "benchmark/src/benchmark_runner.cc",
757 "benchmark/src/benchmark_runner.h",
Hector Dearman88a10112017-10-12 11:07:10 +0100758 "benchmark/src/check.h",
759 "benchmark/src/colorprint.cc",
760 "benchmark/src/colorprint.h",
761 "benchmark/src/commandlineflags.cc",
762 "benchmark/src/commandlineflags.h",
763 "benchmark/src/complexity.cc",
764 "benchmark/src/complexity.h",
765 "benchmark/src/console_reporter.cc",
766 "benchmark/src/counter.cc",
767 "benchmark/src/counter.h",
768 "benchmark/src/csv_reporter.cc",
769 "benchmark/src/cycleclock.h",
770 "benchmark/src/internal_macros.h",
771 "benchmark/src/json_reporter.cc",
772 "benchmark/src/log.h",
773 "benchmark/src/mutex.h",
774 "benchmark/src/re.h",
775 "benchmark/src/reporter.cc",
776 "benchmark/src/sleep.cc",
777 "benchmark/src/sleep.h",
Lalit Magantic99d93c2018-03-22 15:09:30 +0000778 "benchmark/src/statistics.cc",
779 "benchmark/src/statistics.h",
Hector Dearman88a10112017-10-12 11:07:10 +0100780 "benchmark/src/string_util.cc",
781 "benchmark/src/string_util.h",
782 "benchmark/src/sysinfo.cc",
Primiano Tucci5acece02020-06-04 10:39:53 +0100783 "benchmark/src/thread_manager.h",
784 "benchmark/src/thread_timer.h",
Hector Dearman88a10112017-10-12 11:07:10 +0100785 "benchmark/src/timers.cc",
786 "benchmark/src/timers.h",
787 ]
788 defines = [ "HAVE_POSIX_REGEX" ]
789 public_configs = [ ":benchmark_config" ]
790 all_dependent_configs = [ ":benchmark_config" ]
Primiano Tucci5acece02020-06-04 10:39:53 +0100791 cflags = [ "-Wno-deprecated-declarations" ]
Primiano Tucci7a40e4d2017-12-06 09:51:09 +0000792 configs -= [ "//gn/standalone:extra_warnings" ]
Primiano Tucci5e2dbac2020-01-27 10:35:27 +0000793 deps = [ "//gn:default_deps" ]
Hector Dearman88a10112017-10-12 11:07:10 +0100794}
Primiano Tucci38faa6f2018-04-01 20:12:08 +0200795
796# On Linux/Android use libbacktrace in debug builds for better stacktraces.
797if (is_linux || is_android) {
798 config("libbacktrace_config") {
Primiano Tucci13ae72f2019-06-06 10:53:02 +0100799 visibility = _buildtools_visibility
Primiano Tucci38faa6f2018-04-01 20:12:08 +0200800 include_dirs = [
801 "libbacktrace_config",
802 "libbacktrace",
803 ]
804 cflags = [
Primiano Tucci3cbb10a2018-04-10 17:52:40 +0100805 # We force include this config file because "config.h" is too generic as a
806 # file name and on some platforms #include "config.h" ends up colliding
807 # importing some other project's config.h.
Primiano Tucci38faa6f2018-04-01 20:12:08 +0200808 "-include",
809 rebase_path("libbacktrace_config/config.h", root_build_dir),
810 ]
811 }
812
813 source_set("libbacktrace") {
Primiano Tucci13ae72f2019-06-06 10:53:02 +0100814 visibility = _buildtools_visibility
Primiano Tucci38faa6f2018-04-01 20:12:08 +0200815 sources = [
Primiano Tucci38faa6f2018-04-01 20:12:08 +0200816 "libbacktrace/dwarf.c",
817 "libbacktrace/elf.c",
818 "libbacktrace/fileline.c",
819 "libbacktrace/mmap.c",
820 "libbacktrace/mmapio.c",
821 "libbacktrace/posix.c",
Primiano Tucci38faa6f2018-04-01 20:12:08 +0200822 "libbacktrace/sort.c",
823 "libbacktrace/state.c",
824 ]
825 configs -= [ "//gn/standalone:extra_warnings" ]
826 public_configs = [ ":libbacktrace_config" ]
Primiano Tucci5e2dbac2020-01-27 10:35:27 +0000827 deps = [ "//gn:default_deps" ]
Primiano Tucci38faa6f2018-04-01 20:12:08 +0200828 }
829}
Lalit Magantib123f262018-05-22 14:05:03 +0100830
831config("sqlite_config") {
Primiano Tucci13ae72f2019-06-06 10:53:02 +0100832 visibility = _buildtools_visibility
Lalit Magantib123f262018-05-22 14:05:03 +0100833 include_dirs = [ "sqlite" ]
834 cflags = [
835 "-DSQLITE_THREADSAFE=0",
Hector Dearman732e7882020-08-24 20:11:57 +0100836 "-DSQLITE_DEFAULT_MEMSTATUS=0",
Lalit Magantib123f262018-05-22 14:05:03 +0100837 "-DSQLITE_LIKE_DOESNT_MATCH_BLOBS",
Lalit Magantib123f262018-05-22 14:05:03 +0100838 "-DSQLITE_OMIT_DEPRECATED",
839 "-DSQLITE_OMIT_SHARED_CACHE",
840 "-DHAVE_USLEEP",
841 "-DHAVE_UTIME",
842 "-DSQLITE_BYTEORDER=1234",
843 "-DSQLITE_DEFAULT_AUTOVACUUM=0",
844 "-DSQLITE_DEFAULT_MMAP_SIZE=0",
845 "-DSQLITE_CORE",
Lalit Maganti8d31c732018-06-21 14:23:04 +0100846 "-DSQLITE_TEMP_STORE=3",
Lalit Magantic6347f02018-06-25 14:03:46 +0100847 "-DSQLITE_OMIT_LOAD_EXTENSION",
Hector Dearman7af33572018-09-19 17:42:25 +0100848 "-DSQLITE_OMIT_RANDOMNESS",
Lalit Maganti1e5630e2020-01-29 12:34:14 +0000849 "-DSQLITE_OMIT_AUTOINIT",
Lalit Magantie1fdf552020-02-06 17:20:16 +0000850 "-DSQLITE_ENABLE_JSON1",
Lalit Magantib123f262018-05-22 14:05:03 +0100851 ]
852}
853
854source_set("sqlite") {
Primiano Tucci13ae72f2019-06-06 10:53:02 +0100855 visibility = _buildtools_visibility
Lalit Magantib123f262018-05-22 14:05:03 +0100856 sources = [
857 "sqlite/sqlite3.c",
858 "sqlite/sqlite3.h",
859 "sqlite/sqlite3ext.h",
Ioannis Ilkos178535e2018-11-05 17:32:45 +0000860 "sqlite_src/ext/misc/percentile.c",
Lalit Magantib123f262018-05-22 14:05:03 +0100861 ]
862 configs -= [ "//gn/standalone:extra_warnings" ]
863 public_configs = [ ":sqlite_config" ]
Primiano Tucci5e2dbac2020-01-27 10:35:27 +0000864 deps = [ "//gn:default_deps" ]
Lalit Magantib123f262018-05-22 14:05:03 +0100865}
866
867source_set("sqlite_shell") {
Primiano Tucci13ae72f2019-06-06 10:53:02 +0100868 visibility = _buildtools_visibility
Lalit Magantib123f262018-05-22 14:05:03 +0100869 testonly = true
Primiano Tucci5e2dbac2020-01-27 10:35:27 +0000870 sources = [ "sqlite/shell.c" ]
Lalit Magantib123f262018-05-22 14:05:03 +0100871 configs -= [ "//gn/standalone:extra_warnings" ]
872 deps = [
873 ":sqlite",
Florian Mayera85b8fa2019-07-11 11:00:48 +0100874 "//gn:default_deps",
Lalit Magantib123f262018-05-22 14:05:03 +0100875 ]
876}
Primiano Tucci0d72a312018-08-07 14:42:45 +0100877
Florian Mayer475bd7e2018-08-07 20:04:03 +0100878source_set("lzma") {
Primiano Tucci13ae72f2019-06-06 10:53:02 +0100879 visibility = _buildtools_visibility
Florian Mayer475bd7e2018-08-07 20:04:03 +0100880 defines = [ "_7ZIP_ST" ]
881 sources = [
882 "lzma/C/7zAlloc.c",
883 "lzma/C/7zArcIn.c",
884 "lzma/C/7zBuf.c",
885 "lzma/C/7zBuf2.c",
886 "lzma/C/7zCrc.c",
887 "lzma/C/7zCrcOpt.c",
888 "lzma/C/7zDec.c",
889 "lzma/C/7zFile.c",
890 "lzma/C/7zStream.c",
891 "lzma/C/Aes.c",
892 "lzma/C/AesOpt.c",
893 "lzma/C/Alloc.c",
894 "lzma/C/Bcj2.c",
895 "lzma/C/Bra.c",
896 "lzma/C/Bra86.c",
897 "lzma/C/BraIA64.c",
898 "lzma/C/CpuArch.c",
899 "lzma/C/Delta.c",
900 "lzma/C/LzFind.c",
901 "lzma/C/Lzma2Dec.c",
902 "lzma/C/Lzma2Enc.c",
903 "lzma/C/Lzma86Dec.c",
904 "lzma/C/Lzma86Enc.c",
905 "lzma/C/LzmaDec.c",
906 "lzma/C/LzmaEnc.c",
907 "lzma/C/LzmaLib.c",
908 "lzma/C/Ppmd7.c",
909 "lzma/C/Ppmd7Dec.c",
910 "lzma/C/Ppmd7Enc.c",
911 "lzma/C/Sha256.c",
912 "lzma/C/Sort.c",
913 "lzma/C/Xz.c",
914 "lzma/C/XzCrc64.c",
915 "lzma/C/XzCrc64Opt.c",
916 "lzma/C/XzDec.c",
917 "lzma/C/XzEnc.c",
918 "lzma/C/XzIn.c",
919 ]
920 configs -= [ "//gn/standalone:extra_warnings" ]
921 cflags = [
922 "-Wno-empty-body",
923 "-Wno-enum-conversion",
924 ]
Primiano Tucci5e2dbac2020-01-27 10:35:27 +0000925 deps = [ "//gn:default_deps" ]
Florian Mayer475bd7e2018-08-07 20:04:03 +0100926}
Florian Mayera2fae262018-08-31 12:10:01 -0700927
Hector Dearmane0b993f2019-05-24 18:48:16 +0100928source_set("zlib") {
Primiano Tucci13ae72f2019-06-06 10:53:02 +0100929 visibility = _buildtools_visibility
Hector Dearmane0b993f2019-05-24 18:48:16 +0100930 sources = [
Primiano Tuccia44b6932020-12-01 12:46:19 +0100931 "zlib/adler32.c",
932 "zlib/compress.c",
933 "zlib/cpu_features.c",
934 "zlib/crc32.c",
935 "zlib/deflate.c",
936 "zlib/gzclose.c",
937 "zlib/gzlib.c",
938 "zlib/gzread.c",
939 "zlib/gzwrite.c",
940 "zlib/infback.c",
941 "zlib/inffast.c",
942 "zlib/inflate.c",
943 "zlib/inftrees.c",
944 "zlib/trees.c",
945 "zlib/uncompr.c",
946 "zlib/zutil.c",
Hector Dearmane0b993f2019-05-24 18:48:16 +0100947 ]
948 configs -= [ "//gn/standalone:extra_warnings" ]
949 cflags = []
950 public_configs = [ ":zlib_config" ]
Primiano Tucci5e2dbac2020-01-27 10:35:27 +0000951 deps = [ "//gn:default_deps" ]
Primiano Tuccia44b6932020-12-01 12:46:19 +0100952
953 # TODO(primiano): look into ADLER32_SIMD_SSSE3 and other SIMD optimizations
954 # (from chromium's third_party/zlib/BUILD.gn).
955 if (is_win) {
956 defines = [ "X86_WINDOWS" ]
957 }
Hector Dearmane0b993f2019-05-24 18:48:16 +0100958}
959
960config("zlib_config") {
Primiano Tucci13ae72f2019-06-06 10:53:02 +0100961 visibility = _buildtools_visibility
Primiano Tucci2f811552020-12-07 16:48:22 +0100962 if (!is_win) {
963 defines = [ "HAVE_HIDDEN" ]
964 }
Hector Dearman554627f2019-06-04 17:58:22 +0100965 cflags = [
966 # Using -isystem instead of include_dirs (-I), so we don't need to suppress
967 # warnings coming from third-party headers. Doing so would mask warnings in
968 # our own code.
Primiano Tucci2f811552020-12-07 16:48:22 +0100969 perfetto_isystem_cflag,
Primiano Tuccia44b6932020-12-01 12:46:19 +0100970 rebase_path("zlib", root_build_dir),
Hector Dearman554627f2019-06-04 17:58:22 +0100971 ]
Hector Dearmane0b993f2019-05-24 18:48:16 +0100972}
973
Florian Mayer475bd7e2018-08-07 20:04:03 +0100974source_set("libunwindstack") {
Primiano Tucci13ae72f2019-06-06 10:53:02 +0100975 visibility = _buildtools_visibility
Florian Mayer475bd7e2018-08-07 20:04:03 +0100976 include_dirs = [
Florian Mayere02b2722020-11-12 10:50:43 +0000977 "android-unwinding/libunwindstack/include",
978 "android-unwinding/libunwindstack",
979 "android-libbase/include",
980 "android-logging/liblog/include",
981 "android-libprocinfo/include",
Florian Mayerf8335662018-08-08 11:30:32 +0100982 "android-core/include",
Florian Mayere02b2722020-11-12 10:50:43 +0000983 "android-core/libcutils/include",
Florian Mayerddc8ae22021-02-18 17:20:09 +0000984 "bionic/libc/async_safe/include",
985 "bionic/libc/platform/",
Florian Mayer475bd7e2018-08-07 20:04:03 +0100986 "lzma/C",
987 ]
988 deps = [
989 ":lzma",
Florian Mayera85b8fa2019-07-11 11:00:48 +0100990 "//gn:default_deps",
Florian Mayer475bd7e2018-08-07 20:04:03 +0100991 ]
Florian Mayer475bd7e2018-08-07 20:04:03 +0100992 sources = [
Florian Mayere02b2722020-11-12 10:50:43 +0000993 "android-libbase/file.cpp",
Florian Mayere02b2722020-11-12 10:50:43 +0000994 "android-libbase/stringprintf.cpp",
995 "android-libbase/strings.cpp",
Florian Mayere02b2722020-11-12 10:50:43 +0000996 "android-unwinding/libunwindstack/ArmExidx.cpp",
997 "android-unwinding/libunwindstack/DwarfCfa.cpp",
998 "android-unwinding/libunwindstack/DwarfEhFrameWithHdr.cpp",
999 "android-unwinding/libunwindstack/DwarfMemory.cpp",
1000 "android-unwinding/libunwindstack/DwarfOp.cpp",
1001 "android-unwinding/libunwindstack/DwarfSection.cpp",
1002 "android-unwinding/libunwindstack/Elf.cpp",
1003 "android-unwinding/libunwindstack/ElfInterface.cpp",
1004 "android-unwinding/libunwindstack/ElfInterfaceArm.cpp",
1005 "android-unwinding/libunwindstack/Global.cpp",
1006 "android-unwinding/libunwindstack/JitDebug.cpp",
1007 "android-unwinding/libunwindstack/LocalUnwinder.cpp",
1008 "android-unwinding/libunwindstack/Log.cpp",
1009 "android-unwinding/libunwindstack/MapInfo.cpp",
1010 "android-unwinding/libunwindstack/Maps.cpp",
1011 "android-unwinding/libunwindstack/Memory.cpp",
1012 "android-unwinding/libunwindstack/Regs.cpp",
1013 "android-unwinding/libunwindstack/RegsArm.cpp",
1014 "android-unwinding/libunwindstack/RegsArm64.cpp",
1015 "android-unwinding/libunwindstack/RegsMips.cpp",
1016 "android-unwinding/libunwindstack/RegsMips64.cpp",
1017 "android-unwinding/libunwindstack/RegsX86.cpp",
1018 "android-unwinding/libunwindstack/RegsX86_64.cpp",
1019 "android-unwinding/libunwindstack/Symbols.cpp",
1020 "android-unwinding/libunwindstack/Unwinder.cpp",
Florian Mayer475bd7e2018-08-07 20:04:03 +01001021 ]
Florian Mayerddc8ae22021-02-18 17:20:09 +00001022 if (!is_android) {
1023 sources += [
Florian Mayerdbeef812021-02-18 19:01:57 +00001024 "android-libbase/liblog_symbols.cpp",
1025 "android-libbase/logging.cpp",
1026 "android-libbase/threads.cpp",
Florian Mayerddc8ae22021-02-18 17:20:09 +00001027 "android-logging/liblog/logger_write.cpp",
1028 "android-logging/liblog/properties.cpp",
1029 "android-unwinding/libunwindstack/MemoryMte.cpp",
1030 ]
1031 }
Florian Mayer475bd7e2018-08-07 20:04:03 +01001032 if (current_cpu == "x86") {
Florian Mayere02b2722020-11-12 10:50:43 +00001033 sources += [ "android-unwinding/libunwindstack/AsmGetRegsX86.S" ]
Florian Mayer475bd7e2018-08-07 20:04:03 +01001034 } else if (current_cpu == "x64") {
Florian Mayere02b2722020-11-12 10:50:43 +00001035 sources += [ "android-unwinding/libunwindstack/AsmGetRegsX86_64.S" ]
Florian Mayer475bd7e2018-08-07 20:04:03 +01001036 }
1037 configs -= [
1038 "//gn/standalone:extra_warnings",
1039 "//gn/standalone:c++11",
Florian Mayera2fae262018-08-31 12:10:01 -07001040 "//gn/standalone:visibility_hidden",
Florian Mayer475bd7e2018-08-07 20:04:03 +01001041 ]
Florian Mayerce11bea2020-01-23 19:47:58 +00001042 cflags = [ "-DFAKE_LOG_DEVICE=1" ]
Florian Mayer3943f062021-04-12 15:37:05 +01001043 public_configs = [
1044 ":libunwindstack_config",
1045 "//gn/standalone:c++17",
1046 ]
Florian Mayer475bd7e2018-08-07 20:04:03 +01001047}
1048
Ryan Savitski56bc0c62020-01-27 13:50:02 +00001049config("bionic_kernel_uapi_headers") {
1050 visibility = _buildtools_visibility
1051 cflags = [
Primiano Tucci2f811552020-12-07 16:48:22 +01001052 perfetto_isystem_cflag,
Ryan Savitski56bc0c62020-01-27 13:50:02 +00001053 rebase_path("bionic/libc/kernel", root_build_dir),
1054 ]
1055}
1056
Primiano Tucci0d72a312018-08-07 14:42:45 +01001057config("jsoncpp_config") {
Primiano Tucci13ae72f2019-06-06 10:53:02 +01001058 visibility = _buildtools_visibility
Primiano Tucci0d72a312018-08-07 14:42:45 +01001059 cflags = [
1060 "-DJSON_USE_EXCEPTION=0",
1061
1062 # Using -isystem instead of include_dirs (-I), so we don't need to suppress
Florian Mayerbda0c442018-09-07 10:53:55 +01001063 # warnings coming from third-party headers. Doing so would mask warnings in
Primiano Tucci0d72a312018-08-07 14:42:45 +01001064 # our own code.
Primiano Tucci2f811552020-12-07 16:48:22 +01001065 perfetto_isystem_cflag,
Primiano Tucci0d72a312018-08-07 14:42:45 +01001066 rebase_path("jsoncpp/include", root_build_dir),
1067 ]
1068}
1069
1070source_set("jsoncpp") {
Primiano Tucci13ae72f2019-06-06 10:53:02 +01001071 visibility = _buildtools_visibility
Primiano Tucci0d72a312018-08-07 14:42:45 +01001072 sources = [
1073 "jsoncpp/src/lib_json/json_reader.cpp",
1074 "jsoncpp/src/lib_json/json_value.cpp",
1075 "jsoncpp/src/lib_json/json_writer.cpp",
1076 ]
1077 configs -= [ "//gn/standalone:extra_warnings" ]
1078 public_configs = [ ":jsoncpp_config" ]
Primiano Tucci5e2dbac2020-01-27 10:35:27 +00001079 deps = [ "//gn:default_deps" ]
Primiano Tucci0d72a312018-08-07 14:42:45 +01001080}
Hector Dearmane44ad452018-09-21 11:51:57 +01001081
1082config("linenoise_config") {
Primiano Tucci13ae72f2019-06-06 10:53:02 +01001083 visibility = _buildtools_visibility
Hector Dearmane44ad452018-09-21 11:51:57 +01001084 cflags = [
1085 # Using -isystem instead of include_dirs (-I), so we don't need to suppress
1086 # warnings coming from third-party headers. Doing so would mask warnings in
1087 # our own code.
Primiano Tucci2f811552020-12-07 16:48:22 +01001088 perfetto_isystem_cflag,
Hector Dearmane44ad452018-09-21 11:51:57 +01001089 rebase_path("linenoise", root_build_dir),
1090 ]
1091}
1092
1093source_set("linenoise") {
Primiano Tucci13ae72f2019-06-06 10:53:02 +01001094 visibility = _buildtools_visibility
Hector Dearmane44ad452018-09-21 11:51:57 +01001095 sources = [
1096 "linenoise/linenoise.c",
1097 "linenoise/linenoise.h",
1098 ]
1099 configs -= [ "//gn/standalone:extra_warnings" ]
1100 public_configs = [ ":linenoise_config" ]
Lalit Magantiedace412019-06-18 13:28:28 +01001101 cflags = [ "-Wno-tautological-unsigned-zero-compare" ]
Primiano Tucci5e2dbac2020-01-27 10:35:27 +00001102 deps = [ "//gn:default_deps" ]
Hector Dearmane44ad452018-09-21 11:51:57 +01001103}
Primiano Tuccia65497e2018-09-26 19:53:58 +01001104
Primiano Tucci780deea2018-10-11 09:28:05 +01001105if (use_libfuzzer) {
1106 source_set("libfuzzer") {
Primiano Tucci13ae72f2019-06-06 10:53:02 +01001107 visibility = _buildtools_visibility
Primiano Tucci780deea2018-10-11 09:28:05 +01001108 configs -= [
1109 "//gn/standalone:extra_warnings",
1110 "//gn/standalone/sanitizers:sanitizers_cflags",
1111 ]
1112 sources = [
1113 "libfuzzer/FuzzerCrossOver.cpp",
1114 "libfuzzer/FuzzerDataFlowTrace.cpp",
1115 "libfuzzer/FuzzerDriver.cpp",
1116 "libfuzzer/FuzzerExtFunctionsDlsym.cpp",
1117 "libfuzzer/FuzzerExtFunctionsWeak.cpp",
Florian Mayera85b8fa2019-07-11 11:00:48 +01001118 "libfuzzer/FuzzerExtFunctionsWindows.cpp",
Primiano Tucci780deea2018-10-11 09:28:05 +01001119 "libfuzzer/FuzzerExtraCounters.cpp",
Florian Mayera85b8fa2019-07-11 11:00:48 +01001120 "libfuzzer/FuzzerFork.cpp",
Primiano Tucci780deea2018-10-11 09:28:05 +01001121 "libfuzzer/FuzzerIO.cpp",
1122 "libfuzzer/FuzzerIOPosix.cpp",
1123 "libfuzzer/FuzzerIOWindows.cpp",
1124 "libfuzzer/FuzzerLoop.cpp",
1125 "libfuzzer/FuzzerMain.cpp",
1126 "libfuzzer/FuzzerMerge.cpp",
1127 "libfuzzer/FuzzerMutate.cpp",
1128 "libfuzzer/FuzzerSHA1.cpp",
Primiano Tucci780deea2018-10-11 09:28:05 +01001129 "libfuzzer/FuzzerTracePC.cpp",
1130 "libfuzzer/FuzzerUtil.cpp",
1131 "libfuzzer/FuzzerUtilDarwin.cpp",
1132 "libfuzzer/FuzzerUtilFuchsia.cpp",
1133 "libfuzzer/FuzzerUtilLinux.cpp",
1134 "libfuzzer/FuzzerUtilPosix.cpp",
1135 "libfuzzer/FuzzerUtilWindows.cpp",
1136 ]
Primiano Tucci5e2dbac2020-01-27 10:35:27 +00001137 deps = [ "//gn:default_deps" ]
Primiano Tucci780deea2018-10-11 09:28:05 +01001138 }
Primiano Tuccia65497e2018-09-26 19:53:58 +01001139}