2
0
mirror of https://github.com/boostorg/build.git synced 2026-02-16 01:12:13 +00:00

Fix a problem where <implicit-dependency> had no effect unless

the target named by the property was also build (by virtue of being in
the same Jamfile and not marked as "explicit").


[SVN r32885]
This commit is contained in:
Vladimir Prus
2006-02-13 10:34:45 +00:00
parent 7dac85a322
commit c0a2d3b8e6
3 changed files with 63 additions and 0 deletions

View File

@@ -746,6 +746,23 @@ class action
actualize-source-type $(dependencies) : $(property-set) ] ;
self.actual-sources += [
actualize-source-type $(sources) : $(property-set) ] ;
# This is used to help bjam find dependencies in generated headers
# in other main targets.
# Say:
#
# make a.h : ....... ;
# exe hello : hello.cpp : <implicit-dependency>a.h ;
#
# However, for bjam to find the dependency the generated target must
# be actualized (i.e. have the jam target). In the above case,
# if we're building just hello ("bjam hello"), 'a.h' won't be
# actualized unless we do it here.
local implicit = [ $(self.properties).get <implicit-dependency> ] ;
for local i in $(implicit)
{
$(i:G=).actualize ;
}
}
# Determined real properties when trying building with 'properties'.

View File

@@ -0,0 +1,45 @@
#!/usr/bin/python
# Copyright (C) Vladimir Prus 2006.
# Distributed under the Boost Software License, Version 1.0. (See
# accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
# Test the <implicit-dependency> is respected even if the
# target referred-to is not build itself, but only referred
# to by <implicit-dependency>.
from BoostBuild import Tester, List
import string
t = Tester()
t.write("Jamroot", """
make a.h : : gen-header ;
explicit a.h ;
exe hello : hello.cpp : <implicit-dependency>a.h ;
actions gen-header
{
echo "int i;" > $(<)
}
""")
t.write("hello.cpp", """
#include "a.h"
int main()
{
return i;
}
""")
t.run_build_system()
t.expect_addition("bin/$toolset/debug/hello.exe")
t.cleanup()

View File

@@ -139,6 +139,7 @@ tests = [ "rebuilds",
"disambiguation",
"clean",
"lib_source_property",
"implicit_dependency",
]
if os.name == 'posix':