diff --git a/new/project.jam b/new/project.jam index 772f9521a..175056f72 100644 --- a/new/project.jam +++ b/new/project.jam @@ -321,6 +321,8 @@ rule initialize ( # local project-root-module = [ project-roots.load $(location) ] ; local project-root = [ $(project-root-module).project-root get-location ] ; + + $(attributes).set project-root-module : $(project-root-module) : exact ; local parent = [ find-jamfile $(location) $(project-root) ] ; local parent-module = ; @@ -561,7 +563,6 @@ rule use ( id : location ) # This module defines rules common to all projects module project-rules { - rule project ( id ? : options * : * ) { import project ; diff --git a/test/project_root.py b/test/project_root.py new file mode 100644 index 000000000..db337bd86 --- /dev/null +++ b/test/project_root.py @@ -0,0 +1,23 @@ +#!/usr/bin/python + +# Copyright (C) Vladimir Prus 2003. Permission to copy, use, modify, sell and +# distribute this software is granted provided this copyright notice appears in +# all copies. This software is provided "as is" without express or implied +# warranty, and with no claim as to its suitability for any purpose. + +# Test that we can access project-root attributes from Jamfiles. +from BoostBuild import Tester, List + +# Create a temporary working directory +t = Tester() + +t.write("Jamfile", """ +local l = [ project-root get-location ] ; +ECHO XXX $(l) ; +""") + +t.write("project-root.jam", "") + +t.run_build_system(stdout="XXX .\n") + +t.cleanup() diff --git a/test/test_all.py b/test/test_all.py index 66a08440f..38b5df8cb 100644 --- a/test/test_all.py +++ b/test/test_all.py @@ -106,6 +106,7 @@ tests = [ "project_test1", "suffix", "inherit_toolset", "skipping", + "project_root", ] if os.name == 'posix': diff --git a/v2/build/project.jam b/v2/build/project.jam index 772f9521a..175056f72 100644 --- a/v2/build/project.jam +++ b/v2/build/project.jam @@ -321,6 +321,8 @@ rule initialize ( # local project-root-module = [ project-roots.load $(location) ] ; local project-root = [ $(project-root-module).project-root get-location ] ; + + $(attributes).set project-root-module : $(project-root-module) : exact ; local parent = [ find-jamfile $(location) $(project-root) ] ; local parent-module = ; @@ -561,7 +563,6 @@ rule use ( id : location ) # This module defines rules common to all projects module project-rules { - rule project ( id ? : options * : * ) { import project ; diff --git a/v2/test/project_root.py b/v2/test/project_root.py new file mode 100644 index 000000000..db337bd86 --- /dev/null +++ b/v2/test/project_root.py @@ -0,0 +1,23 @@ +#!/usr/bin/python + +# Copyright (C) Vladimir Prus 2003. Permission to copy, use, modify, sell and +# distribute this software is granted provided this copyright notice appears in +# all copies. This software is provided "as is" without express or implied +# warranty, and with no claim as to its suitability for any purpose. + +# Test that we can access project-root attributes from Jamfiles. +from BoostBuild import Tester, List + +# Create a temporary working directory +t = Tester() + +t.write("Jamfile", """ +local l = [ project-root get-location ] ; +ECHO XXX $(l) ; +""") + +t.write("project-root.jam", "") + +t.run_build_system(stdout="XXX .\n") + +t.cleanup() diff --git a/v2/test/test_all.py b/v2/test/test_all.py index 66a08440f..38b5df8cb 100644 --- a/v2/test/test_all.py +++ b/v2/test/test_all.py @@ -106,6 +106,7 @@ tests = [ "project_test1", "suffix", "inherit_toolset", "skipping", + "project_root", ] if os.name == 'posix':