diff --git a/src/build/configure.jam b/src/build/configure.jam index b3cd94db9..f9df172b6 100644 --- a/src/build/configure.jam +++ b/src/build/configure.jam @@ -276,6 +276,10 @@ rule try-find-build ( ps : what : * ) local x = [ PAD " - $(what)" : $(.width) ] ; for local i in $(args) { + if ! $($(i)[1]) + { + break ; + } local jam-targets ; for local t in $($(i)[2-]) { @@ -291,6 +295,7 @@ rule try-find-build ( ps : what : * ) } if ! $(result) { + log-check-result "$(x) : none" ; result = none ; } } diff --git a/test/configure.py b/test/configure.py index 573e1ecef..85fbbbc86 100644 --- a/test/configure.py +++ b/test/configure.py @@ -187,5 +187,33 @@ obj foo : foo.cpp : t.cleanup() +def test_choose_none(): + """Tests choose when none of the alternatives match.""" + t = BoostBuild.Tester(use_test_config=0) + t.write("Jamroot", """ +import configure ; +obj fail : fail.cpp ; +explicit pass fail ; +obj foo : foo.cpp : + [ configure.choose "which one?" : fail FAIL ] ; +""") + t.write("fail.cpp", "#error fail.cpp\n") + t.write("foo.cpp", """ +#ifdef FAIL +#error FAIL is defined +#endif +""") + t.run_build_system() + t.expect_output_lines([ + " - which one? : none"]) + + # An up-to-date build should use the cache + t.run_build_system() + t.expect_output_lines([ + " - which one? : none (cached)"]) + t.expect_nothing_more() + t.cleanup() + test_check_target_builds() test_choose() +test_choose_none()