Oystein Eftevaag | dd727e4 | 2017-12-05 08:49:55 -0800 | [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 | |
| 15 | import("perfetto.gni") |
| 16 | |
Primiano Tucci | 4f9b6d7 | 2017-12-05 20:59:16 +0000 | [diff] [blame] | 17 | # Used in production targets (i.e. testonly == false) for the FRIEND_TEST_* |
| 18 | # macros. |
| 19 | group("gtest_prod_config") { |
| 20 | if (!build_with_chromium) { |
| 21 | public_configs = [ "//buildtools:googletest_prod_config" ] |
| 22 | } else { |
| 23 | public_configs = [ ":gtest_config" ] |
| 24 | } |
| 25 | } |
| 26 | |
| 27 | config("gtest_config") { |
| 28 | if (build_with_chromium) { |
| 29 | include_dirs = [ "//testing/gtest/include" ] |
| 30 | } |
| 31 | } |
| 32 | |
Oystein Eftevaag | dd727e4 | 2017-12-05 08:49:55 -0800 | [diff] [blame] | 33 | group("gtest_deps") { |
| 34 | testonly = true |
| 35 | |
Primiano Tucci | 4f9b6d7 | 2017-12-05 20:59:16 +0000 | [diff] [blame] | 36 | public_configs = [ ":gtest_config" ] |
| 37 | |
Oystein Eftevaag | dd727e4 | 2017-12-05 08:49:55 -0800 | [diff] [blame] | 38 | if (!build_with_chromium) { |
| 39 | public_deps = [ |
| 40 | "//buildtools:gmock", |
| 41 | "//buildtools:gtest", |
| 42 | "//buildtools:gtest_main", |
| 43 | ] |
| 44 | } else { |
| 45 | public_deps = [ |
| 46 | "//testing/gmock", |
| 47 | "//testing/gtest", |
| 48 | "//testing/gtest:gtest_main", |
| 49 | ] |
| 50 | } |
| 51 | } |
| 52 | |
Primiano Tucci | 4f9b6d7 | 2017-12-05 20:59:16 +0000 | [diff] [blame] | 53 | # protoc compiler library, for building protoc plugins on the host. |
| 54 | if (current_toolchain == host_toolchain) { |
| 55 | group("protoc_lib_deps") { |
| 56 | if (!build_with_chromium) { |
Oystein Eftevaag | dd727e4 | 2017-12-05 08:49:55 -0800 | [diff] [blame] | 57 | public_deps = [ |
| 58 | "//buildtools:protoc_lib", |
| 59 | ] |
Primiano Tucci | 4f9b6d7 | 2017-12-05 20:59:16 +0000 | [diff] [blame] | 60 | } else { |
| 61 | public_deps = [ |
| 62 | "//third_party/protobuf:protoc_lib", |
| 63 | ] |
Oystein Eftevaag | dd727e4 | 2017-12-05 08:49:55 -0800 | [diff] [blame] | 64 | } |
Oystein Eftevaag | dd727e4 | 2017-12-05 08:49:55 -0800 | [diff] [blame] | 65 | } |
| 66 | } |
| 67 | |
| 68 | group("protobuf_full_deps") { |
| 69 | if (!build_with_chromium) { |
| 70 | public_deps = [ |
| 71 | "//buildtools:protobuf_full", |
| 72 | ] |
| 73 | } else { |
| 74 | public_deps = [ |
| 75 | "//third_party/protobuf:protobuf_full", |
| 76 | ] |
| 77 | } |
| 78 | } |
| 79 | |
Primiano Tucci | 4f9b6d7 | 2017-12-05 20:59:16 +0000 | [diff] [blame] | 80 | # All targets should depend on this target to inherit the right flags and |
| 81 | # include directories. |
Oystein Eftevaag | dd727e4 | 2017-12-05 08:49:55 -0800 | [diff] [blame] | 82 | group("default_deps") { |
Primiano Tucci | 4f9b6d7 | 2017-12-05 20:59:16 +0000 | [diff] [blame] | 83 | public_configs = [ ":default_config" ] |
Oystein Eftevaag | dd727e4 | 2017-12-05 08:49:55 -0800 | [diff] [blame] | 84 | if (!build_with_chromium) { |
| 85 | public_deps = [ |
Primiano Tucci | 7a40e4d | 2017-12-06 09:51:09 +0000 | [diff] [blame^] | 86 | "//gn/standalone/libc++:deps", |
| 87 | "//gn/standalone/sanitizers:deps", |
Oystein Eftevaag | dd727e4 | 2017-12-05 08:49:55 -0800 | [diff] [blame] | 88 | ] |
| 89 | } |
| 90 | } |
Primiano Tucci | 4f9b6d7 | 2017-12-05 20:59:16 +0000 | [diff] [blame] | 91 | |
| 92 | config("default_config") { |
| 93 | include_dirs = [ |
| 94 | "..", |
| 95 | "../include", |
| 96 | ] |
| 97 | } |