Boost logo

Boost-Build :

From: David Abrahams (dave_at_[hidden])
Date: 2005-06-27 08:33:25


Vladimir Prus <ghost_at_[hidden]> writes:

> I am not sure this is the right approach. When the library is used in a
> project *not* build by Boost.Build, then nothing will be defined by the user,
> and nothing will be exported.
>
> How about defining $(symbol)_SOURCE macro, and checking for that macro in
> sources like this:
>
> #ifdef WHATEVER_SOURCE
> #define WHATEVERDECL __declspec(dllexport)
> #else
> #define WHATEVERDECL __declspec(dllimport)
> #endif
>
> class WHATEVERDECL my_class {};
>
> I tough the above approach is pretty standard, though I'm not a Windows
> expert.

Yes, and it's pretty easy for a DLL author to set up. I am not
convinced that the build system should be doing this automatically.
There are, after all, plugin DLLs that hardly export anything (like
Python extension modules).

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com
 

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