2
0
mirror of https://github.com/boostorg/build.git synced 2026-02-16 01:12:13 +00:00

Fix --build-dir for invocation from subdirs.

[SVN r28237]
This commit is contained in:
Vladimir Prus
2005-04-14 10:53:54 +00:00
parent 1b04aca862
commit d9fb658dbb
2 changed files with 12 additions and 5 deletions

View File

@@ -796,8 +796,8 @@ module project-rules
# This is Jamroot.
if $(id)
{
local specified = [ $(attributes).get build-dir ] ;
if $(specified) && [ path.is-rooted $(specified) ]
if $(explicit-build-dir)
&& [ path.is-rooted $(explicit-build-dir) ]
{
errors.user-error "Absolute directory specified via 'build-dir' project attribute"
: "Don't know how to combine that with the --build-dir option."
@@ -806,9 +806,9 @@ module project-rules
# Strip the leading slash from id.
local rid = [ MATCH /(.*) : $(id) ] ;
local p = [ path.join
$(global-build-dir) $(rid) $(specified) ] ;
$(global-build-dir) $(rid) $(explicit-build-dir) ] ;
$(attributes).set build-dir : $(p) ;
$(attributes).set build-dir : $(p) : exact ;
}
}
else

View File

@@ -80,9 +80,16 @@ build-project sub ;
""")
t.run_build_system("--build-dir=build")
t.expect_addition(["build/foo/bin.v2/$toolset/debug/a.exe",
t.expect_addition(["build/foo/bin.v2/$toolset/debug/a.exe",
"build/foo/bin.v2/sub/$toolset/debug/b.exe"])
# Try building in subdir
t.rm('build')
t.run_build_system("--build-dir=build", subdir="sub")
t.expect_addition(["sub/build/foo/bin.v2/sub/$toolset/debug/b.exe"])
t.write("Jamroot", """
project foo : build-dir %s ;
exe a : a.cpp ;