buildconfig.py (692B)
1 # This Source Code Form is subject to the terms of the Mozilla Public 2 # License, v. 2.0. If a copy of the MPL was not distributed with this 3 # file, You can obtain one at http://mozilla.org/MPL/2.0/. 4 5 import sys 6 7 from mozbuild.backend.configenvironment import PartialConfigEnvironment 8 from mozbuild.base import MozbuildObject 9 10 config = MozbuildObject.from_environment() 11 partial_config = PartialConfigEnvironment(config.topobjdir) 12 13 for var in ("topsrcdir", "topobjdir"): 14 value = getattr(config, var) 15 setattr(sys.modules[__name__], var, value) 16 17 for var in ("defines", "substs", "get_dependencies"): 18 value = getattr(partial_config, var) 19 setattr(sys.modules[__name__], var, value)