From 1a999110ea49292ad63a7dfd1edb35dd7fdf7482 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Sat, 4 Apr 2009 21:15:09 +0000 Subject: [PATCH] Adjust the search for project-config.jam. [SVN r52173] --- v2/build-system.jam | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/v2/build-system.jam b/v2/build-system.jam index 016942f2d..ef2e83068 100644 --- a/v2/build-system.jam +++ b/v2/build-system.jam @@ -388,14 +388,23 @@ local rule load-configuration-files ECHO "notice: User configuration file loading explicitly disabled." ; } } - - initialize-config-module project-config ; - - if [ project.find "." : "." ] + + # We look for project-config.jam from "." upward. + # I am not sure this is 100% right decision, we might as well check for + # it only alonside the Jamroot file. However: + # + # - We need to load project-root.jam before Jamroot + # - We probably would need to load project-root.jam even if there's no + # Jamroot - e.g. to implement automake-style out-of-tree builds. + local file = [ path.glob "." : project-config.jam ] ; + if ! $(file) { - local project-module = [ project.load "." ] ; - local root = [ project.attribute $(project-module) project-root ] ; - load-config project-config : project-config.jam : $(root) ; + file = [ path.glob-in-parents "." : project-config.jam ] ; + } + if $(file) + { + initialize-config-module project-config ; + load-config project-config : project-config.jam : $(file:D) ; } }