Bug 1858509 add thread-safety annotations around MediaSourceDemuxer::mMonitor r=alwu
[gecko.git] / mozglue / misc / moz.build
blob2e6669c2bf24b92420b8d34ab0129fcdf9774217
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     "MmapFaultHandler.h",
16     "PlatformConditionVariable.h",
17     "PlatformMutex.h",
18     "PlatformRWLock.h",
19     "Printf.h",
20     "SIMD.h",
21     "Sprintf.h",
22     "SSE.h",
23     "StackWalk.h",
24     "TimeStamp.h",
25     "Uptime.h",
28 EXPORTS.mozilla.glue += [
29     "Debug.h",
30     "WinUtils.h",
33 if CONFIG["OS_ARCH"] == "WINNT":
34     EXPORTS.mozilla += [
35         "GetKnownFolderPath.h",
36         "PreXULSkeletonUI.h",
37         "StackWalk_windows.h",
38         "StackWalkThread.h",
39         "TimeStamp_windows.h",
40         "WindowsDpiAwareness.h",
41     ]
43 SOURCES += [
44     "AutoProfilerLabel.cpp",
45     "AwakeTimeStamp.cpp",
46     "MmapFaultHandler.cpp",
47     "Printf.cpp",
48     "SIMD.cpp",
49     "StackWalk.cpp",
50     "TimeStamp.cpp",
51     "Uptime.cpp",
54 if CONFIG["CPU_ARCH"].startswith("x86"):
55     SOURCES += [
56         "SIMD_avx2.cpp",
57         "SSE.cpp",
58     ]
59     SOURCES["SIMD_avx2.cpp"].flags += ["-mavx2"]
61 if not CONFIG["JS_STANDALONE"]:
62     EXPORTS.mozilla += [
63         "ProcessType.h",
64         "RuntimeExceptionModule.h",
65     ]
67     SOURCES += [
68         "ProcessType.cpp",
69         "RuntimeExceptionModule.cpp",
70     ]
72 OS_LIBS += CONFIG["REALTIME_LIBS"]
74 if CONFIG["OS_ARCH"] == "WINNT":
75     EXPORTS.mozilla += [
76         "DynamicallyLinkedFunctionPtr.h",
77         "ImportDir.h",
78         "NativeNt.h",
79         "WindowsDpiInitialization.h",
80         "WindowsEnumProcessModules.h",
81         "WindowsMapRemoteView.h",
82         "WindowsProcessMitigations.h",
83         "WindowsStackCookie.h",
84         "WindowsUnwindInfo.h",
85     ]
86     EXPORTS.mozilla.glue += [
87         "WindowsUnicode.h",
88     ]
89     SOURCES += [
90         "GetKnownFolderPath.cpp",
91         "TimeStamp_windows.cpp",
92         "WindowsDllMain.cpp",
93         "WindowsDpiInitialization.cpp",
94         "WindowsMapRemoteView.cpp",
95         "WindowsProcessMitigations.cpp",
96         "WindowsUnicode.cpp",
97     ]
99     OS_LIBS += [
100         "dbghelp",
101         "oleaut32",
102         "ole32",
103     ]
105     if not CONFIG["JS_STANDALONE"]:
106         SOURCES += [
107             "/ipc/mscom/COMWrappers.cpp",
108             "/ipc/mscom/ProcessRuntime.cpp",
109             "PreXULSkeletonUI.cpp",
110         ]
112 elif CONFIG["HAVE_CLOCK_MONOTONIC"]:
113     SOURCES += [
114         "TimeStamp_posix.cpp",
115     ]
116 elif CONFIG["OS_ARCH"] == "Darwin":
117     SOURCES += [
118         "TimeStamp_darwin.cpp",
119     ]
120 elif CONFIG["COMPILE_ENVIRONMENT"]:
121     error("No TimeStamp implementation on this platform.  Build will not succeed")
123 if CONFIG["OS_ARCH"] == "WINNT":
124     SOURCES += [
125         "ConditionVariable_windows.cpp",
126         "Mutex_windows.cpp",
127         "RWLock_windows.cpp",
128     ]
129 # WASI hasn't supported cond vars and mutexes yet so noop implementation is used.
130 elif CONFIG["OS_ARCH"] == "WASI":
131     SOURCES += [
132         "ConditionVariable_noop.cpp",
133         "Mutex_noop.cpp",
134     ]
135 else:
136     SOURCES += [
137         "ConditionVariable_posix.cpp",
138         "Mutex_posix.cpp",
139         "RWLock_posix.cpp",
140     ]
142 if CONFIG["MOZ_LINKER"] and CONFIG["MOZ_WIDGET_TOOLKIT"] == "android":
143     LOCAL_INCLUDES += [
144         "/mozglue/linker",
145     ]
147 SOURCES += [
148     "decimal/Decimal.cpp",
151 if CONFIG["CC_TYPE"] in ("clang", "clang-cl"):
152     # Suppress warnings from third-party V8 Decimal code.
153     SOURCES["decimal/Decimal.cpp"].flags += ["-Wno-implicit-fallthrough"]
155 for var in ("MOZ_APP_BASENAME", "MOZ_APP_VENDOR"):
156     DEFINES[var] = '"%s"' % CONFIG[var]