Boost logo

Boost-Build :

From: David Abrahams (dave_at_[hidden])
Date: 2003-02-27 10:09:34


Vladimir Prus <ghost_at_[hidden]> writes:

> David Abrahams wrote:
>
>> >> The problem here is that y.cpp has nothing in it to export, so the
>> >> linker helpfully decides not to create an implib.
>> >
>> > What is needed to persuade it? A symbol marked with
>> > __declspec(dllexport)?
>>
>> I believe so.
>>
>> > Could you try modifying dependency-test/foo.jam so that it creates non
>> > empty file, and see if this fixed the problem.
>>
>> Of course I tried to do that, but I couldn't figure out where y.cpp
>> was coming from ;-)
>
> That's why I suggested to modify foo.jam. The "y.cpp" file is created from
> "y.foo" using the only action declared in foo.jam.

OK, done.

cd c:/boost/tools/build/test/
python dependency_test.py msvc-6.5
File bin/msvc-6.5/debug/a.o not touched as expected
Added files : []
Removed files : []
Modified files: ['bin/msvc-6.5/debug/a.exe', 'bin/msvc-6.5/debug/a.exp', 'bin/msvc-6.5/debug/a.lib', 'bin/msvc-6.5/debug/a.obj', 'bin/msvc-6.5/debug/b.exe', 'bin/msvc-6.5/debug/b.obj', 'bin/msvc-6.5/debug/main-target-c/c.exe']
Touched files : ['bin/msvc-6.5/debug/a.pdb', 'bin/msvc-6.5/debug/a.rsp', 'bin/msvc-6.5/debug/b.pdb', 'bin/msvc-6.5/debug/b.rsp', 'bin/msvc-6.5/debug/main-target-c/c.pdb']
FAILED test of c:\boost\tools\build\test\..\jam_src\bin.ntx86\bjam -sBOOST_BUILD_PATH=c:\boost\tools\build\test\..\new;c:\boost\tools\build\test -d0 --quiet msvc-6.5
at line 288 of BoostBuild.py (fail_test)
from line 351 of BoostBuild.py (expect_touch)
from line 22 of dependency_test.py

:(. I don't know what causes that. Is it really looking for "a.o"
rather than "a.obj"?

>> >> BTW, we're going to have to deal with __declspec(dllXXport) somehow if
>> >> these tests are going to work on MSVC :-S
>> >>
>> > :-( I'm thinking that we can use macro called DLLEXPORT and automagically
>> > : pass
>> >
>> > appropriate <define> property to bjam invocations. Sounds dirty... but no
>> > better insights yet.
>>
>> Usually you want a separate macro associated with each target, whose
>> meaning changes based on the target name. So, in a single header:
>>
>> // impexp.hpp
>> #ifndef _Win32
>> # define SHARED_SYMBOL(lib_id)
>> #else
>> # define SHARED_SYMBOL(lib_id)
>> __declspec(BOOST_PP_IF(lib_id##SOURCE,dllexport,dllimport)) #endif
>>
>>
>> // foo.h
>> #include "impexp.hpp"
>> void SHARED_SYMBOL(FOO_) foo(char*);
>>
>> Then you put <define>FOO_SOURCE in the requirements for foolib.
>
> That that the symbol is marked as exported when compiling the lib, and
> imported for all users?

Yup.

> OK, there's no problem with extra includes/defines for sources that
> go into library. But each test should create "impexp.hpp".

Really?

> Should there be a method in Tester which creates it?

I don't know; maybe there should be a directory of common testing
resources which is made available to all tests. Either one works for
me.

-- 
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