Bug 1753720 [wpt PR 32698] - [FedCM] Perform CSP checks on the provider URL, a=testonly
[gecko.git] / toolkit / xre / moz.build
blobb1e2b58621d6486dc995080b1ff56b8a334ab545
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 include("../components/telemetry/telemetry-constants.mozbuild")
9 with Files("**"):
10     BUG_COMPONENT = ("Toolkit", "Startup and Profile System")
12 if CONFIG["OS_ARCH"] == "WINNT":
13     TEST_DIRS += ["test/win"]
15 MOCHITEST_MANIFESTS += ["test/mochitest.ini"]
16 BROWSER_CHROME_MANIFESTS += ["test/browser.ini"]
17 XPCSHELL_TESTS_MANIFESTS += ["test/xpcshell.ini"]
18 MARIONETTE_UNIT_MANIFESTS += ["test/marionette/marionette.ini"]
20 XPIDL_SOURCES += [
21     "nsINativeAppSupport.idl",
22     "nsIXREDirProvider.idl",
25 if CONFIG["OS_ARCH"] == "WINNT":
26     XPIDL_SOURCES += [
27         "nsIWinAppHelper.idl",
28     ]
30 XPIDL_MODULE = "xulapp"
32 EXPORTS += [
33     "nsAppRunner.h",
34     "nsIAppStartupNotifier.h",
37 EXPORTS.mozilla += [
38     "AutoSQLiteLifetime.h",
39     "Bootstrap.h",
40     "CmdLineAndEnvUtils.h",
41     "GeckoArgs.h",
42     "MultiInstanceLock.h",
43     "SafeMode.h",
46 if CONFIG["MOZ_INSTRUMENT_EVENT_LOOP"]:
47     EXPORTS += ["EventTracer.h"]
49 if CONFIG["MOZ_WIDGET_TOOLKIT"] == "windows":
50     EXPORTS.mozilla += [
51         "AssembleCmdLine.h",
52         "DllPrefetchExperimentRegistryInfo.h",
53         "PolicyChecks.h",
54         "WinTokenUtils.h",
55     ]
56     UNIFIED_SOURCES += [
57         "/toolkit/mozapps/update/common/pathhash.cpp",
58         "/toolkit/mozapps/update/common/updateutils_win.cpp",
59         "DllPrefetchExperimentRegistryInfo.cpp",
60         "nsNativeAppSupportWin.cpp",
61         "WinTokenUtils.cpp",
62     ]
63     DEFINES["PROXY_PRINTING"] = 1
64     LOCAL_INCLUDES += [
65         "../components/printingui",
66     ]
67     if CONFIG["MOZ_LAUNCHER_PROCESS"]:
68         EXPORTS.mozilla += [
69             "LauncherRegistryInfo.h",
70         ]
71         UNIFIED_SOURCES += [
72             "LauncherRegistryInfo.cpp",
73         ]
74     DIRS += [
75         "dllservices",
76     ]
77 elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "cocoa":
78     EXPORTS.mozilla += [
79         "MacRunFromDmgUtils.h",
80     ]
81     UNIFIED_SOURCES += [
82         "MacApplicationDelegate.mm",
83         "MacAutoreleasePool.mm",
84         "MacLaunchHelper.mm",
85         "MacRunFromDmgUtils.mm",
86         "nsCommandLineServiceMac.mm",
87         "nsNativeAppSupportCocoa.mm",
88         "updaterfileutils_osx.mm",
89     ]
90     DEFINES["PROXY_PRINTING"] = 1
91     LOCAL_INCLUDES += [
92         "../components/printingui",
93     ]
94 elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "uikit":
95     UNIFIED_SOURCES += [
96         "nsNativeAppSupportDefault.cpp",
97         "UIKitDirProvider.mm",
98     ]
99 elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk":
100     UNIFIED_SOURCES += [
101         "nsNativeAppSupportUnix.cpp",
102     ]
103     CXXFLAGS += CONFIG["MOZ_X11_SM_CFLAGS"]
104 else:
105     UNIFIED_SOURCES += [
106         "nsNativeAppSupportDefault.cpp",
107     ]
109 if CONFIG["MOZ_HAS_REMOTE"]:
110     LOCAL_INCLUDES += [
111         "../components/remote",
112     ]
114 if CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk":
115     UNIFIED_SOURCES += [
116         "nsGDKErrorHandler.cpp",
117     ]
119 if CONFIG["MOZ_X11"]:
120     EXPORTS += ["nsX11ErrorHandler.h"]
121     UNIFIED_SOURCES += [
122         "nsX11ErrorHandler.cpp",
123     ]
125 if CONFIG["MOZ_WIDGET_TOOLKIT"] == "android":
126     UNIFIED_SOURCES += [
127         "nsAndroidStartup.cpp",
128     ]
130 if CONFIG["MOZ_WIDGET_TOOLKIT"] != "android":
131     UNIFIED_SOURCES += [
132         "MultiInstanceLock.cpp",
133     ]
135 UNIFIED_SOURCES += [
136     "/toolkit/mozapps/update/common/commonupdatedir.cpp",
137     "AutoSQLiteLifetime.cpp",
138     "Bootstrap.cpp",
139     "CmdLineAndEnvUtils.cpp",
140     "CreateAppData.cpp",
141     "nsAppStartupNotifier.cpp",
142     "nsConsoleWriter.cpp",
143     "nsEmbeddingModule.cpp",
144     "nsNativeAppSupportBase.cpp",
145     "nsSigHandlers.cpp",
146     "nsXREDirProvider.cpp",
149 # nsAppRunner.cpp and ProfileReset.cpp cannot be built in unified mode because
150 # they pull in OS X system headers.
151 # nsEmbedFunctions.cpp cannot be built in unified mode because it pulls in X11 headers.
152 SOURCES += [
153     "../../other-licenses/nsis/Contrib/CityHash/cityhash/city.cpp",
154     "nsAppRunner.cpp",
155     "nsEmbedFunctions.cpp",
156     "ProfileReset.cpp",
159 if CONFIG["MOZ_X11"]:
160     UNIFIED_SOURCES += [
161         "glxtest.cpp",
162     ]
164 if CONFIG["MOZ_INSTRUMENT_EVENT_LOOP"]:
165     UNIFIED_SOURCES += [
166         "EventTracer.cpp",
167     ]
169 if CONFIG["MOZ_UPDATER"]:
170     if CONFIG["MOZ_WIDGET_TOOLKIT"] != "android":
171         UNIFIED_SOURCES += [
172             "nsUpdateDriver.cpp",
173             "nsUpdateSyncManager.cpp",
174         ]
176 if CONFIG["MOZ_PDF_PRINTING"]:
177     DEFINES["PROXY_PRINTING"] = 1
178     LOCAL_INCLUDES += [
179         "../components/printingui",
180     ]
182 XPCOM_MANIFESTS += [
183     "components.conf",
186 include("/ipc/chromium/chromium-config.mozbuild")
188 FINAL_LIBRARY = "xul"
190 if CONFIG["MOZ_X11"]:
191     DEFINES["USE_GLX_TEST"] = True
193 for var in (
194     "MOZ_APP_NAME",
195     "MOZ_APP_BASENAME",
196     "MOZ_APP_DISPLAYNAME",
197     "MOZ_APP_VENDOR",
198     "MOZ_APP_VERSION",
199     "OS_TARGET",
200     "MOZ_WIDGET_TOOLKIT",
202     DEFINES[var] = '"%s"' % CONFIG[var]
204 if CONFIG["MOZ_DEFAULT_BROWSER_AGENT"] and CONFIG["OS_ARCH"] == "WINNT":
205     DEFINES["MOZ_DEFAULT_BROWSER_AGENT"] = CONFIG["MOZ_DEFAULT_BROWSER_AGENT"]
207 if CONFIG["MOZ_UPDATER"] and CONFIG["MOZ_WIDGET_TOOLKIT"] != "android":
208     DEFINES["MOZ_UPDATER"] = True
210 if CONFIG["MOZ_WIDGET_TOOLKIT"] == "windows":
211     DEFINES["WIN32_LEAN_AND_MEAN"] = True
212     DEFINES["UNICODE"] = True
213     DEFINES["_UNICODE"] = True
215 if CONFIG["MOZ_WIDGET_TOOLKIT"] == "android":
216     DEFINES["ANDROID_PACKAGE_NAME"] = '"%s"' % CONFIG["ANDROID_PACKAGE_NAME"]
218 if CONFIG["TARGET_XPCOM_ABI"]:
219     DEFINES["TARGET_OS_ABI"] = '"%s_%s"' % (
220         CONFIG["OS_TARGET"],
221         CONFIG["TARGET_XPCOM_ABI"],
222     )
224 if CONFIG["OS_ARCH"] == "Linux" and "lib64" in CONFIG["libdir"]:
225     DEFINES["HAVE_USR_LIB64_DIR"] = True
227 DEFINES["GRE_MILESTONE"] = CONFIG["GRE_MILESTONE"]
228 DEFINES["MOZ_APP_VERSION_DISPLAY"] = CONFIG["MOZ_APP_VERSION_DISPLAY"]
230 for var in ("APP_VERSION", "APP_ID"):
231     DEFINES[var] = CONFIG["MOZ_%s" % var]
233 if CONFIG["MOZ_BUILD_APP"] == "browser":
234     DEFINES["MOZ_BUILD_APP_IS_BROWSER"] = True
236 LOCAL_INCLUDES += [
237     "../../other-licenses/nsis/Contrib/CityHash/cityhash",
238     "../components/find",
239     "../components/printingui/ipc",
240     "../components/windowwatcher",
241     "../mozapps/update/common",
242     "../profile",
243     "/config",
244     "/dom/base",
245     "/dom/commandhandler",
246     "/dom/ipc",
247     "/dom/webbrowserpersist",
248     "/testing/gtest/mozilla",
249     "/toolkit/crashreporter",
250     "/xpcom/build",
253 if CONFIG["MOZ_SANDBOX"] and CONFIG["OS_ARCH"] == "WINNT":
254     LOCAL_INCLUDES += [
255         "/security/sandbox/chromium",
256         "/security/sandbox/chromium-shim",
257     ]
259 if CONFIG["MOZ_SANDBOX"] and CONFIG["OS_ARCH"] == "Linux":
260     USE_LIBS += [
261         "mozsandbox",
262     ]
264 if CONFIG["MOZ_WIDGET_TOOLKIT"] == "cocoa":
265     LOCAL_INCLUDES += [
266         "/widget",
267         "/widget/cocoa",
268         "/xpcom/base",
269     ]
271 CXXFLAGS += CONFIG["MOZ_DBUS_CFLAGS"]
272 CXXFLAGS += CONFIG["MOZ_DBUS_GLIB_CFLAGS"]
274 if CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk":
275     CXXFLAGS += CONFIG["MOZ_GTK3_CFLAGS"]
276     CXXFLAGS += CONFIG["MOZ_PANGO_CFLAGS"]
278 DEFINES["TOPOBJDIR"] = TOPOBJDIR
279 FINAL_TARGET_PP_FILES += ["platform.ini"]
281 if CONFIG["MOZ_IPDL_TESTS"]:
282     DEFINES["MOZ_IPDL_TESTS"] = True
284 if CONFIG["ENABLE_TESTS"]:
285     DIRS += ["test/gtest"]
287 if CONFIG["MOZ_BACKGROUNDTASKS"]:
288     DEFINES["MOZ_BACKGROUNDTASKS"] = True
290 REQUIRES_UNIFIED_BUILD = True