Boost logo

Boost-Build :

From: Vladimir Prus (ghost_at_[hidden])
Date: 2003-10-20 02:05:50

Hi Kirill,

> I am facing following problem -- I need a way to specify a def file
> for one of my projects. It is basically a list of functions to export
> from dll, it is supplied on link phase via /def:def_file flag. It is
> sometimes important to export unmangled functions for VB integration,
> or other similiar tasks.
> Not sure what the right solution is, probably toolset specific feature.

I think the feature is specific to windows platform, not only to msvc. But
since we don't have common definitions to windows platform (yet), the feature
can be dumped to "builtins.jam".

> I am willing to invest some time in this, but not sure where to start
> -- any suggestions pointers are more then welcome.

I've put together a small doc for the task of adding a new feature --- likely
to be added to "extending.html" soon. It outlines the steps for creating of
<def-file> feature. If you could try to do the steps, it would be great. And,
sure, if you find any problems along the way, either with Boost.Build or the
docs, please let me know.

And one caveat: if you succeed, you'll find that <def-file> can be used on
"exe" targets, where it probably should have any effect. I'm not sure this is
a problem at all, but if it is, I can fix it in a minute.

> Currently as a workaround I am using path-constant to capture path to
> def file, and then pass it via <linkflags> to linker.
> While we are at the topic, let me ask a quick question. What is the
> right way to say that given library should be built only on specific
> platform and/or toolset?

lib a : a.cpp : <toolset>msvc ;
alias a ;

See the trick: alternatives for main target "a" can be declared with different
rules. The first alternative will be selected on msvc to create a library,
and the second one will be selected elsewhere to produce nothing.

> Ideally I would like this feature to
> propagate to other targets which are using that platform specific
> library.

Could you describe how this should work in more detail. I don't seem to get --
probably I'm just too dense, having woke at 4:00 ;-)

> I tried to add <toolset>msvc to requirements, but end up with
> some targets built with gcc while others with msvc. All peppered with
> warnings that targets are not link compatible.
> What I would like to see is: when gcc is used all msvc specific
> targets are silently skipped (with warning probably).

Seems like the recipe I gave would work.

- Volodya


Boost-Build list run by bdawes at, david.abrahams at, gregod at, cpdaniel at, john at