Boost logo

Boost-Build :

Subject: Re: [Boost-build] testing : run with dependencies
From: Guillaume Chatelet (gch_at_[hidden])
Date: 2009-04-16 13:19:36


Great ! Thanks a lot Steven for this fast and sharp response.

I'm running in a new issue now because BB wants to link my two programs
together
> run player main : --script test-tmp/datas.pb ;

First I thought it was because both player target and main.cpp have an "int
main(int, char**)" function.
Surprisingly enough, the link error is not a "already defined reference" but
an "undefined reference to `WinMain_at_16'" ( I'm using MinGw under windows )

Anyway, how can I prevent BB from wanting to link main.o against my player
program ?
What I want is just to trigger the player.exe run *after* the main.exe run.

Best regards,
Guillaume

FYI the log gives :
gcc.link
src\tests\scripts\basic_script\bin\player.test\gcc-mingw-3.4.5\debug\threading-multi\player.exe
T:/work/mingw_5.1.3/src/bin/../lib/gcc/mingw32/3.4.5/../../../libmingw32.a(main.o):main.c:(.text+0x104):
undefined reference to `WinMain_at_16'
collect2: ld returned 1 exit status

    "g++" -Wl,-R -Wl,"T:\work\cg_1.5\src\Cg\bin" -Wl,-R
-Wl,"T:\work\mingw_5.1.3\src\bin" -Wl,-rpath-link
-Wl,"T:\work\cg_1.5\src\Cg\bin" -Wl,-rpath-link
-Wl,"T:\work\mingw_5.1.3\src\bin" -o
"src\tests\scripts\basic_script\bin\player.test\gcc-mingw-3.4.5\debug\threading-multi\player.exe"
-Wl,--start-group
"T:\work\boost_1.36.0\boost\bin.v2\libs\thread\build\gcc-mingw-3.4.5\debug\link-static\threading-multi\libboost_thread-mgw34-mt-d-1_36.lib"
"T:\work\NeoPlayerModel\bin\gcc-mingw-3.4.5\debug\link-static\threading-multi\libPlayerPBModel.lib"
"T:\work\protocol-buffer_2.0.2\lib\libprotobuf.a"
"T:\work\cg_1.5\src\Cg\lib\cg.lib" -Wl,-Bstatic -lgdi32 -Wl,-Bdynamic
-Wl,--end-group -g -mthreads

Steven Watanabe-4 wrote:
>
> AMDG
>
> Guillaume Chatelet wrote:
>> I'd like to execute several run command with a specific order between
>> them.
>>
>> For instance :
>>
>>> exe player : ... ;
>>>
>>> run main.cpp : test-tmp/datas.pb ;
>>> run player : --script test-tmp/datas.pb ;
>>>
>>
>> I have an exe target used to generate a player.exe (win32 platform).
>> Then I'd like to generate dummy data to test my player : I'm using the
>> run
>> rule to compile main.cpp and run it with "test-tmp/datas.pb" as argument.
>> Next I run the player with "--script test-tmp/datas.pb" as argument.
>>
>> However this doesn't work because the "run player" line is executed
>> before
>> the "run main.cpp" line ( I'm compiling with -j4 option ).
>>
>>
>>> From the signature of run :
>>> rule run ( sources + : args * : input-files * : requirements * :
>>> target-name ? : default-build * )
>>>
>>
>> I see no name so I can't chain run rule like I would chain lib and exe
>> targets for instance.
>> Do you have any ideas of how I can ensure that my "run main.cpp" rule is
>> executed before the "run player" ?
>>
>
> The default name of the target is the name of the first source
> with the extension stripped off. So the names would be
> main and player. This can be customized using target-name.
>
> In Christ,
> Steven Watanabe
>
> _______________________________________________
> Unsubscribe & other changes:
> http://lists.boost.org/mailman/listinfo.cgi/boost-build
>
>

-- 
View this message in context: http://www.nabble.com/testing-%3A-run-with-dependencies-tp23081600p23082595.html
Sent from the Boost - Build mailing list archive at Nabble.com.

Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk