blob: c58a5529c87f38065ba4207e8ad8911a5e37a3c0 [file] [log] [blame]
Primiano Tucci13331342017-10-25 17:08:13 +01001# 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 Tuccid7d1be02017-10-30 17:41:34 +000015source_set("base") {
16 sources = [
17 "build_config.h",
18 "logging.h",
19 "scoped_file.h",
20 "task_runner.h",
Primiano Tucci575af772017-11-08 18:14:17 +000021 "thread_checker.cc",
22 "thread_checker.h",
Sami Kyostila2c6c2f52017-11-21 16:08:16 +000023 "unix_task_runner.cc",
24 "unix_task_runner.h",
Primiano Tuccid7d1be02017-10-30 17:41:34 +000025 "utils.h",
Primiano Tucci575af772017-11-08 18:14:17 +000026 "weak_ptr.h",
Primiano Tuccid7d1be02017-10-30 17:41:34 +000027 ]
Sami Kyostila73d41c82017-11-24 18:38:46 +000028
Primiano Tucci89d765f2017-11-27 17:51:38 +000029 if (is_debug) {
30 deps = [
31 ":debug_crash_stack_trace",
32 ]
33 }
34
Sami Kyostila7ae34482017-11-28 13:17:07 +000035 if (is_android) {
Sami Kyostila73d41c82017-11-24 18:38:46 +000036 sources += [
37 "android_task_runner.cc",
38 "android_task_runner.h",
39 ]
40 libs = [ "android" ]
41 }
Primiano Tuccid7d1be02017-10-30 17:41:34 +000042}
43
Primiano Tucci89d765f2017-11-27 17:51:38 +000044if (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 Tuccid7d1be02017-10-30 17:41:34 +000056source_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 Tucci13331342017-10-25 17:08:13 +010065executable("base_unittests") {
66 testonly = true
67 deps += [
Primiano Tuccid7d1be02017-10-30 17:41:34 +000068 ":base",
69 ":test_support",
Primiano Tucci13331342017-10-25 17:08:13 +010070 "//buildtools:gmock",
71 "//buildtools:gtest",
72 "//buildtools:gtest_main",
73 ]
74 sources = [
Primiano Tuccid7d1be02017-10-30 17:41:34 +000075 "scoped_file_unittest.cc",
Sami Kyostila73d41c82017-11-24 18:38:46 +000076 "task_runner_unittest.cc",
Primiano Tucci575af772017-11-08 18:14:17 +000077 "thread_checker_unittest.cc",
Primiano Tuccid7d1be02017-10-30 17:41:34 +000078 "utils_unittest.cc",
Primiano Tucci575af772017-11-08 18:14:17 +000079 "weak_ptr_unittest.cc",
Primiano Tucci13331342017-10-25 17:08:13 +010080 ]
81}