Primiano Tucci | 4f9b6d7 | 2017-12-05 20:59:16 +0000 | [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("//build_overrides/build.gni") |
| 16 | |
| 17 | source_set("base") { |
| 18 | deps = [ |
| 19 | "../../gn:default_deps", |
| 20 | ] |
| 21 | public_deps = [ |
| 22 | "../../include/perfetto/base", |
| 23 | ] |
| 24 | sources = [ |
Florian Mayer | 74b73a9 | 2018-03-09 17:37:13 +0000 | [diff] [blame] | 25 | "file_utils.cc", |
Primiano Tucci | bbaa58c | 2017-12-20 13:48:20 +0100 | [diff] [blame] | 26 | "page_allocator.cc", |
Primiano Tucci | 825e6de | 2018-03-13 05:43:15 +0000 | [diff] [blame^] | 27 | "string_splitter.cc", |
Primiano Tucci | 4f9b6d7 | 2017-12-05 20:59:16 +0000 | [diff] [blame] | 28 | "thread_checker.cc", |
| 29 | "unix_task_runner.cc", |
| 30 | ] |
Lalit Maganti | e419ccb | 2018-03-06 11:48:03 +0000 | [diff] [blame] | 31 | if (!build_with_chromium && (is_linux || is_android)) { |
Primiano Tucci | c96f71b | 2018-02-06 19:21:09 +0000 | [diff] [blame] | 32 | sources += [ "watchdog.cc" ] |
| 33 | } |
Primiano Tucci | 4f9b6d7 | 2017-12-05 20:59:16 +0000 | [diff] [blame] | 34 | if (is_debug) { |
| 35 | deps += [ ":debug_crash_stack_trace" ] |
| 36 | } |
| 37 | } |
| 38 | |
Primiano Tucci | 6ea459c | 2018-01-10 10:42:27 +0000 | [diff] [blame] | 39 | # The "android_task_runner" should be depended on only by targets that |
| 40 | # explicitly need it, as it pulls in a dependency on libandroid.so that in turn |
| 41 | # pulls dozen of other .so(s). |
Oystein Eftevaag | f7a0d7e | 2018-01-12 13:02:43 -0800 | [diff] [blame] | 42 | if (is_android && !build_with_chromium) { |
Primiano Tucci | 6ea459c | 2018-01-10 10:42:27 +0000 | [diff] [blame] | 43 | source_set("android_task_runner") { |
| 44 | deps = [ |
| 45 | ":base", |
| 46 | "../../gn:default_deps", |
| 47 | ] |
| 48 | sources = [ |
| 49 | "android_task_runner.cc", |
| 50 | ] |
| 51 | all_dependent_configs = [ ":android_config" ] |
| 52 | } |
| 53 | |
| 54 | config("android_config") { |
| 55 | libs = [ "android" ] |
| 56 | } |
| 57 | } |
| 58 | |
Primiano Tucci | 4f9b6d7 | 2017-12-05 20:59:16 +0000 | [diff] [blame] | 59 | if (is_debug) { |
| 60 | source_set("debug_crash_stack_trace") { |
| 61 | sources = [ |
| 62 | "debug_crash_stack_trace.cc", |
| 63 | ] |
| 64 | cflags = [ |
| 65 | "-Wno-deprecated-dynamic-exception-spec", |
| 66 | "-Wno-disabled-macro-expansion", |
| 67 | ] |
Primiano Tucci | a5ff2a8 | 2017-12-20 11:37:00 +0100 | [diff] [blame] | 68 | deps = [ |
| 69 | "../../gn:default_deps", |
| 70 | ] |
Primiano Tucci | 4f9b6d7 | 2017-12-05 20:59:16 +0000 | [diff] [blame] | 71 | } |
| 72 | } |
| 73 | |
| 74 | source_set("test_support") { |
| 75 | testonly = true |
| 76 | deps = [ |
| 77 | ":base", |
| 78 | "../../gn:default_deps", |
Primiano Tucci | bbaa58c | 2017-12-20 13:48:20 +0100 | [diff] [blame] | 79 | "../../gn:gtest_deps", |
Primiano Tucci | 4f9b6d7 | 2017-12-05 20:59:16 +0000 | [diff] [blame] | 80 | ] |
| 81 | sources = [ |
Florian Mayer | c7255fd | 2018-01-25 10:29:24 +0000 | [diff] [blame] | 82 | "test/test_task_runner.cc", |
| 83 | "test/test_task_runner.h", |
Florian Mayer | d8bd81b | 2018-01-25 12:49:15 +0000 | [diff] [blame] | 84 | "test/vm_test_utils.cc", |
| 85 | "test/vm_test_utils.h", |
Florian Mayer | c7255fd | 2018-01-25 10:29:24 +0000 | [diff] [blame] | 86 | ] |
| 87 | } |
| 88 | |
Primiano Tucci | b03ba36 | 2017-12-06 09:47:41 +0000 | [diff] [blame] | 89 | source_set("base_unittests") { |
Primiano Tucci | 4f9b6d7 | 2017-12-05 20:59:16 +0000 | [diff] [blame] | 90 | testonly = true |
| 91 | deps = [ |
| 92 | ":base", |
| 93 | ":test_support", |
| 94 | "../../gn:default_deps", |
| 95 | "../../gn:gtest_deps", |
| 96 | ] |
Oystein Eftevaag | f7a0d7e | 2018-01-12 13:02:43 -0800 | [diff] [blame] | 97 | if (is_android && !build_with_chromium) { |
Primiano Tucci | 6ea459c | 2018-01-10 10:42:27 +0000 | [diff] [blame] | 98 | deps += [ ":android_task_runner" ] |
| 99 | } |
Primiano Tucci | 4f9b6d7 | 2017-12-05 20:59:16 +0000 | [diff] [blame] | 100 | sources = [ |
Primiano Tucci | bbaa58c | 2017-12-20 13:48:20 +0100 | [diff] [blame] | 101 | "page_allocator_unittest.cc", |
Primiano Tucci | 4f9b6d7 | 2017-12-05 20:59:16 +0000 | [diff] [blame] | 102 | "scoped_file_unittest.cc", |
Primiano Tucci | 825e6de | 2018-03-13 05:43:15 +0000 | [diff] [blame^] | 103 | "string_splitter_unittest.cc", |
Primiano Tucci | 4f9b6d7 | 2017-12-05 20:59:16 +0000 | [diff] [blame] | 104 | "task_runner_unittest.cc", |
| 105 | "thread_checker_unittest.cc", |
| 106 | "utils_unittest.cc", |
Primiano Tucci | 4f9b6d7 | 2017-12-05 20:59:16 +0000 | [diff] [blame] | 107 | "weak_ptr_unittest.cc", |
| 108 | ] |
Lalit Maganti | e419ccb | 2018-03-06 11:48:03 +0000 | [diff] [blame] | 109 | if (!build_with_chromium && (is_linux || is_android)) { |
Primiano Tucci | c96f71b | 2018-02-06 19:21:09 +0000 | [diff] [blame] | 110 | sources += [ "watchdog_unittest.cc" ] |
| 111 | } |
Primiano Tucci | 4f9b6d7 | 2017-12-05 20:59:16 +0000 | [diff] [blame] | 112 | } |