diff --git a/new/targets.jam b/new/targets.jam index a55b41a9e..196944ba7 100644 --- a/new/targets.jam +++ b/new/targets.jam @@ -261,12 +261,12 @@ rule basic-target ( name : project rule generate-source ( source : properties * ) { # Separate target name from properties override - local split = [ MATCH "([^<]*)(/<.*)?" : $(source) ] ; + local split = [ MATCH "^([^<]*)(/(<.*))?$" : $(source) ] ; local id = $(split[1]) ; local sproperties = ; - if $(split[2]) + if $(split[3]) { - sproperties = [ property.make [ feature.split $(split[2]) ] ] ; + sproperties = [ property.make [ feature.split $(split[3]) ] ] ; } # Check if such target exists diff --git a/test/project-test4/Jamfile b/test/project-test4/Jamfile new file mode 100644 index 000000000..d8a22032d --- /dev/null +++ b/test/project-test4/Jamfile @@ -0,0 +1,3 @@ + +make a.exe : a.obj lib/b.obj/on : yfc-link ; +make a.obj : a.cpp : yfc-compile ; diff --git a/test/project-test4/a.cpp b/test/project-test4/a.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/test/project-test4/lib/Jamfile b/test/project-test4/lib/Jamfile new file mode 100644 index 000000000..be2c3649a --- /dev/null +++ b/test/project-test4/lib/Jamfile @@ -0,0 +1,2 @@ + +make b.obj : b.cpp : yfc-compile ; diff --git a/test/project-test4/lib/b.cpp b/test/project-test4/lib/b.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/test/project-test4/project-root.jam b/test/project-test4/project-root.jam new file mode 100644 index 000000000..a6f85e166 --- /dev/null +++ b/test/project-test4/project-root.jam @@ -0,0 +1,27 @@ + +import property ; + +rule yfc-compile ( target : sources * : property-set * ) +{ + PROPERTIES on $(target) = [ property.as-path $(property-set) ] ; +} + +actions yfc-compile +{ + echo $(PROPERTIES) > $(<) + echo $(>) >> $(<) +} + +rule yfc-link ( target : sources * : property-set * ) +{ + PROPERTIES on $(target) = [ property.as-path $(property-set) ] ; +} + +actions yfc-link +{ + echo $(PROPERTIES) > $(<) + echo $(>) >> $(<) +} + + +IMPORT $(__name__) : yfc-compile yfc-link : : yfc-compile yfc-link ; diff --git a/test/project-test4/readme.txt b/test/project-test4/readme.txt new file mode 100644 index 000000000..ec68724af --- /dev/null +++ b/test/project-test4/readme.txt @@ -0,0 +1,2 @@ + +This test checks for correct properties of generated and used targets. \ No newline at end of file diff --git a/test/project_test4.py b/test/project_test4.py new file mode 100644 index 000000000..ec6595db5 --- /dev/null +++ b/test/project_test4.py @@ -0,0 +1,32 @@ +#!/usr/bin/python + +from BoostBuild import Tester +import os +from string import strip + +t = Tester() + + +t.set_tree("project-test4") + +t.run_build_system() + +t.expect_addition("bin/gcc/debug/threading-single/a.obj") +t.expect_content("bin/gcc/debug/threading-single/a.obj", +"""gcc/debug/threading-single +a.cpp +""") + +t.expect_addition("bin/gcc/debug/threading-single/a.exe") +t.expect_content("bin/gcc/debug/threading-single/a.exe", +"gcc/debug/threading-single\n" + +"bin/gcc/debug/threading-single/a.obj lib/bin/gcc/debug/optimization-on/threading-single/b.obj\n" +) + +t.expect_addition("lib/bin/gcc/debug/optimization-on/threading-single/b.obj") +t.expect_content("lib/bin/gcc/debug/optimization-on/threading-single/b.obj", +"""gcc/debug/optimization-on/threading-single +lib/b.cpp +""") + +os.chdir(t.original_workdir) \ No newline at end of file diff --git a/test/test_all.py b/test/test_all.py index 8a91a40d2..99644baa9 100644 --- a/test/test_all.py +++ b/test/test_all.py @@ -17,4 +17,5 @@ import startup_v1 import startup_v2 import project_test1 import project_test2 -import project_test3 \ No newline at end of file +import project_test3 +import project_test4 diff --git a/v2/build/targets.jam b/v2/build/targets.jam index a55b41a9e..196944ba7 100644 --- a/v2/build/targets.jam +++ b/v2/build/targets.jam @@ -261,12 +261,12 @@ rule basic-target ( name : project rule generate-source ( source : properties * ) { # Separate target name from properties override - local split = [ MATCH "([^<]*)(/<.*)?" : $(source) ] ; + local split = [ MATCH "^([^<]*)(/(<.*))?$" : $(source) ] ; local id = $(split[1]) ; local sproperties = ; - if $(split[2]) + if $(split[3]) { - sproperties = [ property.make [ feature.split $(split[2]) ] ] ; + sproperties = [ property.make [ feature.split $(split[3]) ] ] ; } # Check if such target exists diff --git a/v2/test/project-test4/Jamfile b/v2/test/project-test4/Jamfile new file mode 100644 index 000000000..d8a22032d --- /dev/null +++ b/v2/test/project-test4/Jamfile @@ -0,0 +1,3 @@ + +make a.exe : a.obj lib/b.obj/on : yfc-link ; +make a.obj : a.cpp : yfc-compile ; diff --git a/v2/test/project-test4/a.cpp b/v2/test/project-test4/a.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/v2/test/project-test4/lib/Jamfile b/v2/test/project-test4/lib/Jamfile new file mode 100644 index 000000000..be2c3649a --- /dev/null +++ b/v2/test/project-test4/lib/Jamfile @@ -0,0 +1,2 @@ + +make b.obj : b.cpp : yfc-compile ; diff --git a/v2/test/project-test4/lib/b.cpp b/v2/test/project-test4/lib/b.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/v2/test/project-test4/project-root.jam b/v2/test/project-test4/project-root.jam new file mode 100644 index 000000000..a6f85e166 --- /dev/null +++ b/v2/test/project-test4/project-root.jam @@ -0,0 +1,27 @@ + +import property ; + +rule yfc-compile ( target : sources * : property-set * ) +{ + PROPERTIES on $(target) = [ property.as-path $(property-set) ] ; +} + +actions yfc-compile +{ + echo $(PROPERTIES) > $(<) + echo $(>) >> $(<) +} + +rule yfc-link ( target : sources * : property-set * ) +{ + PROPERTIES on $(target) = [ property.as-path $(property-set) ] ; +} + +actions yfc-link +{ + echo $(PROPERTIES) > $(<) + echo $(>) >> $(<) +} + + +IMPORT $(__name__) : yfc-compile yfc-link : : yfc-compile yfc-link ; diff --git a/v2/test/project-test4/readme.txt b/v2/test/project-test4/readme.txt new file mode 100644 index 000000000..ec68724af --- /dev/null +++ b/v2/test/project-test4/readme.txt @@ -0,0 +1,2 @@ + +This test checks for correct properties of generated and used targets. \ No newline at end of file diff --git a/v2/test/project_test4.py b/v2/test/project_test4.py new file mode 100644 index 000000000..ec6595db5 --- /dev/null +++ b/v2/test/project_test4.py @@ -0,0 +1,32 @@ +#!/usr/bin/python + +from BoostBuild import Tester +import os +from string import strip + +t = Tester() + + +t.set_tree("project-test4") + +t.run_build_system() + +t.expect_addition("bin/gcc/debug/threading-single/a.obj") +t.expect_content("bin/gcc/debug/threading-single/a.obj", +"""gcc/debug/threading-single +a.cpp +""") + +t.expect_addition("bin/gcc/debug/threading-single/a.exe") +t.expect_content("bin/gcc/debug/threading-single/a.exe", +"gcc/debug/threading-single\n" + +"bin/gcc/debug/threading-single/a.obj lib/bin/gcc/debug/optimization-on/threading-single/b.obj\n" +) + +t.expect_addition("lib/bin/gcc/debug/optimization-on/threading-single/b.obj") +t.expect_content("lib/bin/gcc/debug/optimization-on/threading-single/b.obj", +"""gcc/debug/optimization-on/threading-single +lib/b.cpp +""") + +os.chdir(t.original_workdir) \ No newline at end of file diff --git a/v2/test/test_all.py b/v2/test/test_all.py index 8a91a40d2..99644baa9 100644 --- a/v2/test/test_all.py +++ b/v2/test/test_all.py @@ -17,4 +17,5 @@ import startup_v1 import startup_v2 import project_test1 import project_test2 -import project_test3 \ No newline at end of file +import project_test3 +import project_test4