Guard against missing paths. Fixes #220.
This commit is contained in:
parent
220bb3e99a
commit
6ced52bedf
1 changed files with 5 additions and 2 deletions
|
@ -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):
|
||||||
|
|
Loading…
Reference in a new issue