Primiano Tucci | 1333134 | 2017-10-25 17:08:13 +0100 | [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 | d7d1be0 | 2017-10-30 17:41:34 +0000 | [diff] [blame] | 15 | source_set("base") { |
| 16 | sources = [ |
| 17 | "build_config.h", |
| 18 | "logging.h", |
| 19 | "scoped_file.h", |
| 20 | "task_runner.h", |
Primiano Tucci | 575af77 | 2017-11-08 18:14:17 +0000 | [diff] [blame] | 21 | "thread_checker.cc", |
| 22 | "thread_checker.h", |
Sami Kyostila | 2c6c2f5 | 2017-11-21 16:08:16 +0000 | [diff] [blame] | 23 | "unix_task_runner.cc", |
| 24 | "unix_task_runner.h", |
Primiano Tucci | d7d1be0 | 2017-10-30 17:41:34 +0000 | [diff] [blame] | 25 | "utils.h", |
Primiano Tucci | 575af77 | 2017-11-08 18:14:17 +0000 | [diff] [blame] | 26 | "weak_ptr.h", |
Primiano Tucci | d7d1be0 | 2017-10-30 17:41:34 +0000 | [diff] [blame] | 27 | ] |
Sami Kyostila | 73d41c8 | 2017-11-24 18:38:46 +0000 | [diff] [blame] | 28 | |
Primiano Tucci | 89d765f | 2017-11-27 17:51:38 +0000 | [diff] [blame] | 29 | if (is_debug) { |
| 30 | deps = [ |
| 31 | ":debug_crash_stack_trace", |
| 32 | ] |
| 33 | } |
| 34 | |
Sami Kyostila | 7ae3448 | 2017-11-28 13:17:07 +0000 | [diff] [blame] | 35 | if (is_android) { |
Sami Kyostila | 73d41c8 | 2017-11-24 18:38:46 +0000 | [diff] [blame] | 36 | sources += [ |
| 37 | "android_task_runner.cc", |
| 38 | "android_task_runner.h", |
| 39 | ] |
| 40 | libs = [ "android" ] |
| 41 | } |
Primiano Tucci | d7d1be0 | 2017-10-30 17:41:34 +0000 | [diff] [blame] | 42 | } |
| 43 | |
Primiano Tucci | 89d765f | 2017-11-27 17:51:38 +0000 | [diff] [blame] | 44 | if (is_debug) { |
| 45 | source_set("debug_crash_stack_trace") { |
| 46 | sources = [ |
| 47 | "debug_crash_stack_trace.cc", |
| 48 | ] |
| 49 | cflags = [ |
| 50 | "-Wno-deprecated-dynamic-exception-spec", |
| 51 | "-Wno-disabled-macro-expansion", |
| 52 | ] |
| 53 | } |
| 54 | } |
| 55 | |
Primiano Tucci | d7d1be0 | 2017-10-30 17:41:34 +0000 | [diff] [blame] | 56 | source_set("test_support") { |
| 57 | testonly = true |
| 58 | deps += [ ":base" ] |
| 59 | sources = [ |
| 60 | "test/test_task_runner.cc", |
| 61 | "test/test_task_runner.h", |
| 62 | ] |
| 63 | } |
| 64 | |
Primiano Tucci | 1333134 | 2017-10-25 17:08:13 +0100 | [diff] [blame] | 65 | executable("base_unittests") { |
| 66 | testonly = true |
| 67 | deps += [ |
Primiano Tucci | d7d1be0 | 2017-10-30 17:41:34 +0000 | [diff] [blame] | 68 | ":base", |
| 69 | ":test_support", |
Primiano Tucci | 1333134 | 2017-10-25 17:08:13 +0100 | [diff] [blame] | 70 | "//buildtools:gmock", |
| 71 | "//buildtools:gtest", |
| 72 | "//buildtools:gtest_main", |
| 73 | ] |
| 74 | sources = [ |
Primiano Tucci | d7d1be0 | 2017-10-30 17:41:34 +0000 | [diff] [blame] | 75 | "scoped_file_unittest.cc", |
Sami Kyostila | 73d41c8 | 2017-11-24 18:38:46 +0000 | [diff] [blame] | 76 | "task_runner_unittest.cc", |
Primiano Tucci | 575af77 | 2017-11-08 18:14:17 +0000 | [diff] [blame] | 77 | "thread_checker_unittest.cc", |
Primiano Tucci | d7d1be0 | 2017-10-30 17:41:34 +0000 | [diff] [blame] | 78 | "utils_unittest.cc", |
Primiano Tucci | 575af77 | 2017-11-08 18:14:17 +0000 | [diff] [blame] | 79 | "weak_ptr_unittest.cc", |
Primiano Tucci | 1333134 | 2017-10-25 17:08:13 +0100 | [diff] [blame] | 80 | ] |
| 81 | } |