From 8344a5b75b442b608c341bbd45c4e10221012785 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Sun, 24 Sep 2006 10:12:34 +0000 Subject: [PATCH] Merge changes from trunk [SVN r35304] --- src/tools/pch.jam | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/src/tools/pch.jam b/src/tools/pch.jam index 3ea6d8d9a..370ba67a4 100644 --- a/src/tools/pch.jam +++ b/src/tools/pch.jam @@ -1,8 +1,8 @@ # Copyright (c) 2005 Reece H. Dunn. # -# Distributed under the Boost Software License, Version 1.0. -# (See accompanying file LICENSE_1_0.txt or copy at -# http://www.boost.org/LICENSE_1_0.txt) +# Use, modification and distribution is subject to the Boost Software +# License Version 1.0. (See accompanying file LICENSE_1_0.txt or +# http://www.boost.org/LICENSE_1_0.txt) import type ; import feature : feature ; @@ -50,18 +50,29 @@ class pch-generator : generator rule run ( project name ? : property-set : sources * ) { + # The two sources are cpp file and PCHEADER, but they + # can be passed in any order. Figure out which source + # is what. + local cpp = $(sources[2]) ; + local h = $(sources[1]) ; + if [ $(sources[2]).type ] = PCHEADER + { + cpp = $(sources[1]) ; + h = $(sources[2]) ; + } + local r = [ generator.run $(project) $(name) : [ property-set.create - $(sources[2]) # mypch.cpp + $(cpp) # mypch.cpp [ $(property-set).raw ] ] : $(sources) ] ; return [ property-set.create - $(sources[1]) # mypch.h[pp] + $(h) # mypch.h[pp] $(r[2]) # mypch.pch ] $(r) ; }