From 6d4c855fffb8aad15600c804bba35e59f3ccb76f Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Wed, 23 Nov 2005 16:10:41 +0000 Subject: [PATCH] When installing .cpp files, don't scan them for #includes. It's pointless, we don't compile. Thanks to Franz Schnyder for the bug report. [SVN r31756] --- v2/build/virtual-target.jam | 19 +++++++++++++++++++ v2/test/stage.py | 18 ++++++++++++++++++ v2/tools/stage.jam | 3 ++- 3 files changed, 39 insertions(+), 1 deletion(-) diff --git a/v2/build/virtual-target.jam b/v2/build/virtual-target.jam index 9c4b4fe10..d0e9f3f68 100644 --- a/v2/build/virtual-target.jam +++ b/v2/build/virtual-target.jam @@ -770,6 +770,25 @@ class null-action : action } } +# Class which acts exactly like 'action', except that the sources +# are not scanned for dependencies. +class non-scanning-action : action +{ + rule __init__ ( sources * : action-name + : property-set ? ) + { + action.__init__ $(sources) : $(action-name) : $(property-set) ; + } + rule actualize-source-type ( sources * : property-set ) + { + local result ; + for local i in $(sources) + { + result += [ $(i).actualize ] ; + } + return $(result) ; + } +} + # Creates a virtual target with approariate name and type from 'file'. # If a target with that name in that project was already created, returns that already diff --git a/v2/test/stage.py b/v2/test/stage.py index e7129886a..a800612fa 100644 --- a/v2/test/stage.py +++ b/v2/test/stage.py @@ -210,6 +210,24 @@ alias h : ..//dist2 ; t.run_build_system(subdir="sub") t.expect_addition("dist2/b/c.h") +# Test that when installing .cpp files, we don't scan +# include dependencies. +t.rm(".") +t.write("Jamroot", """ +install dist : a.cpp ; +""") +t.write("a.cpp", """ +#include "a.h" +""") +t.write("a.h", "") +t.run_build_system() +t.expect_addition("dist/a.cpp") + +t.touch("a.h") +t.run_build_system() +t.expect_nothing("dist/a.cpp") + + diff --git a/v2/tools/stage.jam b/v2/tools/stage.jam index 8baa9e733..200ac1b78 100644 --- a/v2/tools/stage.jam +++ b/v2/tools/stage.jam @@ -250,7 +250,8 @@ rule copy-file ( project : source : properties ) local targets ; local name = [ $(source).name ] ; - new-a = [ new action $(source) : common.copy : $(properties) ] ; + new-a = [ + new non-scanning-action $(source) : common.copy : $(properties) ] ; local source-root = [ $(properties).get ] ; if $(source-root) {