Use the information provided by conf.report_optional_feature() to enable/disable python bindings for optional APIs

This commit is contained in:
Gustavo J. A. M. Carneiro
2008-09-06 19:24:32 +01:00
parent 80ba473c52
commit dcce81147d
2 changed files with 8 additions and 6 deletions

View File

@@ -110,16 +110,17 @@ def main():
mod = __import__(local_module)
mod.register_functions(root_module)
enabled_features = os.environ['NS3_ENABLED_FEATURES'].split(',')
# if GtkConfigStore support is disabled, disable the class wrapper
if 'DISABLE_GTK_CONFIG_STORE' in os.environ:
if 'GtkConfigStore' not in enabled_features:
try:
root_module.classes.remove(root_module['ns3::GtkConfigStore'])
except KeyError:
pass
# if no sqlite, the class SqliteDataOutput is disabled
if 'SQLITE_STATS' in os.environ:
if 'SqliteDataOutput' not in enabled_features:
try:
root_module.classes.remove(root_module['ns3::SqliteDataOutput'])
except KeyError:

View File

@@ -404,10 +404,11 @@ def build(bld):
bindgen.prio = 50
bindgen.os_env = dict(os.environ)
if not env['ENABLE_GTK_CONFIG_STORE']:
bindgen.os_env['DISABLE_GTK_CONFIG_STORE'] = "1"
if not env['SQLITE_STATS']:
bindgen.os_env['SQLITE_STATS'] = "1"
features = []
for (name, caption, was_enabled, reason_not_enabled) in env['NS3_OPTIONAL_FEATURES']:
if was_enabled:
features.append(name)
bindgen.os_env['NS3_ENABLED_FEATURES'] = ','.join(features)
## we build python bindings if either we have the tools to