mirror of
https://github.com/boostorg/build.git
synced 2026-02-15 13:02:11 +00:00
Fix glob excludes in subdirectories.
Thanks to Norbert Unterberg for the bug report. [SVN r39103]
This commit is contained in:
@@ -143,5 +143,38 @@ exe a : [ glob $(pwd)/src/foo/*.cpp $(pwd)/src/bar/*.cpp ] ../d2/d//l ;
|
||||
t.run_build_system(subdir="d1")
|
||||
t.expect_addition("d1/bin/$toolset/debug/a.exe")
|
||||
|
||||
# Regression test: glob excludes used to be broken
|
||||
# when building from a subdirectory.
|
||||
t.rm(".")
|
||||
|
||||
t.write("Jamroot", """
|
||||
build-project p ;
|
||||
""")
|
||||
|
||||
t.write("p/p.c", """
|
||||
int main()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
""")
|
||||
|
||||
t.write("p/p_x.c", """
|
||||
int main()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
""")
|
||||
|
||||
t.write("p/Jamfile", """
|
||||
exe p :
|
||||
[ glob *.c : p_x.c ]
|
||||
;
|
||||
""")
|
||||
|
||||
t.run_build_system(subdir="p")
|
||||
t.expect_addition("p/bin/$toolset/debug/p.exe")
|
||||
|
||||
t.cleanup()
|
||||
|
||||
@@ -243,7 +243,9 @@ rule glob ( dirs * : patterns + : exclude-patterns * )
|
||||
}
|
||||
|
||||
local inc = [ GLOB-RECURSIVELY $(real-patterns) ] ;
|
||||
inc = [ sequence.transform NORMALIZE_PATH : $(inc) ] ;
|
||||
local exc = [ GLOB-RECURSIVELY $(real-exclude-patterns) ] ;
|
||||
exc = [ sequence.transform NORMALIZE_PATH : $(exc) ] ;
|
||||
|
||||
return [ sequence.transform path.make :
|
||||
[ set.difference $(inc) : $(exc) ] ] ;
|
||||
|
||||
Reference in New Issue
Block a user