mirror of
https://github.com/boostorg/build.git
synced 2026-02-16 01:12:13 +00:00
Introduce the <source> feature and make <library> work in the same way
as <source>. [SVN r22570]
This commit is contained in:
@@ -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 <library> ] ;
|
||||
libs += [ $(rproperties).get <source> ] ;
|
||||
source-targets += $(libs:G=) ;
|
||||
|
||||
local tagged-name = [ tag-name $(self.name) : $(rproperties) ] ;
|
||||
|
||||
local original-name = $(self.name) ;
|
||||
|
||||
@@ -16,7 +16,7 @@ using testing ;
|
||||
""")
|
||||
t.write("Jamfile", """
|
||||
lib helper : helper.cpp ;
|
||||
unit-test test : test.cpp : <library>helper ;
|
||||
unit-test test : test.cpp : <source>helper ;
|
||||
""")
|
||||
t.write("test.cpp", """
|
||||
void helper();
|
||||
|
||||
@@ -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 <library> ] ;
|
||||
sources += $(libs:G=) ;
|
||||
|
||||
|
||||
if [ $(property-set).get <hardcode-dll-paths> ] = true
|
||||
{
|
||||
local xdll-path = [ $(property-set).get <xdll-path> ] ;
|
||||
|
||||
@@ -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 : <optimization>off ;
|
||||
#
|
||||
# This generator will somehow be called in this case, and,
|
||||
# will fail -- which is okay. However, if there are <library>
|
||||
# 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) ;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user