From ca7748efe2b23048ba334f9695dbe8cd3960ba5e Mon Sep 17 00:00:00 2001 From: Steven Watanabe Date: Fri, 18 Jul 2008 03:25:20 +0000 Subject: [PATCH] Make c-scanner search directories specified with a&&b * tools/buitin.jam (c-scanner.__init__) split includes at && * test/test_all.py test/ordered_include.py Test case for this fix. [SVN r47537] --- v2/test/ordered_include.py | 43 ++++++++++++++++++++++++++++++++++++++ v2/test/test_all.py | 1 + v2/tools/builtin.jam | 4 +++- 3 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 v2/test/ordered_include.py diff --git a/v2/test/ordered_include.py b/v2/test/ordered_include.py new file mode 100644 index 000000000..72e885c61 --- /dev/null +++ b/v2/test/ordered_include.py @@ -0,0 +1,43 @@ +#!/usr/bin/python +# +# Copyright (c) 2008 Steven Watanabe +# +# 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) + +from BoostBuild import Tester + +tester = Tester() + +tester.write("Jamroot", """ + obj test : test.cpp : a&&b ; +""") + +tester.write("test.cpp", """ + #include + #include + + int main() { + } +""") + +tester.write("a/test1.hpp", """ +""") + +tester.write("b/test2.hpp", """ +""") + +tester.run_build_system() + +tester.expect_addition("bin/$toolset/debug/test.obj") + +tester.touch("a/test1.hpp") +tester.run_build_system() +tester.expect_touch("bin/$toolset/debug/test.obj") + +tester.touch("b/test2.hpp") +tester.run_build_system() +tester.expect_touch("bin/$toolset/debug/test.obj") + +tester.cleanup() diff --git a/v2/test/test_all.py b/v2/test/test_all.py index b7f6c3da4..c86a12673 100644 --- a/v2/test/test_all.py +++ b/v2/test/test_all.py @@ -169,6 +169,7 @@ tests = [ "rebuilds", "free_features_request", "file_name_handling", "sort_rule", + "ordered_include", "inherited_dependency" ] diff --git a/v2/tools/builtin.jam b/v2/tools/builtin.jam index 900c673dc..25394208c 100644 --- a/v2/tools/builtin.jam +++ b/v2/tools/builtin.jam @@ -386,6 +386,7 @@ class c-scanner : scanner import path ; import regex ; import scanner ; + import sequence ; import virtual-target ; rule __init__ ( includes * ) @@ -394,7 +395,8 @@ class c-scanner : scanner for local i in $(includes) { - self.includes += [ path.native $(i:G=) ] ; + self.includes += [ sequence.transform path.native + : [ regex.split $(i:G=) "&&" ] ] ; } }