Backed out changeset 5a2ea27885f0 (bug 1850738) for causing build bustages on gfxUser...
[gecko.git] / hal / moz.build
blobbc13c596c0d1070d7d085024d1f1d2150bd05ff9
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/AndroidPerformanceHintManager.cpp",
41         "android/AndroidProcessPriority.cpp",
42         "android/AndroidSensor.cpp",
43     ]
44     # AndroidHal.cpp cannot be built in unified mode because it relies on HalImpl.h.
45     SOURCES += [
46         "android/AndroidHal.cpp",
47     ]
48 elif CONFIG["OS_TARGET"] == "Linux":
50     UNIFIED_SOURCES += [
51         "fallback/FallbackScreenConfiguration.cpp",
52         "fallback/FallbackSensor.cpp",
53         "fallback/FallbackVibration.cpp",
54         "linux/LinuxProcessPriority.cpp",
55     ]
56     if CONFIG["MOZ_ENABLE_DBUS"]:
57         UNIFIED_SOURCES += [
58             "linux/UPowerClient.cpp",
59         ]
60     else:
61         UNIFIED_SOURCES += [
62             "fallback/FallbackBattery.cpp",
63         ]
64 elif CONFIG["OS_TARGET"] == "WINNT":
65     UNIFIED_SOURCES += [
66         "fallback/FallbackVibration.cpp",
67         "windows/WindowsSensor.cpp",
68     ]
69     # WindowsBattery.cpp cannot be built in unified mode because it relies on HalImpl.h.
70     # WindowsProcessPriority.cpp needs to set _WIN32_WINNT to Windows 8
71     # WindowsScreenConfiguration.cpp needs to set WINVER to 0x0602.
72     SOURCES += [
73         "windows/WindowsBattery.cpp",
74         "windows/WindowsProcessPriority.cpp",
75         "windows/WindowsScreenConfiguration.cpp",
76     ]
77 elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "cocoa":
78     UNIFIED_SOURCES += [
79         "cocoa/CocoaBattery.cpp",
80         "fallback/FallbackProcessPriority.cpp",
81         "fallback/FallbackScreenConfiguration.cpp",
82         "fallback/FallbackVibration.cpp",
83     ]
84 elif CONFIG["OS_TARGET"] in ("OpenBSD", "NetBSD", "FreeBSD", "DragonFly"):
85     UNIFIED_SOURCES += [
86         "fallback/FallbackProcessPriority.cpp",
87         "fallback/FallbackScreenConfiguration.cpp",
88         "fallback/FallbackSensor.cpp",
89         "fallback/FallbackVibration.cpp",
90     ]
91     if CONFIG["MOZ_ENABLE_DBUS"]:
92         UNIFIED_SOURCES += [
93             "linux/UPowerClient.cpp",
94         ]
95     else:
96         UNIFIED_SOURCES += [
97             "fallback/FallbackBattery.cpp",
98         ]
99 else:
100     UNIFIED_SOURCES += [
101         "fallback/FallbackBattery.cpp",
102         "fallback/FallbackProcessPriority.cpp",
103         "fallback/FallbackScreenConfiguration.cpp",
104         "fallback/FallbackSensor.cpp",
105         "fallback/FallbackVibration.cpp",
106     ]
108 # Fallbacks for backends implemented on Android only.
109 if CONFIG["MOZ_WIDGET_TOOLKIT"] != "android":
110     UNIFIED_SOURCES += [
111         "fallback/FallbackNetwork.cpp",
112         "fallback/FallbackPerformanceHintManager.cpp",
113     ]
115 if CONFIG["MOZ_WIDGET_TOOLKIT"] == "cocoa":
116     UNIFIED_SOURCES += [
117         "cocoa/CocoaSensor.mm",
118         "cocoa/smslib.mm",
119     ]
121 IPDL_SOURCES = [
122     "sandbox/PHal.ipdl",
125 include("/ipc/chromium/chromium-config.mozbuild")
127 FINAL_LIBRARY = "xul"
129 LOCAL_INCLUDES += [
130     "/dom/base",
133 CFLAGS += CONFIG["GLIB_CFLAGS"]
134 CFLAGS += CONFIG["MOZ_GTK3_CFLAGS"]
135 CFLAGS += CONFIG["MOZ_DBUS_GLIB_CFLAGS"]
136 CXXFLAGS += CONFIG["GLIB_CFLAGS"]
137 CXXFLAGS += CONFIG["MOZ_GTK3_CFLAGS"]
138 CXXFLAGS += CONFIG["MOZ_DBUS_GLIB_CFLAGS"]