Boost logo

Boost-Build :

From: Alex Besogonov (cyberax_at_[hidden])
Date: 2005-11-18 02:01:37


Reece Dunn wrote:
> This is a minor revision to correctly use :W where it is needed
> (including some places in the previous response file changeover).
I've just found another problem (minimal project attached). The problem
is that *stupid* MSVC compiler thinks that the name given in /Yc or /Yu
directive must be _exactly_ the same as the first #include statement.

For example, if I have /Yc"..\subproject\stdafx.hpp" then VC will expect
  '#include "..\subproject\stdafx.hpp"' statement in stdafx.cpp and
other files.

Here is a quick hack that fixes it:
=======================
actions compile.c bind PCH_HEADER PCH_FILE
{
     $(.CC) /Zm800 -nologo -TC -U$(UNDEFS) $(CFLAGS) $(USER_CFLAGS)
@"@($(<[1]:W).rsp:E=$(nl)"$(>:W)" $(nl)-D$(DEFINES)
$(nl)"-I$(INCLUDES)")" -c -Fo"$(<[1]:W)" -Yu"$(PCH_HEADER:D=)"
-Fp"$(PCH_FILE:W)"
}
actions compile.c++ bind PCH_HEADER PCH_FILE
{
     $(.CC) /Zm800 -nologo -TP -U$(UNDEFS) $(CFLAGS) $(C++FLAGS)
$(USER_CFLAGS) @"@($(<[1]:W).rsp:E=$(nl)"$(>:W)" $(nl)-D$(DEFINES)
$(nl)"-I$(INCLUDES)")" -c -Fo"$(<[1]:W)" -Yu"$(PCH_HEADER:D=)"
-Fp"$(PCH_FILE:W)"
}
actions compile.pch bind PCH_SOURCE
{
     $(.CC) /Zm800 -nologo -TP -U$(UNDEFS) $(CFLAGS) $(C++FLAGS)
$(USER_CFLAGS) @"@($(<[1]:W).rsp:E=$(nl)"$(PCH_SOURCE:W)"
$(nl)-D$(DEFINES) $(nl)"-I$(INCLUDES)")" -c -Fo"$(<[1]:W)"
/Yc"$(>[1]:D=)" -Fp"$(<[2]:W)"
}
=======================
Of course, that means that the directory with the precompiled header
must be in the include path (though that usually is not a problem).

-- 
With respect,
             Alex Besogonov (cyberax_at_[hidden])
*****************************************************************************
**                                                                         **
** WARNING:  This email contains an attachment of a very suspicious type.  **
** You are urged NOT to open this attachment unless you are absolutely     **
** sure it is legitmate.  Opening this attachment may cause irreparable    **
** damage to your computer and your files.  If you have any questions      **
** about the validity of this message, PLEASE SEEK HELP BEFORE OPENING IT. **
**                                                                         **
** This warning was added by the IU Computer Science Dept. mail scanner.   **
*****************************************************************************



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