Boost logo

Boost Interest :

Subject: [Boost-cmake] Zero-length test binaries in VC8/NMake builds
From: David Wolfe (dwolfe_at_[hidden])
Date: 2009-05-19 01:08:46

Since I've started submitting Windows test results to the dashboard,
I've noticed that I'm getting an order of magnitude more test failures
than any of the *NIX builds. In trying to ferret out the reason, I
discovered that hundreds of the test executables aren't being built
correctly; 441 of them are showing up in the build tree as zero-length
files, causing spurious failures.

 From what I can tell, the reason is that a macro invocation such as the

   # Serialization
   # xml archive tests
     DEPENDS boost_date_time boost_serialization STATIC

winds up expanding to a linker command containing this flag:


This path doesn't exist, so the link fails, and the file is truncated.
I think the command should contain:


(I say this because: for a given test, if I manually modify the
build.cmake file as shown above, then the test builds and runs

I've started to go a bit cross-eyed trying to trace how the build system
winds up specifying the 'wrong' path. (I assume it must be the right
path for other generators.) I thought I'd post here in the hopes that
someone might be able to recommend a stategy for tracking this problem
down. The entire CMake-generated link command for one of the truncated
binaries is appended below for reference...


        @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --red --bold
"Linking CXX executable
        cd C:\projects\boost-trunk\build\libs\date_time\test
        "C:\Program Files (x86)\CMake-cvs\bin\cmake.exe" -E vs_link_exe
C:\PROGRA~2\MICROS~4\VC\bin\cl.exe /nologo
@CMakeFiles\date_time-testgreg_serialize_xml.dir\objects1.rsp @<<
   /DWIN32 /D_WINDOWS /W3 /Zm1000 /EHsc /GR
-link /implib:..\..\..\lib\tests\date_time\testgreg_serialize_xml.lib
/version:0.0 /MANIFEST /STACK:10000000 /machine:I386
/subsystem:console /debug /INCREMENTAL:YES
..\..\..\lib\libboost_serialization-vc80-mt-gd-1_40.lib kernel32.lib
user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib
uuid.lib comdlg32.lib advapi32.lib

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