diff --git a/new/builtin.jam b/new/builtin.jam index ff2a4619b..af484d295 100644 --- a/new/builtin.jam +++ b/new/builtin.jam @@ -430,7 +430,7 @@ rule searched-lib-generator ( ) # attach an action and properties to the target a = [ new null-action $(t) : $(property-set) ] ; $(t).action $(a) ; - return $(t) ; + return [ virtual-target.register $(t) ] ; } } } diff --git a/test/searched_lib.py b/test/searched_lib.py index 8cc2eccb3..390f00345 100644 --- a/test/searched_lib.py +++ b/test/searched_lib.py @@ -80,4 +80,23 @@ lib l : : l_r release ; t.run_build_system("-n") +# A regression test. Two virtual target with the same properties +# were created for 'l' target, which caused and error to be reported +# when actualizing targets. The final error is correct, but we should +# not create two duplicated targets. Thanks to Andre Hentz +# for finding this bug. +t.write("project-root.jam", "") + +t.write("a.cpp", "") + +t.write("Jamfile", """ +project a : requirements static ; + +lib a : a.cpp l ; +lib l : : l_f ; +""") + +t.run_build_system("-n") + + t.cleanup() diff --git a/v2/test/searched_lib.py b/v2/test/searched_lib.py index 8cc2eccb3..390f00345 100644 --- a/v2/test/searched_lib.py +++ b/v2/test/searched_lib.py @@ -80,4 +80,23 @@ lib l : : l_r release ; t.run_build_system("-n") +# A regression test. Two virtual target with the same properties +# were created for 'l' target, which caused and error to be reported +# when actualizing targets. The final error is correct, but we should +# not create two duplicated targets. Thanks to Andre Hentz +# for finding this bug. +t.write("project-root.jam", "") + +t.write("a.cpp", "") + +t.write("Jamfile", """ +project a : requirements static ; + +lib a : a.cpp l ; +lib l : : l_f ; +""") + +t.run_build_system("-n") + + t.cleanup() diff --git a/v2/tools/builtin.jam b/v2/tools/builtin.jam index ff2a4619b..af484d295 100644 --- a/v2/tools/builtin.jam +++ b/v2/tools/builtin.jam @@ -430,7 +430,7 @@ rule searched-lib-generator ( ) # attach an action and properties to the target a = [ new null-action $(t) : $(property-set) ] ; $(t).action $(a) ; - return $(t) ; + return [ virtual-target.register $(t) ] ; } } }