diff --git a/new/stage.jam b/new/stage.jam index 3096b4f3c..50d591fb7 100644 --- a/new/stage.jam +++ b/new/stage.jam @@ -75,7 +75,7 @@ rule stage-target-class ( name-and-dir : project : sources * : requirements * : # FIXME: Since we can have property, it might be better # to use it to distinguish staged copies with different locations. $(i2).set-path $(location) ; - result += $(i2) ; + result += [ virtual-target.register $(i2) ] ; } return $(result) ; } diff --git a/test/stage.py b/test/stage.py index 6f4306fc1..96c3b7779 100644 --- a/test/stage.py +++ b/test/stage.py @@ -30,6 +30,20 @@ t.write("auxilliary/1", "") t.run_build_system() t.expect_addition(["dist/a.dll", "dist/a.h", "dist/1"]) + +# Regression test: the following was causing the "duplicate target name" +# error. +t.write( + "Jamfile", +""" +project : requirements true ; +lib a : a.cpp ; +stage dist : a a.h auxilliary/1 ; +alias dist-alias : dist ; +""") +t.run_build_system() + + # Test the property t.write("Jamfile", """ lib a : a.cpp ; diff --git a/v2/test/stage.py b/v2/test/stage.py index 6f4306fc1..96c3b7779 100644 --- a/v2/test/stage.py +++ b/v2/test/stage.py @@ -30,6 +30,20 @@ t.write("auxilliary/1", "") t.run_build_system() t.expect_addition(["dist/a.dll", "dist/a.h", "dist/1"]) + +# Regression test: the following was causing the "duplicate target name" +# error. +t.write( + "Jamfile", +""" +project : requirements true ; +lib a : a.cpp ; +stage dist : a a.h auxilliary/1 ; +alias dist-alias : dist ; +""") +t.run_build_system() + + # Test the property t.write("Jamfile", """ lib a : a.cpp ; diff --git a/v2/tools/stage.jam b/v2/tools/stage.jam index 3096b4f3c..50d591fb7 100644 --- a/v2/tools/stage.jam +++ b/v2/tools/stage.jam @@ -75,7 +75,7 @@ rule stage-target-class ( name-and-dir : project : sources * : requirements * : # FIXME: Since we can have property, it might be better # to use it to distinguish staged copies with different locations. $(i2).set-path $(location) ; - result += $(i2) ; + result += [ virtual-target.register $(i2) ] ; } return $(result) ; }