Guard against missing paths. Fixes #220.

This commit is contained in:
Jon Burgess 2009-02-07 11:12:38 +00:00
parent 220bb3e99a
commit 6ced52bedf

View file

@ -44,14 +44,17 @@ def call(cmd):
def uniq_add(env, key, val): def uniq_add(env, key, val):
if not val in env[key]: env[key].append(val) if not val in env[key]: env[key].append(val)
def remove_path(env, key, val):
if val in env[key]: env[key].remove(val)
# Helper function for removing paths for a plugin lib # Helper function for removing paths for a plugin lib
def remove_plugin_path(plugin): def remove_plugin_path(plugin):
plugin = PLUGINS.get(plugin) plugin = PLUGINS.get(plugin)
if plugin: if plugin:
libpath = '%s_LIBS' % plugin['path'] libpath = '%s_LIBS' % plugin['path']
incpath = '%s_INCLUDES' % plugin['path'] incpath = '%s_INCLUDES' % plugin['path']
env['CPPPATH'].remove(env[incpath]) remove_path(env, 'CPPPATH', env[incpath])
env['LIBPATH'].remove(env[libpath]) remove_path(env, 'LIBPATH', env[libpath])
# Helper function for building up paths to add for a lib (plugin or required) # Helper function for building up paths to add for a lib (plugin or required)
def add_paths(prereq): def add_paths(prereq):