[M120 Migration][VD] Enable direct rendering for TVPlus
[platform/framework/web/chromium-efl.git] / components / power_metrics / BUILD.gn
1 # Copyright 2021 The Chromium Authors
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
4
5 static_library("power_metrics") {
6   sources = [
7     "energy_metrics_provider.cc",
8     "energy_metrics_provider.h",
9   ]
10
11   deps = [
12     "//base",
13     "//third_party/abseil-cpp:absl",
14   ]
15
16   if (is_mac) {
17     sources += [
18       "energy_impact_mac.h",
19       "energy_impact_mac.mm",
20       "m1_sensors_internal_types_mac.h",
21       "m1_sensors_mac.h",
22       "m1_sensors_mac.mm",
23       "mach_time_mac.h",
24       "mach_time_mac.mm",
25       "resource_coalition_internal_types_mac.h",
26       "resource_coalition_mac.h",
27       "resource_coalition_mac.mm",
28       "smc_internal_types_mac.h",
29       "smc_mac.h",
30       "smc_mac.mm",
31     ]
32   }
33
34   if (is_win) {
35     sources += [
36       "energy_metrics_provider_win.cc",
37       "energy_metrics_provider_win.h",
38     ]
39
40     libs = [ "Setupapi.lib" ]
41     ldflags = [ "/DELAYLOAD:setupapi.dll" ]
42   }
43
44   if (is_linux || is_chromeos || is_tizen) {
45     sources += [
46       "energy_metrics_provider_linux.cc",
47       "energy_metrics_provider_linux.h",
48     ]
49   }
50
51   if (is_win || is_linux || is_chromeos || is_tizen) {
52     sources += [
53       "system_power_monitor.cc",
54       "system_power_monitor.h",
55     ]
56   }
57 }
58
59 source_set("unit_tests") {
60   testonly = true
61
62   sources = [ "energy_metrics_provider_unittest.cc" ]
63
64   deps = [
65     ":power_metrics",
66     "//base",
67     "//testing/gtest",
68   ]
69
70   if (is_mac) {
71     sources += [
72       "energy_impact_mac_unittest.mm",
73       "resource_coalition_mac_unittest.mm",
74     ]
75
76     data = [ "test/data/" ]
77   }
78
79   if (is_win || is_linux || is_chromeos) {
80     sources += [ "system_power_monitor_unittest.cc" ]
81
82     deps += [ "//base/test:test_support" ]
83   }
84 }