diff --git a/v2/build/targets.jam b/v2/build/targets.jam index 888beadd8..ca5ca54c9 100644 --- a/v2/build/targets.jam +++ b/v2/build/targets.jam @@ -941,11 +941,15 @@ class basic-target : abstract-target generate-dependencies $(self.sources) : $(rproperties) : source-targets usage-requirements ; - + rproperties = [ property-set.create $(properties) $(usage-requirements) ] ; usage-requirements = [ property-set.create $(usage-requirements) ] ; - + + local libs = [ $(rproperties).get ] ; + libs += [ $(rproperties).get ] ; + source-targets += $(libs:G=) ; + local tagged-name = [ tag-name $(self.name) : $(rproperties) ] ; local original-name = $(self.name) ; diff --git a/v2/test/unit_test.py b/v2/test/unit_test.py index 7184dc3a8..71f26fb25 100644 --- a/v2/test/unit_test.py +++ b/v2/test/unit_test.py @@ -16,7 +16,7 @@ using testing ; """) t.write("Jamfile", """ lib helper : helper.cpp ; -unit-test test : test.cpp : helper ; +unit-test test : test.cpp : helper ; """) t.write("test.cpp", """ void helper(); diff --git a/v2/tools/builtin.jam b/v2/tools/builtin.jam index f9c64f230..ca566b8cb 100644 --- a/v2/tools/builtin.jam +++ b/v2/tools/builtin.jam @@ -74,7 +74,8 @@ feature use : : free dependency incidental ; feature dependency : : free dependency incidental ; feature implicit-dependency : : free dependency incidental ; -feature library : : free dependency ; +feature source : : free dependency incidental ; +feature library : : free dependency incidental ; feature find-shared-library : : free ; #order-sensitive ; feature find-static-library : : free ; #order-sensitive ; feature library-path : : free path ; #order-sensitive ; @@ -639,10 +640,6 @@ class linking-generator : generator rule run ( project name ? : property-set : sources + : multiple ? ) { - local libs = [ $(property-set).get ] ; - sources += $(libs:G=) ; - - if [ $(property-set).get ] = true { local xdll-path = [ $(property-set).get ] ; diff --git a/v2/tools/qt.jam b/v2/tools/qt.jam index fb3dad18d..733a8ab94 100644 --- a/v2/tools/qt.jam +++ b/v2/tools/qt.jam @@ -66,17 +66,31 @@ rule init ( prefix ? ) rule run ( project name ? : properties * : sources + : multiple ? ) { - # Construct CPP as usual - local result = [ generator.run $(project) $(name) - : $(properties) : $(sources) : $(multiple) ] ; - # If OK, add "UIC_H" target to the returned list - if $(result) - { - local action = [ $(result[1]).action ] ; - local sources = [ $(action).sources ] ; - result += $(sources[2]) ; + # Consider this: + # obj test : test_a.cpp : off ; + # + # This generator will somehow be called in this case, and, + # will fail -- which is okay. However, if there are + # properties they will be converted to sources, so the size of + # 'sources' will be more than 1. In this case, the base generator + # will just crash -- and that's not good. Just use a quick test + # here. + + local result ; + if ! $(sources[2]) + { + # Construct CPP as usual + result = [ generator.run $(project) $(name) + : $(properties) : $(sources) : $(multiple) ] ; + # If OK, add "UIC_H" target to the returned list + if $(result) + { + local action = [ $(result[1]).action ] ; + local sources = [ $(action).sources ] ; + result += $(sources[2]) ; + } } - + return $(result) ; } }