Bug 1874535 - [wpt-sync] Update web-platform-tests to 2fb9eb91e48870dd8f9bbb7adae728d...
[gecko.git] / modules / libpref / moz.build
blob3a3751c7b85cb1126f56bab29633931d91d46f35
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 with Files("**"):
8     BUG_COMPONENT = ("Core", "Preferences: Backend")
10 if CONFIG["ENABLE_TESTS"]:
11     DIRS += ["test/gtest"]
13 XPCSHELL_TESTS_MANIFESTS += [
14     "test/unit/xpcshell.toml",
15     "test/unit_ipc/xpcshell.toml",
18 BROWSER_CHROME_MANIFESTS += ["test/browser/browser.toml"]
20 XPIDL_SOURCES += [
21     "nsIPrefBranch.idl",
22     "nsIPrefLocalizedString.idl",
23     "nsIPrefService.idl",
24     "nsIRelativeFilePref.idl",
27 XPIDL_MODULE = "pref"
29 pref_groups = [
30     "accessibility",
31     "alerts",
32     "apz",
33     "beacon",
34     "bidi",
35     "browser",
36     "channelclassifier",
37     "clipboard",
38     "content",
39     "converter",
40     "cookiebanners",
41     "datareporting",
42     "device",
43     "devtools",
44     "docshell",
45     "dom",
46     "editor",
47     "extensions",
48     "fission",
49     "font",
50     "full_screen_api",
51     "general",
52     "geo",
53     "gfx",
54     "gl",
55     "html5",
56     "idle_period",
57     "image",
58     "intl",
59     "javascript",
60     "layers",
61     "layout",
62     "mathml",
63     "media",
64     "memory",
65     "midi",
66     "mousewheel",
67     "mozilla",
68     "network",
69     "nglayout",
70     "page_load",
71     "pdfjs",
72     "permissions",
73     "places",
74     "plain_text",
75     "preferences",
76     "print",
77     "privacy",
78     "prompts",
79     "security",
80     "signon",
81     "slider",
82     "storage",
83     "svg",
84     "telemetry",
85     "test",
86     "threads",
87     "timer",
88     "toolkit",
89     "ui",
90     "urlclassifier",
91     "view_source",
92     "webgl",
93     "widget",
94     "zoom",
96 if CONFIG["OS_TARGET"] == "Android":
97     pref_groups += [
98         "android",
99         "consoleservice",
100     ]
101 if CONFIG["FUZZING"]:
102     pref_groups += ["fuzzing"]
103 pref_groups = tuple(sorted(pref_groups))
105 # Note: generate_static_pref_list.py relies on StaticPrefListAll.h being first.
106 gen_h = ["init/StaticPrefListAll.h"]
107 gen_h += ["StaticPrefsAll.h"]
108 gen_h += ["init/StaticPrefList_{}.h".format(pg) for pg in pref_groups]
109 gen_h += ["StaticPrefs_{}.h".format(pg) for pg in pref_groups]
111 gen_cpp = ["init/StaticPrefsCGetters.cpp"]
113 gen_rs = ["static_prefs.rs"]
115 EXPORTS.mozilla += [
116     "init/StaticPrefListBegin.h",
117     "init/StaticPrefListEnd.h",
118     "nsRelativeFilePref.h",
119     "Preferences.h",
120     "StaticPrefsBase.h",
122 EXPORTS.mozilla += sorted(["!" + g for g in gen_h])
124 UNIFIED_SOURCES += [
125     "Preferences.cpp",
126     "SharedPrefMap.cpp",
129 gen_all_tuple = tuple(gen_h + gen_cpp + gen_rs)
131 GeneratedFile(
132     *gen_all_tuple,
133     script="init/generate_static_pref_list.py",
134     entry_point="emit_code",
135     inputs=["init/StaticPrefList.yaml"]
138 PYTHON_UNITTEST_MANIFESTS += [
139     "test/python.toml",
142 XPCOM_MANIFESTS += [
143     "components.conf",
146 SPHINX_TREES["/modules/libpref"] = "docs"
148 include("/ipc/chromium/chromium-config.mozbuild")
150 FINAL_LIBRARY = "xul"
152 DEFINES["OS_ARCH"] = CONFIG["OS_ARCH"]
153 DEFINES["MOZ_WIDGET_TOOLKIT"] = CONFIG["MOZ_WIDGET_TOOLKIT"]
155 if CONFIG["MOZ_SERVICES_SYNC"]:
156     DEFINES["MOZ_SERVICES_SYNC"] = True
158 if CONFIG["MOZ_BUILD_APP"] == "browser":
159     DEFINES["MOZ_BUILD_APP_IS_BROWSER"] = True
161 if CONFIG["MOZ_WEBEXT_WEBIDL_ENABLED"]:
162     DEFINES["MOZ_WEBEXT_WEBIDL_ENABLED"] = True
164 if CONFIG["MOZ_WIDGET_TOOLKIT"] == "android":
165     if not CONFIG["MOZ_ANDROID_FAT_AAR_ARCHITECTURES"]:
166         FINAL_TARGET_PP_FILES[CONFIG["ANDROID_CPU_ARCH"]] += [
167             "greprefs.js",
168         ]
169     else:
170         for arch in CONFIG["MOZ_ANDROID_FAT_AAR_ARCHITECTURES"]:
171             FINAL_TARGET_FILES[arch] += [
172                 "!/dist/fat-aar/output/{arch}/greprefs.js".format(arch=arch),
173             ]
174 else:
175     FINAL_TARGET_PP_FILES += [
176         "greprefs.js",
177     ]