diff options
author | Steven Knight <knight@baldmt.com> | 2003-12-08 04:43:08 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2003-12-08 04:43:08 (GMT) |
commit | f1ccb4d7a026f658c80a058827bda351394a01bc (patch) | |
tree | e00375c2b4c22646c121e5d20555b67ae0a804c6 /src/engine/SCons | |
parent | 51df374228f9684ec84bebac6e3cc171b2b5f4e6 (diff) | |
download | SCons-f1ccb4d7a026f658c80a058827bda351394a01bc.zip SCons-f1ccb4d7a026f658c80a058827bda351394a01bc.tar.gz SCons-f1ccb4d7a026f658c80a058827bda351394a01bc.tar.bz2 |
Relax the duplicate-environment restriction for targets so that it's okay if the two environments would build the target with the same command or function call. (Scott Fritchie)
Diffstat (limited to 'src/engine/SCons')
-rw-r--r-- | src/engine/SCons/Builder.py | 12 | ||||
-rw-r--r-- | src/engine/SCons/Script/__init__.py | 1 | ||||
-rw-r--r-- | src/engine/SCons/Warnings.py | 3 |
3 files changed, 15 insertions, 1 deletions
diff --git a/src/engine/SCons/Builder.py b/src/engine/SCons/Builder.py index 17d661c..8372292 100644 --- a/src/engine/SCons/Builder.py +++ b/src/engine/SCons/Builder.py @@ -164,9 +164,19 @@ def _init_nodes(builder, env, overrides, tlist, slist): raise UserError, "Multiple ways to build the same target were specified for: %s" % str(t) if t.has_builder(): if t.env != env: - raise UserError, "Two different environments were specified for the same target: %s"%str(t) + t_contents = t.builder.action.get_contents(tlist, slist, t.env) + contents = t.builder.action.get_contents(tlist, slist, env) + + if t_contents == contents: + SCons.Warnings.warn(SCons.Warnings.DuplicateEnvironmentWarning, + "Two different environments were specified for target %s,\n\tbut they appear to have the same action: %s"%(str(t), t.builder.action.strfunction(tlist, slist, t.env))) + + else: + raise UserError, "Two environments with different actions were specified for the same target: %s"%str(t) + elif t.overrides != overrides: raise UserError, "Two different sets of overrides were specified for the same target: %s"%str(t) + elif builder.scanner and t.target_scanner and builder.scanner != t.target_scanner: raise UserError, "Two different scanners were specified for the same target: %s"%str(t) diff --git a/src/engine/SCons/Script/__init__.py b/src/engine/SCons/Script/__init__.py index 0e56214..ac05f3c 100644 --- a/src/engine/SCons/Script/__init__.py +++ b/src/engine/SCons/Script/__init__.py @@ -709,6 +709,7 @@ def _main(args, parser): SCons.Warnings._warningOut = _scons_internal_warning SCons.Warnings.enableWarningClass(SCons.Warnings.CorruptSConsignWarning) SCons.Warnings.enableWarningClass(SCons.Warnings.DeprecatedWarning) + SCons.Warnings.enableWarningClass(SCons.Warnings.DuplicateEnvironmentWarning) SCons.Warnings.enableWarningClass(SCons.Warnings.MissingSConscriptWarning) SCons.Warnings.enableWarningClass(SCons.Warnings.NoParallelSupportWarning) diff --git a/src/engine/SCons/Warnings.py b/src/engine/SCons/Warnings.py index 6426830..2e2e525 100644 --- a/src/engine/SCons/Warnings.py +++ b/src/engine/SCons/Warnings.py @@ -48,6 +48,9 @@ class DependencyWarning(Warning): class DeprecatedWarning(Warning): pass +class DuplicateEnvironmentWarning(Warning): + pass + class MissingSConscriptWarning(Warning): pass |