Backed out changeset 8aaffdf63d09 (bug 1920575) for causing bc failures on browser_si...
[gecko.git] / mozglue / misc / moz.build
blob585a435699a89cb283b7df4783e457d45dfdb8f5
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 FINAL_LIBRARY = "mozglue"
9 EXPORTS.mozilla += [
10     "AutoProfilerLabel.h",
11     "AwakeTimeStamp.h",
12     "decimal/Decimal.h",
13     "decimal/DoubleConversion.h",
14     "IntegerPrintfMacros.h",
15     "LoggingCore.h",
16     "MmapFaultHandler.h",
17     "PlatformConditionVariable.h",
18     "PlatformMutex.h",
19     "PlatformRWLock.h",
20     "Printf.h",
21     "SIMD.h",
22     "Sprintf.h",
23     "SSE.h",
24     "StackWalk.h",
25     "TimeStamp.h",
26     "Uptime.h",
29 EXPORTS.mozilla.glue += [
30     "Debug.h",
31     "WinUtils.h",
34 if CONFIG["OS_ARCH"] == "WINNT":
35     EXPORTS.mozilla += [
36         "GetKnownFolderPath.h",
37         "PreXULSkeletonUI.h",
38         "StackWalk_windows.h",
39         "StackWalkThread.h",
40         "TimeStamp_windows.h",
41         "WindowsDpiAwareness.h",
42     ]
44 SOURCES += [
45     "AutoProfilerLabel.cpp",
46     "AwakeTimeStamp.cpp",
47     "Debug.cpp",
48     "LoggingCore.cpp",
49     "MmapFaultHandler.cpp",
50     "Printf.cpp",
51     "SIMD.cpp",
52     "StackWalk.cpp",
53     "TimeStamp.cpp",
54     "Uptime.cpp",
57 if CONFIG["TARGET_CPU"].startswith("x86"):
58     SOURCES += [
59         "SIMD_avx2.cpp",
60         "SSE.cpp",
61     ]
62     SOURCES["SIMD_avx2.cpp"].flags += ["-mavx2"]
64 if not CONFIG["JS_STANDALONE"]:
65     EXPORTS.mozilla += [
66         "ProcessType.h",
67         "RuntimeExceptionModule.h",
68     ]
70     SOURCES += [
71         "ProcessType.cpp",
72         "RuntimeExceptionModule.cpp",
73     ]
75 OS_LIBS += CONFIG["REALTIME_LIBS"]
77 if CONFIG["OS_ARCH"] == "WINNT":
78     EXPORTS.mozilla += [
79         "DynamicallyLinkedFunctionPtr.h",
80         "ImportDir.h",
81         "NativeNt.h",
82         "WindowsDiagnostics.h",
83         "WindowsDpiInitialization.h",
84         "WindowsEnumProcessModules.h",
85         "WindowsMapRemoteView.h",
86         "WindowsProcessMitigations.h",
87         "WindowsStackCookie.h",
88         "WindowsUnwindInfo.h",
89     ]
90     EXPORTS.mozilla.glue += [
91         "WindowsUnicode.h",
92     ]
93     SOURCES += [
94         "GetKnownFolderPath.cpp",
95         "TimeStamp_windows.cpp",
96         "WindowsDiagnostics.cpp",
97         "WindowsDllMain.cpp",
98         "WindowsDpiInitialization.cpp",
99         "WindowsMapRemoteView.cpp",
100         "WindowsProcessMitigations.cpp",
101         "WindowsUnicode.cpp",
102     ]
104     OS_LIBS += [
105         "dbghelp",
106         "oleaut32",
107         "ole32",
108     ]
110     if not CONFIG["JS_STANDALONE"]:
111         SOURCES += [
112             "/ipc/mscom/COMWrappers.cpp",
113             "/ipc/mscom/ProcessRuntime.cpp",
114             "PreXULSkeletonUI.cpp",
115         ]
117 elif CONFIG["OS_ARCH"] == "Darwin":
118     SOURCES += [
119         "TimeStamp_darwin.cpp",
120     ]
121 elif CONFIG["HAVE_CLOCK_MONOTONIC"]:
122     SOURCES += [
123         "TimeStamp_posix.cpp",
124     ]
125 elif CONFIG["COMPILE_ENVIRONMENT"]:
126     error("No TimeStamp implementation on this platform.  Build will not succeed")
128 if CONFIG["OS_ARCH"] == "WINNT":
129     SOURCES += [
130         "ConditionVariable_windows.cpp",
131         "Mutex_windows.cpp",
132         "RWLock_windows.cpp",
133     ]
134 # WASI hasn't supported cond vars and mutexes yet so noop implementation is used.
135 elif CONFIG["OS_ARCH"] == "WASI":
136     SOURCES += [
137         "ConditionVariable_noop.cpp",
138         "Mutex_noop.cpp",
139     ]
140 else:
141     SOURCES += [
142         "ConditionVariable_posix.cpp",
143         "Mutex_posix.cpp",
144         "RWLock_posix.cpp",
145     ]
147 if CONFIG["MOZ_LINKER"] and CONFIG["MOZ_WIDGET_TOOLKIT"] == "android":
148     LOCAL_INCLUDES += [
149         "/mozglue/linker",
150     ]
152 SOURCES += [
153     "decimal/Decimal.cpp",
156 if CONFIG["CC_TYPE"] in ("clang", "clang-cl"):
157     # Suppress warnings from third-party V8 Decimal code.
158     SOURCES["decimal/Decimal.cpp"].flags += ["-Wno-implicit-fallthrough"]
160 for var in ("MOZ_APP_BASENAME", "MOZ_APP_VENDOR"):
161     DEFINES[var] = '"%s"' % CONFIG[var]