mirror of
https://github.com/boostorg/build.git
synced 2026-02-17 01:32:12 +00:00
Unbreak libraries using Qt, together with moccable classes in .cpp files.
The generator that handles moccable cpp files has to actualize created targets right away. However, it did that before calling virtual-target.register, so, if the generator was invoked two times on the same target, it will produce two identical targets and call .actualize on it. The second invocation would trigger "duplicate target" error. [SVN r31797]
This commit is contained in:
@@ -54,7 +54,8 @@ class cast-target-class : typed-target
|
||||
ECHO "error: when building " [ full-name ] ;
|
||||
EXIT ;
|
||||
}
|
||||
result += [ $(s).clone-with-different-type $(self.type) ] ;
|
||||
local r = [ $(s).clone-with-different-type $(self.type) ] ;
|
||||
result += [ virtual-target.register $(r) ] ;
|
||||
}
|
||||
|
||||
return [ property-set.empty ] $(result) ;
|
||||
|
||||
@@ -131,7 +131,7 @@ class moc-h-generator : generator
|
||||
{
|
||||
if ! $(sources[2]) && [ $(sources[1]).type ] = MOCCABLE_CPP
|
||||
{
|
||||
name = [ $(sources[0]).name ] ;
|
||||
name = [ $(sources[1]).name ] ;
|
||||
name = $(name:B) ;
|
||||
|
||||
local a = [ new action $(sources[1]) : qt.moc.cpp :
|
||||
@@ -140,14 +140,16 @@ class moc-h-generator : generator
|
||||
local target = [
|
||||
new file-target $(name) : MOC : $(project) : $(a) ] ;
|
||||
|
||||
local r = [ virtual-target.register $(target) ] ;
|
||||
|
||||
# Since this generator will return H target, the linking generator
|
||||
# won't use it at all, and won't set any dependency on it.
|
||||
# However, we need to target to be seen by bjam, so that dependency
|
||||
# from sources to this generated header is detected -- if jam does
|
||||
# not know about this target, it won't do anything.
|
||||
DEPENDS all : [ $(target).actualize ] ;
|
||||
DEPENDS all : [ $(r).actualize ] ;
|
||||
|
||||
return [ virtual-target.register $(target) ] ;
|
||||
return $(r) ;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -254,14 +254,16 @@ class moc-h-generator : generator
|
||||
local target = [
|
||||
new file-target $(name) : MOC : $(project) : $(a) ] ;
|
||||
|
||||
local r = [ virtual-target.register $(target) ] ;
|
||||
|
||||
# Since this generator will return H target, the linking generator
|
||||
# won't use it at all, and won't set any dependency on it.
|
||||
# However, we need to target to be seen by bjam, so that dependency
|
||||
# from sources to this generated header is detected -- if jam does
|
||||
# not know about this target, it won't do anything.
|
||||
DEPENDS all : [ $(target).actualize ] ;
|
||||
DEPENDS all : [ $(r).actualize ] ;
|
||||
|
||||
return [ virtual-target.register $(target) ] ;
|
||||
return $(r) ;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user