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:
@@ -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'.
|
||||
|
||||
45
v2/test/implicit_dependency.py
Normal file
45
v2/test/implicit_dependency.py
Normal 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()
|
||||
|
||||
@@ -139,6 +139,7 @@ tests = [ "rebuilds",
|
||||
"disambiguation",
|
||||
"clean",
|
||||
"lib_source_property",
|
||||
"implicit_dependency",
|
||||
]
|
||||
|
||||
if os.name == 'posix':
|
||||
|
||||
Reference in New Issue
Block a user