From 6ced52bedfa92b78dedd08e31c46d77326b39e36 Mon Sep 17 00:00:00 2001 From: Jon Burgess Date: Sat, 7 Feb 2009 11:12:38 +0000 Subject: [PATCH] Guard against missing paths. Fixes #220. --- SConstruct | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/SConstruct b/SConstruct index 2c1f63994..ec350fc32 100644 --- a/SConstruct +++ b/SConstruct @@ -44,14 +44,17 @@ def call(cmd): def uniq_add(env, key, 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 def remove_plugin_path(plugin): plugin = PLUGINS.get(plugin) if plugin: libpath = '%s_LIBS' % plugin['path'] incpath = '%s_INCLUDES' % plugin['path'] - env['CPPPATH'].remove(env[incpath]) - env['LIBPATH'].remove(env[libpath]) + remove_path(env, 'CPPPATH', env[incpath]) + remove_path(env, 'LIBPATH', env[libpath]) # Helper function for building up paths to add for a lib (plugin or required) def add_paths(prereq):