mirror of
https://github.com/kiwix/kiwix-build.git
synced 2025-06-28 05:49:33 +00:00
If the `dep` is a two char string (as "qt"), the `platform, name = dep` will split the string and search for 't' dependency in 'q' platform. So, we have to be sure that the dep is a tuple before splitting it.
33 lines
695 B
Python
33 lines
695 B
Python
from collections import OrderedDict as _OrderedDict
|
|
|
|
_neutralEnv = None
|
|
_options = None
|
|
_target_steps = _OrderedDict()
|
|
|
|
def set_neutralEnv(env):
|
|
global _neutralEnv
|
|
_neutralEnv = env
|
|
|
|
def neutralEnv(what):
|
|
return getattr(_neutralEnv, what)
|
|
|
|
def set_options(options):
|
|
global _options
|
|
_options = options
|
|
|
|
def option(what):
|
|
return getattr(_options, what)
|
|
|
|
def add_target_step(key, what):
|
|
_target_steps[key] = what
|
|
|
|
def get_target_step(key, default_context=None):
|
|
if isinstance(key, tuple):
|
|
context, target = key
|
|
else:
|
|
context, target = default_context, key
|
|
return _target_steps[(context, target)]
|
|
|
|
def target_steps():
|
|
return _target_steps
|