mirror of
https://github.com/boostorg/build.git
synced 2026-02-15 13:02:11 +00:00
Fix path properties handling bug, noted by Kirill Lapshin.
* new/property.jam (translate-paths): Apply 'path.make' to path properties. * test/path_features.py: Test for the bug. [SVN r18325]
This commit is contained in:
@@ -356,6 +356,8 @@ rule split-conditional ( property )
|
||||
|
||||
|
||||
# Interpret all path properties in 'properties' as relative to 'path'
|
||||
# The property values are assumed to be in system-specific form, and
|
||||
# will be translated into normalized form.
|
||||
rule translate-paths ( properties * : path )
|
||||
{
|
||||
local result ;
|
||||
@@ -371,7 +373,7 @@ rule translate-paths ( properties * : path )
|
||||
|
||||
if path in [ feature.attributes $(p:G) ]
|
||||
{
|
||||
local t = [ path.root $(p:TG=) $(path) ] ;
|
||||
local t = [ path.root [ path.make $(p:TG=) ] $(path) ] ;
|
||||
result += $(condition)$(t:TG=$(p:G)) ;
|
||||
}
|
||||
else
|
||||
|
||||
@@ -38,5 +38,30 @@ int main() { foo(); }
|
||||
t.rm("d/bin")
|
||||
t.run_build_system(subdir="d")
|
||||
|
||||
# Test that absolute paths inside requirements are ok. The problem
|
||||
# appear only when building targets in subprojects.
|
||||
t.write("project-root.jam", "")
|
||||
t.write("Jamfile", "build-project x ; ")
|
||||
t.write("x/Jamfile", """
|
||||
local pwd = [ PWD ] ;
|
||||
project : requirements <include>$(pwd)/x/include ;
|
||||
exe m : m.cpp : <include>$(pwd)/x/include2 ;
|
||||
""")
|
||||
t.write("x/m.cpp", """
|
||||
#include <h1.hpp>
|
||||
#include <h2.hpp>
|
||||
|
||||
int main() {}
|
||||
""")
|
||||
t.write("x/include/h1.hpp", "\n")
|
||||
t.write("x/include2/h2.hpp", "\n")
|
||||
|
||||
t.run_build_system()
|
||||
t.expect_addition("x/bin/$toolset/debug/main-target-m/m.exe")
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
t.cleanup()
|
||||
|
||||
@@ -356,6 +356,8 @@ rule split-conditional ( property )
|
||||
|
||||
|
||||
# Interpret all path properties in 'properties' as relative to 'path'
|
||||
# The property values are assumed to be in system-specific form, and
|
||||
# will be translated into normalized form.
|
||||
rule translate-paths ( properties * : path )
|
||||
{
|
||||
local result ;
|
||||
@@ -371,7 +373,7 @@ rule translate-paths ( properties * : path )
|
||||
|
||||
if path in [ feature.attributes $(p:G) ]
|
||||
{
|
||||
local t = [ path.root $(p:TG=) $(path) ] ;
|
||||
local t = [ path.root [ path.make $(p:TG=) ] $(path) ] ;
|
||||
result += $(condition)$(t:TG=$(p:G)) ;
|
||||
}
|
||||
else
|
||||
|
||||
@@ -38,5 +38,30 @@ int main() { foo(); }
|
||||
t.rm("d/bin")
|
||||
t.run_build_system(subdir="d")
|
||||
|
||||
# Test that absolute paths inside requirements are ok. The problem
|
||||
# appear only when building targets in subprojects.
|
||||
t.write("project-root.jam", "")
|
||||
t.write("Jamfile", "build-project x ; ")
|
||||
t.write("x/Jamfile", """
|
||||
local pwd = [ PWD ] ;
|
||||
project : requirements <include>$(pwd)/x/include ;
|
||||
exe m : m.cpp : <include>$(pwd)/x/include2 ;
|
||||
""")
|
||||
t.write("x/m.cpp", """
|
||||
#include <h1.hpp>
|
||||
#include <h2.hpp>
|
||||
|
||||
int main() {}
|
||||
""")
|
||||
t.write("x/include/h1.hpp", "\n")
|
||||
t.write("x/include2/h2.hpp", "\n")
|
||||
|
||||
t.run_build_system()
|
||||
t.expect_addition("x/bin/$toolset/debug/main-target-m/m.exe")
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
t.cleanup()
|
||||
|
||||
Reference in New Issue
Block a user