From: Ali Azarbayejani (ali_at_[hidden])
Date: 2003-05-20 10:22:34
See attached project for use case.
Here is the Jamfile with comments.
lib a : a.cxx ;
lib b : a.cxx : <dependency>foo ;
# Error because foo not a main target.
# OK...foo is NOT a main target, but error is not caught and reported
# as such. And shouldn't be an error anyway... should treat foo as a
# file (just like sources).
lib c : a.cxx : <dependency>bar ;
lib bar : : <name>bar ;
# OK, bar is a main target.
lib d : a.cxx : <dependency>subdir/bar ;
lib subdir/bar : : <name>bar ;
# Error because can't find subdir/bar as a main target, even though it
# is! This is because project.find-target treats "subdir/bar" as
# project "subdir" with target "bar" instead of target "subdir/bar" in
# project ".".
lib e : a.cxx : <dependency>subdir/bar ;
# Error. All of the above. Won't treat subdir/bar as a file. Can't
# make it a main target because subdir/bar won't be recognized as an id.
There are three problems here:
<1> The error condition in targets.generate-dependencies is not
checked properly. Instead of checking the return of
targets.generate for string "@main target not found" it checks for
<2> Even if error condition were checked properly, the logic is
different from basic-target.generate-sources. The former treats a
negative return from targets.generate as an error, the latter
handles a negative return by treating the target as a file instead
of a main target.
Aside from the oversight in checking the error condition properly,
why don't these have the same logic? Why isn't generation of
dependencies the same as generation of sources?
<3> Target id with slashes not allowed, so can't have a main target
with an id that names the file (if in a subdir). --------------2E511C7A163557E85DE5E13E Content-Type: application/x-gzip;
[Attachment content not displayed.] --------------2E511C7A163557E85DE5E13E--
Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk