Boost logo

Boost-Build :

From: Vladimir Prus (ghost_at_[hidden])
Date: 2005-11-17 06:17:58


On Thursday 17 November 2005 12:32, Reece Dunn wrote:

> But I now get:
>
> msvc.compile.pch ..\..\..\build\tools\pch\msvc-7.1\release\mypch.obj
> ..\..\..\build\tools\pch\msvc-7.1\release\mypch.pch
> pch.hpp
> msvc.compile.c++ ..\..\..\build\tools\pch\msvc-7.1\release\main.obj
> main.cpp
> main.cpp(1) : fatal error C1083: Cannot open precompiled header file:
> 'pch.pch':
> No such file or directory
>
> call "C:\Program Files\Microsoft Visual Studio .NET
> 2003\vc7\bin\vcvars32.bat" >nul
> cl /Zm800 -nologo -TP /O2 /Ob2 /W4 /GR /MD /DWIN32 /DX86 /D_X86_
> /Zc:forScope /Zc:wchar_t /Wp64 /Ogiy /Gs /Ot /GB /wd4675 /EHs
> @"..\..\..\build\tools\pch\msvc-7.1\release\main.obj.rsp" -c
> -Fo"..\..\..\build\tools\pch\msvc-7.1\release\main.obj" -Yu"pch.hpp"

So, there's no -Fp option here.

And your generator is:

  generators.register
    [ new pch-generator msvc.compile.pch : HPP : OBJ PCH : <toolset>msvc ] ;

and you action is:

  actions compile.pch
  {
    $(.CC) /Zm800 -nologo -TP -U$(UNDEFS) $(CFLAGS) $(C++FLAGS) $(USER_CFLAGS)
    @"@($(<[1]:W).rsp:E=$(nl)"$(>[1])" $(nl)-D$(DEFINES)
    $(nl)"-I$(INCLUDES)")" -c -Fo"$(<[1])" -Yc"$(>[2])" -Fp"$(<[2])"
  }

which includes -Fp"$(<[2])" but it's not taking effect? Wierd. Try adding

   echo $(<[2])

as the first line in the action. Also try:

  rule compile.pch ( targets * : sources * : properties * )
  {
         ECHO $(targets) ;
  }

Also try "--debug-generators" option to see what that msvc.compile.pch
generator produces both OBJ and PCH targets.

> ...failed msvc.compile.c++
> ..\..\..\build\tools\pch\msvc-7.1\release\main.obj...
>
> The problem is that you need to add
>
> -Fp"..\..\..\build\tools\pch\msvc-7.1\release\mypch.pch"
>
> to the compile action. This is what the:
>
> flags msvc.compile PCH_FILE <pch>on : <use-pch-file> ;
>
> is for. (The other one, I have renamed PCH_HEADER). So I need to add
> <use-pch-file> to the list of properties when evaluating the pch rule.
> Thus the commented out:
>
> return
> [ property-set.create
> <use-pch-header>$(sources[2])
> #<use-pch-file>$(targets[2]) # <== HERE

This will add <use-pch-file> only to usage requirements, not to properties of
already create targets. Am I missing something?

- Volodya


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