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

Another fix for standalone projects.

[SVN r21226]
This commit is contained in:
Vladimir Prus
2003-12-11 14:12:02 +00:00
parent 8184b26a6f
commit fcc1dfdd5f
3 changed files with 61 additions and 2 deletions

View File

@@ -582,7 +582,6 @@ rule find ( id : project )
local target-part = $(split[2]) ;
if ! $(split)
{
project-part = . ;
target-part = $(id) ;
}
@@ -591,7 +590,18 @@ rule find ( id : project )
# The project used for finding main targets and for providing base directory
# for file paths.
local base-project = [ project.find $(project-part) : $(current-location) ] ;
local base-project ;
if $(project-part)
{
base-project = [ project.find $(project-part) : $(current-location) ] ;
}
else
{
# No project part in id. Resolve references relatively to the referring
# project.
base-project = $(project) ;
}
# Interpret target-part as project-id
if ! $(have-project-reference)

48
v2/test/standalone.py Normal file
View File

@@ -0,0 +1,48 @@
#!/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.
from BoostBuild import Tester, List
t = Tester()
# Regression tests: standalone project were not able to refer to targets
# declared in themselfs!
t.write("a.cpp", """
int main()
{
return 0;
}
""")
t.write("project-root.jam", """
import standalone ;
""")
t.write("standalone.jam", """
import project ;
project.initialize $(__name__) ;
project standalone ;
local pwd = [ PWD ] ;
alias x : $(pwd)/../a.cpp ;
alias runtime : x ;
""")
t.write("sub/Jamfile", """
stage bin : /standalone//runtime ;
""")
t.run_build_system(subdir="sub")
t.expect_addition("sub/bin/a.cpp")
t.cleanup()

View File

@@ -113,6 +113,7 @@ tests = [ "project_test1",
"composite",
"library_chain",
"unit_test",
"standalone",
]
if os.name == 'posix':