Boost logo

Boost-Build :

From: Franz (fschnyder_at_[hidden])
Date: 2006-10-14 10:27:24


Hi Vladimir

Vladimir Prus wrote:
> Here's what I've just committed. Can you confirm that CVS state of Boost.Build
> works fine now?

I did old test case (testcase_old.zip) with the boost-build-2.0-m11
release. So I checked out the CVS version to try it.
I couldn't compile the test right away, because the pch support changed
since M11 so I had to change my Jamfiles like remove the cast's and so
on (testcase_new.cip). And now I run into another Problem with the msvc
pch support. Everything works fine as long as there are no <source>
requirements in the project. If there is a <source> requirement (in my
testcase a library needing another library) the build fails with :

*** argument error
* rule run-pch ( project name ? : property-set : source-1 source-2 )
* called with: ( object(project-target)@58 LibBPch :
object(property-set)@128 : object(file-target)@117
object(file-target)@124 object(file-target)@126 )
* extra argument object(file-target)@126
D:/tools/boost-build/cvs/checkout/boost/tools/build/v2/tools\msvc.jam:552:see
definition of rule 'run-pch' being called

Here are the Jamfiles:

##### lib_a
project Pch/LibA
    : usage-requirements <include>. ;
name = a ;
cpp-pch Lib$(name:U)Pch : Lib$(name:U)Pch.hpp :
<toolset>msvc:<source>Lib$(name:U)Pch.cpp ;
lib $(name)_Lib : [ set.difference [ glob *.cpp ] :
Lib$(name:U)Pch.cpp ]
                               Lib$(name:U)Pch ;
##### lib_b
project Pch/LibB
     : usage-requirements <include>.
     : requirements <source>/Pch/LibA//a_Lib;
name = b ;
cpp-pch Lib$(name:U)Pch : Lib$(name:U)Pch.hpp :
<toolset>msvc:<source>Lib$(name:U)Pch.cpp ;
lib $(name)_Lib : [ set.difference [ glob *.cpp ] :
Lib$(name:U)Pch.cpp ]
                               Lib$(name:U)Pch ;
##### exe
project Pch/Exe ;
unit-test run : [ glob *.cpp ] /Pch/LibB//b_Lib ;

The Problem is that the msvc-pch-generator's run-pch rule accepts just
two sources:

rule run-pch ( project name ? : property-set : source-1 source-2 )

I changed this to (also see Path at the end):

rule run-pch ( project name ? : property-set : sources * )

And now everything just works fine. The problem with compilation options
being sometimes ignored is fixed. But I think there is now a problem in
msvc-pch-generator's run-pch rule. I don't know if it breaks something
when the msvc-pch-generator's run-pch rule is allowed to accept more
than the two sources but it works for my test case.

By the way the pch support for gcc works perfect for my test case.

Here is what i changed in the msvc-pch-generator:

Index: tools/build/v2/tools/msvc.jam
===================================================================
RCS file: /cvsroot/boost/boost/tools/build/v2/tools/msvc.jam,v
retrieving revision 1.91
diff -u -r1.91 msvc.jam
--- tools/build/v2/tools/msvc.jam 14 Oct 2006 08:26:13 -0000 1.91
+++ tools/build/v2/tools/msvc.jam 14 Oct 2006 14:04:20 -0000
@@ -543,10 +543,9 @@
  {
      import property-set ;

- rule run-pch ( project name ? : property-set : source-1 source-2 )
+ rule run-pch ( project name ? : property-set : sources * )
      {
          # searching header and source file in the sources
- local sources = $(source-1) $(source-2) ;
          local pch-header ;
          local pch-source ;
          for local s in $(sources)




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