Backed out changeset b71c8c052463 (bug 1943846) for causing mass failures. CLOSED...
[gecko.git] / mozglue / misc / moz.build
blobb7a2d88d42389c6934450260728d144d7d34646a
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 += ["dbghelp", "oleaut32", "ole32", "mincore"]
106     if not CONFIG["JS_STANDALONE"]:
107         SOURCES += [
108             "/ipc/mscom/COMWrappers.cpp",
109             "/ipc/mscom/ProcessRuntime.cpp",
110             "PreXULSkeletonUI.cpp",
111         ]
113 elif CONFIG["OS_ARCH"] == "Darwin":
114     SOURCES += [
115         "TimeStamp_darwin.cpp",
116     ]
117 elif CONFIG["HAVE_CLOCK_MONOTONIC"]:
118     SOURCES += [
119         "TimeStamp_posix.cpp",
120     ]
121 elif CONFIG["COMPILE_ENVIRONMENT"]:
122     error("No TimeStamp implementation on this platform.  Build will not succeed")
124 if CONFIG["OS_ARCH"] == "WINNT":
125     SOURCES += [
126         "ConditionVariable_windows.cpp",
127         "Mutex_windows.cpp",
128         "RWLock_windows.cpp",
129     ]
130 # WASI hasn't supported cond vars and mutexes yet so noop implementation is used.
131 elif CONFIG["OS_ARCH"] == "WASI":
132     SOURCES += [
133         "ConditionVariable_noop.cpp",
134         "Mutex_noop.cpp",
135     ]
136 else:
137     SOURCES += [
138         "ConditionVariable_posix.cpp",
139         "Mutex_posix.cpp",
140         "RWLock_posix.cpp",
141     ]
143 if CONFIG["MOZ_LINKER"] and CONFIG["MOZ_WIDGET_TOOLKIT"] == "android":
144     LOCAL_INCLUDES += [
145         "/mozglue/linker",
146     ]
148 SOURCES += [
149     "decimal/Decimal.cpp",
152 if CONFIG["CC_TYPE"] in ("clang", "clang-cl"):
153     # Suppress warnings from third-party V8 Decimal code.
154     SOURCES["decimal/Decimal.cpp"].flags += ["-Wno-implicit-fallthrough"]
156 for var in ("MOZ_APP_BASENAME", "MOZ_APP_VENDOR"):
157     DEFINES[var] = '"%s"' % CONFIG[var]