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=) "&&" ] ] ; } }