diff --git a/python/mozbuild/mozbuild/base.py b/python/mozbuild/mozbuild/base.py index 290773561f17..14a234d70aae 100644 --- a/python/mozbuild/mozbuild/base.py +++ b/python/mozbuild/mozbuild/base.py @@ -269,6 +269,21 @@ class MozbuildObject(ProcessExecutionMixin): def statedir(self): return os.path.join(self.topobjdir, '.mozbuild') + @property + def platform(self): + """Returns current platform and architecture name""" + import mozinfo + platform_name = None + bits = str(mozinfo.info['bits']) + if mozinfo.isLinux: + platform_name = "linux" + bits + elif mozinfo.isWin: + platform_name = "win" + bits + elif mozinfo.isMac: + platform_name = "macosx" + bits + + return platform_name, bits + 'bit' + @memoized_property def extra_environment_variables(self): '''Some extra environment variables are stored in .mozconfig.mk.