Boost logo

Boost-Build :

From: Phillip Seaver (phil_at_[hidden])
Date: 2006-10-06 09:43:07


Brecht Machiels wrote:
> Hello all,
>
> I've been looking for a build system for a hobby project I'm doing in
> C++. I'd like it to be able to build for different targets, starting
> with MinGW32, MSVC and Linux GCC. Boost.Build and SCons seemed like the
> best options to me. I decided on BBuild V2 as SCons' Python requirement
> makes it a bit less practical. I see MinGW32 is not officially supported
> by BBuild. I've been able to build the example "hello" project without
> problems though.
>
> I've been browsing the Boost.Build documentation and I am trying to
> build a simple wxWidgets project. I'm first trying to build with
> MinGW32, ignoring other targets for now.
>

I don't know I would consider compiling something that uses wxWidgets to
be a "simple project", especially if you're compiling on an unsupported
platform. :-)

> Unfortunately, I cannot get it to build. The problem I have is with
> linking the wxWidgets libraries. With a makefile it's easy. I simply
> have to use "wx-config --libs". I have tried doing the same with bjam
> but haven't gotten it to work. Is there a way to use wx-config with
> bjam? (Perhaps it's even not good practice to be using *-config scripts
> with bjam?).
>
> So I gave up on wx-config and tried to manually copy it's output to a
> Jamfile. In my case, wx-config --libs produces:
> -L/usr/local/lib -mthreads -Wl,--subsystem,windows -mwindows
> /usr/local/lib/libwx_mswd-2.6.a -lwxregexd-2.6 -lwxexpatd-2.6
> -lwxtiffd-2.6 -lwxjpegd-2.6 -lwxpngd-2.6 -lwxzlibd-2.6 -lrpcrt4
> -loleaut32 -lole32 -luuid -lwinspool -lwinmm -lshell32 -lcomctl32
> -lcomdlg32 -lctl3d32 -ladvapi32 -lwsock32 -lgdi32
>

We use it in a few of our programs, but I ended up writing my own
wxWidgets jamfile because I wanted BB to actually do the build, I didn't
like the way wx did the build, and I use different versions of the
libraries they include (jpeg, expat, etc.). :-)

If you want to build against the system ones, though, you may want to
look at http://thread.gmane.org/gmane.comp.lib.boost.build/13546 Alex
created a file that actually parses the bakefiles to figure out what to
build -- I haven't tried it yet, though.

As for the system libraries (shell32, etc.), I use
"<toolset>msvc:<find-static-library>shell32" in the build requirements
for executables (or usage requirements for libs). I don't know if
that's the best way to do things, but it works.

Phillip


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