If I understand in this case one action will be called 2 times.
But in my case there only one invocation for both.
Also generated files may have dependencies from some source files that are used during generating.
If some of dependencies changed, files have to be regenerated.

--- Исходное сообщение ---
От кого: "Vladimir Prus" <vladimir.prus@gmail.com>
Дата: 29 сентября 2015, 15:16:56

On 29-Sep-15 2:46 PM, Roman Matsybora wrote:
> This example invokes 2 actions for 2 targets
> What if 1 action makes 2 targets?

In that case, create 1 action object, and create 2 targets, passing the same action object to both, something like:

	local a = [ new action $(sources[1])
                   : common.copy : $(property-set) ] ;
         local t = [ new file-target $(name) : CPP : $(project)
                   : $(a) ] ;
         local t2 = [ new file-target $(name)_server : CPP : $(project)
                       : $(a) ] ;
         return [ virtual-target.register $(t) ] [ virtual-target.register $(t2) ] ;

Just replace 'common.copy' with something that actually produces two outputs.

- Volodya


_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost-build