Bug 1852754: part 9) Add tests for dynamically loading <link rel="prefetch"> elements...
[gecko.git] / toolkit / xre / moz.build
blobde05e0cc29752855138b4d189ce6a13c2121d715
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",
36 EXPORTS.mozilla += [
37     "AutoSQLiteLifetime.h",
38     "Bootstrap.h",
39     "CmdLineAndEnvUtils.h",
40     "GeckoArgs.h",
41     "MultiInstanceLock.h",
42     "SafeMode.h",
45 if CONFIG["MOZ_INSTRUMENT_EVENT_LOOP"]:
46     EXPORTS += ["EventTracer.h"]
48 if CONFIG["MOZ_WIDGET_TOOLKIT"] == "windows":
49     EXPORTS.mozilla += [
50         "AssembleCmdLine.h",
51         "DllPrefetchExperimentRegistryInfo.h",
52         "PolicyChecks.h",
53         "WinTokenUtils.h",
54     ]
55     UNIFIED_SOURCES += [
56         "/toolkit/mozapps/update/common/pathhash.cpp",
57         "/toolkit/mozapps/update/common/updateutils_win.cpp",
58         "DllPrefetchExperimentRegistryInfo.cpp",
59         "nsNativeAppSupportWin.cpp",
60         "WinTokenUtils.cpp",
61     ]
62     DEFINES["PROXY_PRINTING"] = 1
63     LOCAL_INCLUDES += [
64         "../components/printingui",
65     ]
66     if CONFIG["MOZ_LAUNCHER_PROCESS"]:
67         EXPORTS.mozilla += [
68             "LauncherRegistryInfo.h",
69         ]
70         UNIFIED_SOURCES += [
71             "LauncherRegistryInfo.cpp",
72         ]
73     DIRS += [
74         "dllservices",
75     ]
76 elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "cocoa":
77     EXPORTS.mozilla += [
78         "MacRunFromDmgUtils.h",
79     ]
80     UNIFIED_SOURCES += [
81         "MacApplicationDelegate.mm",
82         "MacAutoreleasePool.mm",
83         "MacLaunchHelper.mm",
84         "MacRunFromDmgUtils.mm",
85         "nsCommandLineServiceMac.mm",
86         "nsNativeAppSupportCocoa.mm",
87         "updaterfileutils_osx.mm",
88     ]
89     DEFINES["PROXY_PRINTING"] = 1
90     LOCAL_INCLUDES += [
91         "../components/printingui",
92     ]
93 elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "uikit":
94     UNIFIED_SOURCES += [
95         "nsNativeAppSupportDefault.cpp",
96         "UIKitDirProvider.mm",
97     ]
98 elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk":
99     UNIFIED_SOURCES += [
100         "nsNativeAppSupportUnix.cpp",
101     ]
102     CXXFLAGS += CONFIG["MOZ_X11_SM_CFLAGS"]
103 else:
104     UNIFIED_SOURCES += [
105         "nsNativeAppSupportDefault.cpp",
106     ]
108 if CONFIG["MOZ_HAS_REMOTE"]:
109     LOCAL_INCLUDES += [
110         "../components/remote",
111     ]
113 if CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk":
114     UNIFIED_SOURCES += [
115         "nsGDKErrorHandler.cpp",
116     ]
118 if CONFIG["MOZ_X11"]:
119     EXPORTS += ["nsX11ErrorHandler.h"]
120     UNIFIED_SOURCES += [
121         "nsX11ErrorHandler.cpp",
122     ]
124 if CONFIG["MOZ_WIDGET_TOOLKIT"] == "android":
125     UNIFIED_SOURCES += [
126         "nsAndroidStartup.cpp",
127     ]
129 if CONFIG["MOZ_WIDGET_TOOLKIT"] != "android":
130     UNIFIED_SOURCES += [
131         "MultiInstanceLock.cpp",
132     ]
134 UNIFIED_SOURCES += [
135     "/toolkit/mozapps/update/common/commonupdatedir.cpp",
136     "AutoSQLiteLifetime.cpp",
137     "Bootstrap.cpp",
138     "CmdLineAndEnvUtils.cpp",
139     "CreateAppData.cpp",
140     "nsConsoleWriter.cpp",
141     "nsNativeAppSupportBase.cpp",
142     "nsSigHandlers.cpp",
143     "nsXREDirProvider.cpp",
146 # nsAppRunner.cpp and ProfileReset.cpp cannot be built in unified mode because
147 # they pull in OS X system headers.
148 # nsEmbedFunctions.cpp cannot be built in unified mode because it pulls in X11 headers.
149 SOURCES += [
150     "../../other-licenses/nsis/Contrib/CityHash/cityhash/city.cpp",
151     "nsAppRunner.cpp",
152     "nsEmbedFunctions.cpp",
153     "ProfileReset.cpp",
156 if CONFIG["MOZ_INSTRUMENT_EVENT_LOOP"]:
157     UNIFIED_SOURCES += [
158         "EventTracer.cpp",
159     ]
161 if CONFIG["MOZ_UPDATER"]:
162     if CONFIG["MOZ_WIDGET_TOOLKIT"] != "android":
163         UNIFIED_SOURCES += [
164             "nsUpdateDriver.cpp",
165             "nsUpdateSyncManager.cpp",
166         ]
168 if CONFIG["MOZ_PDF_PRINTING"]:
169     DEFINES["PROXY_PRINTING"] = 1
170     LOCAL_INCLUDES += [
171         "../components/printingui",
172     ]
174 XPCOM_MANIFESTS += [
175     "components.conf",
178 include("/ipc/chromium/chromium-config.mozbuild")
180 FINAL_LIBRARY = "xul"
182 if CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk":
183     DEFINES["USE_GLX_TEST"] = True
184     DIRS += ["glxtest"]
186 for var in (
187     "MOZ_APP_NAME",
188     "MOZ_APP_BASENAME",
189     "MOZ_APP_DISPLAYNAME",
190     "MOZ_APP_VENDOR",
191     "MOZ_APP_VERSION",
192     "OS_TARGET",
193     "MOZ_WIDGET_TOOLKIT",
195     DEFINES[var] = '"%s"' % CONFIG[var]
197 if CONFIG["MOZ_DEFAULT_BROWSER_AGENT"] and CONFIG["OS_ARCH"] == "WINNT":
198     DEFINES["MOZ_DEFAULT_BROWSER_AGENT"] = CONFIG["MOZ_DEFAULT_BROWSER_AGENT"]
200 if CONFIG["MOZ_UPDATER"] and CONFIG["MOZ_WIDGET_TOOLKIT"] != "android":
201     DEFINES["MOZ_UPDATER"] = True
203 if CONFIG["MOZ_WIDGET_TOOLKIT"] == "windows":
204     DEFINES["WIN32_LEAN_AND_MEAN"] = True
205     DEFINES["UNICODE"] = True
206     DEFINES["_UNICODE"] = True
208 if CONFIG["MOZ_WIDGET_TOOLKIT"] == "android":
209     DEFINES["ANDROID_PACKAGE_NAME"] = '"%s"' % CONFIG["ANDROID_PACKAGE_NAME"]
211 DEFINES["MOZ_DISTRIBUTION_ID"] = '"%s"' % CONFIG["MOZ_DISTRIBUTION_ID"]
213 if CONFIG["TARGET_XPCOM_ABI"]:
214     DEFINES["TARGET_OS_ABI"] = '"%s_%s"' % (
215         CONFIG["OS_TARGET"],
216         CONFIG["TARGET_XPCOM_ABI"],
217     )
219 if CONFIG["OS_ARCH"] == "Linux" and "lib64" in CONFIG["libdir"]:
220     DEFINES["HAVE_USR_LIB64_DIR"] = True
222 DEFINES["GRE_MILESTONE"] = CONFIG["GRE_MILESTONE"]
223 DEFINES["MOZ_APP_VERSION_DISPLAY"] = CONFIG["MOZ_APP_VERSION_DISPLAY"]
225 for var in ("APP_VERSION", "APP_ID"):
226     DEFINES[var] = CONFIG["MOZ_%s" % var]
228 if CONFIG["MOZ_BUILD_APP"] == "browser":
229     DEFINES["MOZ_BUILD_APP_IS_BROWSER"] = True
231 if CONFIG["MOZ_USE_NSS_FOR_MAR"]:
232     DEFINES["MAR_NSS"] = True
234 LOCAL_INCLUDES += [
235     "../../other-licenses/nsis/Contrib/CityHash/cityhash",
236     "../components/find",
237     "../components/printingui/ipc",
238     "../components/windowwatcher",
239     "../mozapps/update/common",
240     "../profile",
241     "/config",
242     "/dom/base",
243     "/dom/commandhandler",
244     "/dom/ipc",
245     "/dom/webbrowserpersist",
246     "/testing/gtest/mozilla",
247     "/toolkit/crashreporter",
248     "/xpcom/build",
251 if CONFIG["MOZ_SANDBOX"] and CONFIG["OS_ARCH"] == "WINNT":
252     LOCAL_INCLUDES += [
253         "/security/sandbox/chromium",
254         "/security/sandbox/chromium-shim",
255     ]
257 if CONFIG["MOZ_SANDBOX"] and CONFIG["OS_ARCH"] == "Linux":
258     USE_LIBS += [
259         "mozsandbox",
260     ]
262 if CONFIG["MOZ_WIDGET_TOOLKIT"] == "cocoa":
263     LOCAL_INCLUDES += [
264         "/widget",
265         "/widget/cocoa",
266         "/xpcom/base",
267     ]
269 CXXFLAGS += CONFIG["MOZ_DBUS_CFLAGS"]
270 CXXFLAGS += CONFIG["MOZ_DBUS_GLIB_CFLAGS"]
272 if CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk":
273     CXXFLAGS += CONFIG["MOZ_GTK3_CFLAGS"]
274     CXXFLAGS += CONFIG["MOZ_PANGO_CFLAGS"]
276 DEFINES["TOPOBJDIR"] = TOPOBJDIR
277 FINAL_TARGET_PP_FILES += ["platform.ini"]
279 if CONFIG["ENABLE_TESTS"]:
280     DIRS += ["test/gtest"]