It think it is possible. I do something similar when I build an exe or a lib with one toolset and then install it. Then I make the installed version (LINUXOBJ
below) a dependency of the other toolset’s targets. I would guess you should be able to do it with an obj as well.
obj OBJ : file.c ;
alias OBJ_build : : <source>OBJ/<toolset>linux ;
install OBJ_install : OBJ_build : <conditional>@get-install-location ;
alias LINUXOBJ : OBJ_install ;
alias LINUXOBJ : OBJ_build : <variant>debug <toolset>linux ;
explicit LINUXOBJ OBJ_build OBJ_install OBJ ;
rule get-install-location ( properties * )
{
local properties-set = [ property-set.create $(properties) ] ;
local dir = [ $(properties-set).as-path ] ;
return "<location>$(BIN_DIR)/cross-objs/$(dir)" ;
}
exe MYEXE : main.c LINUXOBJ ;
Chris
From: boost-build-bounces@lists.boost.org [mailto:boost-build-bounces@lists.boost.org]
On Behalf Of Bo Jensen
Sent: Monday, March 12, 2012 2:46 PM
To: Boost.Build developer's and user's list
Subject: Re: [Boost-build] Compiling and linking with different tools
If anyone could just tell me if it's possible at all, that would be much appreciated.
Thanks.
On Sun, Mar 11, 2012 at 12:15 PM, Bo Jensen <jensen.bo@gmail.com> wrote:
Hi,
I am compiling with linux and linking with gcc. For several reasons I have to use two separate tools. I used to do this by compiling all the object files into one static library, which I then use in building other targets. But I just realized I can not control
the library size with this method, since using all the GCC visibility settings does not work on static libs..
So my question is, can anyone point me to an example that show how to compile a "obj" target with one tool and including this source in another link with a different tool. When I do it I get conflicts on mixing properties for targets.
Thanks.
/Bo