Bug 1769628 [wpt PR 34081] - Update wpt metadata, a=testonly
[gecko.git] / hal / moz.build
blob71501fddac161e712945d45dcd6dce6a3569b0cc
1 # -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
2 # vim: set filetype=python:
3 # This Source Code Form is subject to the terms of the Mozilla Public
4 # License, v. 2.0. If a copy of the MPL was not distributed with this
5 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 with Files("**"):
8     BUG_COMPONENT = ("Core", "Hardware Abstraction Layer (HAL)")
10 EXPORTS.mozilla += [
11     "Hal.h",
12     "HalBatteryInformation.h",
13     "HalImpl.h",
14     "HalIPCUtils.h",
15     "HalNetworkInformation.h",
16     "HalSandbox.h",
17     "HalScreenConfiguration.h",
18     "HalSensor.h",
19     "HalTypes.h",
20     "HalWakeLock.h",
21     "HalWakeLockInformation.h",
24 UNIFIED_SOURCES += [
25     "HalWakeLock.cpp",
26     "sandbox/SandboxHal.cpp",
27     "WindowIdentifier.cpp",
30 # Hal.cpp cannot be built in unified mode because it relies on HalImpl.h.
31 SOURCES += [
32     "Hal.cpp",
35 if CONFIG["MOZ_WIDGET_TOOLKIT"] == "android":
36     LOCAL_INCLUDES += [
37         "/widget/android",
38     ]
39     UNIFIED_SOURCES += [
40         "android/AndroidProcessPriority.cpp",
41         "android/AndroidSensor.cpp",
42     ]
43     # AndroidHal.cpp cannot be built in unified mode because it relies on HalImpl.h.
44     SOURCES += [
45         "android/AndroidHal.cpp",
46     ]
47 elif CONFIG["OS_TARGET"] == "Linux":
49     UNIFIED_SOURCES += [
50         "fallback/FallbackProcessPriority.cpp",
51         "fallback/FallbackScreenConfiguration.cpp",
52         "fallback/FallbackSensor.cpp",
53         "fallback/FallbackVibration.cpp",
54     ]
55     if CONFIG["MOZ_ENABLE_DBUS"]:
56         UNIFIED_SOURCES += [
57             "linux/UPowerClient.cpp",
58         ]
59     else:
60         UNIFIED_SOURCES += [
61             "fallback/FallbackBattery.cpp",
62         ]
63 elif CONFIG["OS_TARGET"] == "WINNT":
64     REQUIRES_UNIFIED_BUILD = True
65     UNIFIED_SOURCES += [
66         "fallback/FallbackScreenConfiguration.cpp",
67         "fallback/FallbackVibration.cpp",
68         "windows/WindowsProcessPriority.cpp",
69         "windows/WindowsSensor.cpp",
70     ]
71     # WindowsBattery.cpp cannot be built in unified mode because it relies on HalImpl.h.
72     SOURCES += [
73         "windows/WindowsBattery.cpp",
74     ]
75 elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "cocoa":
76     UNIFIED_SOURCES += [
77         "cocoa/CocoaBattery.cpp",
78         "fallback/FallbackProcessPriority.cpp",
79         "fallback/FallbackScreenConfiguration.cpp",
80         "fallback/FallbackVibration.cpp",
81     ]
82 elif CONFIG["OS_TARGET"] in ("OpenBSD", "NetBSD", "FreeBSD", "DragonFly"):
83     UNIFIED_SOURCES += [
84         "fallback/FallbackProcessPriority.cpp",
85         "fallback/FallbackScreenConfiguration.cpp",
86         "fallback/FallbackSensor.cpp",
87         "fallback/FallbackVibration.cpp",
88     ]
89     if CONFIG["MOZ_ENABLE_DBUS"]:
90         UNIFIED_SOURCES += [
91             "linux/UPowerClient.cpp",
92         ]
93     else:
94         UNIFIED_SOURCES += [
95             "fallback/FallbackBattery.cpp",
96         ]
97 else:
98     UNIFIED_SOURCES += [
99         "fallback/FallbackBattery.cpp",
100         "fallback/FallbackProcessPriority.cpp",
101         "fallback/FallbackScreenConfiguration.cpp",
102         "fallback/FallbackSensor.cpp",
103         "fallback/FallbackVibration.cpp",
104     ]
106 # Fallbacks for backends implemented on Android only.
107 if CONFIG["MOZ_WIDGET_TOOLKIT"] != "android":
108     UNIFIED_SOURCES += [
109         "fallback/FallbackNetwork.cpp",
110     ]
112 if CONFIG["MOZ_WIDGET_TOOLKIT"] == "cocoa":
113     UNIFIED_SOURCES += [
114         "cocoa/CocoaSensor.mm",
115         "cocoa/smslib.mm",
116     ]
118 IPDL_SOURCES = [
119     "sandbox/PHal.ipdl",
122 include("/ipc/chromium/chromium-config.mozbuild")
124 FINAL_LIBRARY = "xul"
126 LOCAL_INCLUDES += [
127     "/dom/base",
130 CFLAGS += CONFIG["GLIB_CFLAGS"]
131 CFLAGS += CONFIG["MOZ_GTK3_CFLAGS"]
132 CFLAGS += CONFIG["MOZ_DBUS_GLIB_CFLAGS"]
133 CXXFLAGS += CONFIG["GLIB_CFLAGS"]
134 CXXFLAGS += CONFIG["MOZ_GTK3_CFLAGS"]
135 CXXFLAGS += CONFIG["MOZ_DBUS_GLIB_CFLAGS"]