Subject: Re: [Boost-build] Compiling a single file
From: Matthew Chambers (matt.chambers42_at_[hidden])
Date: 2012-04-13 14:20:15
Needing to recompile a single file to see if your changes have fixed the compile error is a basic
need. BB solves it (for me) by always printing the command that was run when it fails.
call "C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" amd64 >nul
cl /Zm800 -nologo @"blah.rsp"
...failed compile-c-c++ blah.obj
Then it's a simple matter to copy and paste the cl line (or just press up arrow after I've already
done it once). This does require building from a command-prompt, but I'm fine with that since I find
managing build configurations much easier from the command-prompt (because there are so many
features that can change: link, runtime-link, optimization, variant, debug-symbols, etc.). I only
use VS as an editor for the joys of Intellisense... when it works. :)
Even if you figured out the exact target signature (which I don't know), you're not going to achieve
turnaround times with Boost Build similar to VS compiling a single file or or me doing it by a
direct cl command.
On 4/12/2012 1:15 PM, Nogradi, Chris wrote:
> Matt, thanks for the response.
> I am trying to convert our usage of homemade build scripts for target hardware builds + Visual Studio support for target simulator builds into BB. Developers mostly use VS for development and do not want to give up features. In VS, they can compile the file they are working on (by just pressing a key) and immediately see if it compiles. They say this is handy when they want to make a quick change or test the accuracy of a merge w/o incurring the overhead of building an entire project/library especially if the rest does not compile (or the delay of an incremental build figuring out what to do). I have support for generating the VS project files from BB but when they use this feature (generated project files still use BB as external make), they lose support for compiling single files (and Edit and Continue feature in Debugger not to mention incremental speed degradation in BB - 25 seconds vs 0 seconds in VS).
> My personal reason to want such a feature is to be able to do a quick diagnostic tweak to the build by compiling a single file with different options (presumably incidental) or just to get the assembly listing or preprocessor output.
> So I would need to know the meta-targets to do this. But I cannot figure out the syntax for the meta-targets. Could you give an example?
> $ bjam DIR/bin/msvc-8.0/debug/threading-multi/test.obj
> notice: could not find main target DIR/bin/msvc-8.0/debug/threading-multi/test.obj
> notice: assuming it is a name of file to create.
> don't know how to make<e>t/bin/msvc-8.0/debug/threading-multi/test.obj
> ...found 1 target...
> ...can't find 1 target...
> I guess it would be nice if BB supported this with a syntax similar to the inline targets:
> library..object or exe..object
> BTW, on another note, how does the Boost project generate the VS solution files? Are they manually maintained?
> -----Original Message-----
> From: boost-build-bounces_at_[hidden] [mailto:boost-build-bounces_at_[hidden]] On Behalf Of Matthew Chambers
> Sent: Thursday, April 12, 2012 11:45 AM
> To: boost-build_at_[hidden]
> Subject: Re: [Boost-build] Compiling a single file
> I think that "test.obj" only works because it's the exact path of low level jam target. AFAIK, such
> targets are identified by their build path, not the the source path basename + .obj. If you want to
> address obj targets in such a way, you do need to use the obj metatargets explicitly. May I ask why
> you want to do be able to build only a single obj?
> On 4/12/2012 3:00 AM, Mateusz Loskot wrote:
>> On 11 April 2012 20:06, Nogradi, Chris<Chris.Nogradi_at_[hidden]> wrote:
>>> Command that donât appear to work:
>>> bjam /TEST//test.obj
>>> bjam DIR/test.obj
>>> bjam DIR//test.obj
>>> which all get something like this:
>>> notice: could not find main target DIR//file.obj
>>> notice: assuming it is a name of file to create.
>>> don't know how to make<e>DIR//file.obj
>>> ...found 1 target...
>>> ...can't find 1 target...
>> Hi Chris,
>> I regret, my knowledge about Boost.Build is too limited and I'm useless here.
>> Best regards
> Unsubscribe& other changes: http://lists.boost.org/mailman/listinfo.cgi/boost-build
> This e-mail and any attachments may contain confidential material for the sole use of the intended recipient. If you are not the intended recipient, please be aware that any disclosure, copying, distribution or use of this e-mail or any attachment is prohibited. If you have received this e-mail in error, please contact the sender and delete all copies.
> Thank you for your cooperation.
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