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