-# __COPYRIGHT__
+r __COPYRIGHT__
# __FILE__ __REVISION__ __DATE__ __DEVELOPER__
- Allow the LIBS construction variable to be a single string or File
node, not a list, when only one library is needed.
+ From Anthony Roach:
+
+ - Supply an error message if the user tries to configure a BuildDir
+ for a directory that already has one.
+
RELEASE 0.94 - Fri, 07 Nov 2003 05:29:48 -0600
raise SCons.Errors.UserError, "Source directory must be under top of build tree."
if src_dir.is_under(build_dir):
raise SCons.Errors.UserError, "Source directory cannot be under build directory."
+ if build_dir.srcdir:
+ raise SCons.Errors.UserError, "'%s' already has a source directory: '%s'."%(build_dir, build_dir.srcdir)
build_dir.link(src_dir, duplicate)
def Repository(self, *dirs):
f.close()
-#
+# ensure that specifying multiple source directories for one
+# build directory results in an error message, rather
+# than just silently failing.
+test.subdir('duplicate', ['duplicate', 'src1'], ['duplicate', 'src2'])
+test.write(['duplicate', 'SConstruct'], """\
+BuildDir('build', 'src1')
+BuildDir('build', 'src2')
+""")
+
+test.run(chdir = 'duplicate',
+ arguments = ".",
+ status = 2,
+ stderr = None)
+test.fail_test(test.stderr() != """
+scons: *** 'build' already has a source directory: 'src1'.
+File \"SConstruct\", line 2, in ?
+""")
+
test.pass_test()