diff --git a/v2/test/stage.py b/v2/test/stage.py index 594ead29d..f54056fc9 100644 --- a/v2/test/stage.py +++ b/v2/test/stage.py @@ -155,6 +155,17 @@ t.run_build_system() t.expect_addition("dist/l3.dll") t.expect_nothing("dist/l2.dll") +# Check if on 'stage' works. +t.rm(".") +t.write("Jamroot", """ +stage a1 : a1.txt : dist ; +stage a2 : a2.txt : dist a1 ; +""") +t.write("a1.txt", "") +t.write("a2.txt", "") +t.run_build_system("a2") +t.expect_addition(["dist/a1.txt", "dist/a2.txt"]) + t.cleanup() diff --git a/v2/tools/stage.jam b/v2/tools/stage.jam index 6c15c7dc0..9d124845f 100644 --- a/v2/tools/stage.jam +++ b/v2/tools/stage.jam @@ -244,8 +244,6 @@ class stage-target-class : basic-target return $(found) ; } - - } # Create a target named 'name' in the current project @@ -264,19 +262,20 @@ rule copy-file ( name ? : project : source : extra-properties ) : $(project) ] ; local a = [ $(source).action ] ; local new-a ; + local p = [ property-set.empty ] ; if $(a) { - local p = [ $(a).properties ] ; - # Copy the properties of original target. They, in particular - # can affect the suffix of the target. - new-a = [ new action $(targets) : $(source) : common.copy : - [ $(p).add-raw [ $(extra-properties).free ] ] ] ; + p = [ $(a).properties ] ; } - else - { - new-a = [ new action $(targets) : $(source) : common.copy : - [ property-set.create [ $(extra-properties).free ] ] ] ; - } + + + # Copy the properties of original target. They, in particular + # can affect the suffix of the target. + new-a = [ new action $(targets) : $(source) : common.copy : + [ $(p).add-raw [ $(extra-properties).free ] + [ $(extra-properties).dependency ] + ] ] ; + $(targets).suffix [ $(source).suffix ] ; $(targets).action $(new-a) ; @@ -310,7 +309,7 @@ rule relink-file ( project : property-set : source ) { ps-raw = [ property.change $(ps-raw) : ] ; } - ps-raw = $(ps-raw) [ $(property-set).free ] ; + ps-raw = $(ps-raw) [ $(property-set).free ] [ $(property-set).dependency ] ; local new-ps = [ property-set.create $(ps-raw) ] ; local cloned-action = [ virtual-target.clone-action $(action) : $(project) :