|
Boost-Build : |
From: Jurko GospodnetiÄ (jurko.gospodnetic_at_[hidden])
Date: 2008-06-26 18:12:30
Hi Andrej.
> I noticed that if I use the NT-version of bjam (the
> one ending up in tools/jam/bin.ntx86 after compiling
> with build.bat), then the include paths are working
> correctly, even though they appear as Cygwin-paths in
> the output of "bjam -d2". Are they being translated to
> Windows-paths before sent to msvc?
>
> But uhhhh, what version of bjam (NT or Cygwin) should
> I use to compile my own projects? In my case, I use
> Cygwin because I want to be able to use Linux tools
> for development, but I want to create native Windows
> apps (i.e. I want my executables and libraries to be
> the same as if I would compile them in Visual Studio).
> Which one should I choose then,
> tools/jam/bin.ntx86/bjam compiled with build.bat (vc9)
> or tools/jam/bin.cygwinx86/bjam compiled with build.sh
> (gcc)?
If you want to use bjam under cygwin then you should use the one
built in the tools/jam/bin.cygwinx86 folder. That one has support for
automatically converting cygwin paths such as '/usr' to 'C:\Cygwin\usr'.
If you need this feature in your Jamfiles you can get it by using Boost
Build's :W variable modifier as in:
local xxx = "/usr" ;
ECHO $(xxx:W) ;
Which should display something like:
C:\Cygwin\usr
On the other hand, I have not managed to get that build to do any
automatic magic on commands issued by Boost Build actions so I do not
see how it could work in case you are passing cygwin paths to cl.exe.
The only way I managed to get something similar to your code to work was
to do the following:
local x = /usr/local/include ;
exe aaa : aaa.cpp : <include>$(x:W) ;
or:
import path ;
local x = /usr/local/include ;
local y = [ path.make $(x:W) ] ;
exe aaa : aaa.cpp : <include>$(y) ;
Only then did aaa.cpp correctly include a /usr/local/include/xxx.hpp
file and the cl.exe response file in that case contained the line:
"-IC:/Cygwin/usr/local/include"
I did not take the time to test whether the native or the internal
path format should be used with the include feature but both seem to
work fine.
I have a feeling this whole cygwin build part is not really well
tested or used and could do with a decent cleaning. :-)
We use cmd.exe for building on Windows and have Cygwin on the path so
we can use all of its command-line utilities.
Hope this helps.
Best regards,
Jurko GospodnetiÄ
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