|
Boost-Build : |
From: Reece Dunn (msclrhd_at_[hidden])
Date: 2005-01-14 06:15:25
Jan Rehders wrote:
> Hello,
>
> first, I'm not sure whether this list is intended for users or
> developers so forgive me if I'm wrong ;)
It is for both :)
> I've set up boost build and I can compile simple apps using bjam --v2
> and it works really smooth. My problem is to make it use the OS X
> frameworks. Instead of the -l parameter for libraries, the -framework
> parameter needs to be used for linking.
> lib gl : : <name>OpenGL ;
I assume the best way would be to tell BBv2 that the above uses
-framework, instead of -l, something like:
lib gl : : <name>OpenGL <link>framework ;
> exe mytest : main.cpp gl : ;
Then here, resolve gl to use -framework instead of -l. I am not
competent in BBv2 yet to ipmlement something like this. Volodya?
> -framework would circumvent the usage of static libraries. So is there
> any option or way I did not discover to tell gcc to use a framework? I
> found <framework> for bjam v1 and <cxxflags> and I'm pretty sure there
> is something like <linkerflags> but I would prefer a "clean" solution -
> any suggestions?
It is possible to define your own features. Take a look at the
documentation on extending BBv2
(http://boost.org/boost-build2/doc/html/bbv2/extending/features.html).
# in build/v2/tools/builtin.jam:
# 54: feature version : : free ;
feature framework : : free dependency ;
# in build/v2/tools/gcc.jam
# 193: flags gcc.link LIBRARIES <library-file> ;
flags gcc.link FRAMEWORKS <framework> ;
# 261: actions link bind LIBRARIES
# 262: {
# 263: "$(CONFIG_COMMAND)" -L"$(LINKPATH)" ...
263: "$(CONFIG_COMMAND)" -L"$(LINKPATH)" -framework"$(FRAMEWORKS)" ...
This would then allow:
exe mytest : main.cpp : <framework>OpenGL ;
Volodya: is there a way to transform
<framework>OpenGL
into
<linkflags>-frameworkOpenGL
in a way similar to the way you compose features?
Regards,
Reece
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