Backed out changeset 5f819082a015 (bug 1936189) for causing reftest failures @ native...
[gecko.git] / modules / libpref / moz.build
blob4e582caaa58884b27be20c45e4c39b0b841261ef
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     "logging",
63     "mathml",
64     "media",
65     "memory",
66     "middlemouse",
67     "midi",
68     "mousewheel",
69     "mozilla",
70     "network",
71     "nglayout",
72     "page_load",
73     "pdfjs",
74     "permissions",
75     "places",
76     "plain_text",
77     "preferences",
78     "print",
79     "privacy",
80     "prompts",
81     "security",
82     "signon",
83     "slider",
84     "storage",
85     "svg",
86     "telemetry",
87     "test",
88     "threads",
89     "timer",
90     "toolkit",
91     "ui",
92     "urlclassifier",
93     "view_source",
94     "webgl",
95     "widget",
96     "zoom",
98 if CONFIG["OS_TARGET"] == "Android":
99     pref_groups += [
100         "android",
101         "consoleservice",
102     ]
103 if CONFIG["FUZZING"]:
104     pref_groups += ["fuzzing"]
105 pref_groups = tuple(sorted(pref_groups))
107 # Note: generate_static_pref_list.py relies on StaticPrefListAll.h being first.
108 gen_h = ["init/StaticPrefListAll.h"]
109 gen_h += ["StaticPrefsAll.h"]
110 gen_h += ["init/StaticPrefList_{}.h".format(pg) for pg in pref_groups]
111 gen_h += ["StaticPrefs_{}.h".format(pg) for pg in pref_groups]
113 gen_cpp = ["init/StaticPrefsCGetters.cpp"]
115 gen_rs = ["static_prefs.rs"]
117 EXPORTS.mozilla += [
118     "init/StaticPrefListBegin.h",
119     "init/StaticPrefListEnd.h",
120     "nsRelativeFilePref.h",
121     "Preferences.h",
122     "StaticPrefsBase.h",
124 EXPORTS.mozilla += sorted(["!" + g for g in gen_h])
126 UNIFIED_SOURCES += [
127     "Preferences.cpp",
128     "SharedPrefMap.cpp",
131 gen_all_tuple = tuple(gen_h + gen_cpp + gen_rs)
133 GeneratedFile(
134     *gen_all_tuple,
135     script="init/generate_static_pref_list.py",
136     entry_point="emit_code",
137     inputs=["init/StaticPrefList.yaml"]
140 PYTHON_UNITTEST_MANIFESTS += [
141     "test/python.toml",
144 XPCOM_MANIFESTS += [
145     "components.conf",
148 SPHINX_TREES["/modules/libpref"] = "docs"
150 include("/ipc/chromium/chromium-config.mozbuild")
152 FINAL_LIBRARY = "xul"
154 DEFINES["OS_ARCH"] = CONFIG["OS_ARCH"]
155 DEFINES["MOZ_WIDGET_TOOLKIT"] = CONFIG["MOZ_WIDGET_TOOLKIT"]
157 if CONFIG["MOZ_SERVICES_SYNC"]:
158     DEFINES["MOZ_SERVICES_SYNC"] = True
160 if CONFIG["MOZ_BUILD_APP"] == "browser":
161     DEFINES["MOZ_BUILD_APP_IS_BROWSER"] = True
163 if CONFIG["MOZ_WEBEXT_WEBIDL_ENABLED"]:
164     DEFINES["MOZ_WEBEXT_WEBIDL_ENABLED"] = True
166 if CONFIG["MOZ_WIDGET_TOOLKIT"] == "android":
167     if not CONFIG["MOZ_ANDROID_FAT_AAR_ARCHITECTURES"]:
168         FINAL_TARGET_PP_FILES[CONFIG["ANDROID_CPU_ARCH"]] += [
169             "greprefs.js",
170         ]
171     else:
172         for arch in CONFIG["MOZ_ANDROID_FAT_AAR_ARCHITECTURES"]:
173             FINAL_TARGET_FILES[arch] += [
174                 "!/dist/fat-aar/output/{arch}/greprefs.js".format(arch=arch),
175             ]
176 else:
177     FINAL_TARGET_PP_FILES += [
178         "greprefs.js",
179     ]