gecko-dev/build/rust/mozbuild/generate_buildconfig.py
Mike Hommey e013590cd1 Bug 1751331 - Add a mozbuild crate that exposes some build configuration items. r=firefox-build-system-reviewers,andi
This will be used as a central point of authority rather than individual
crates figuring things out on their own.

Differential Revision: https://phabricator.services.mozilla.com/D136558
2022-01-25 21:29:50 +00:00

21 lines
749 B
Python

# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import buildconfig
def generate_bool(name):
value = buildconfig.substs.get(name)
return f"pub const {name}: bool = {'true' if value else 'false'};\n"
def generate(output):
output.write(generate_bool("MOZ_FOLD_LIBS"))
output.write(generate_bool("NIGHTLY_BUILD"))
output.write(generate_bool("RELEASE_OR_BETA"))
output.write(generate_bool("EARLY_BETA_OR_EARLIER"))
output.write(generate_bool("MOZ_DEV_EDITION"))
output.write(generate_bool("MOZ_ESR"))
output.write(generate_bool("MOZ_DIAGNOSTIC_ASSERT_ENABLED"))