mirror of
https://github.com/boostorg/build.git
synced 2026-02-15 13:02:11 +00:00
Specifying target properties in target references now actually work.
* new/targets.jam (basic-target.generate-source): Fix regex.
* test/project_test4.py: New test.
[SVN r14374]
This commit is contained in:
@@ -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
|
||||
|
||||
3
test/project-test4/Jamfile
Normal file
3
test/project-test4/Jamfile
Normal file
@@ -0,0 +1,3 @@
|
||||
|
||||
make a.exe : a.obj lib/b.obj/<optimization>on : yfc-link ;
|
||||
make a.obj : a.cpp : yfc-compile ;
|
||||
0
test/project-test4/a.cpp
Normal file
0
test/project-test4/a.cpp
Normal file
2
test/project-test4/lib/Jamfile
Normal file
2
test/project-test4/lib/Jamfile
Normal file
@@ -0,0 +1,2 @@
|
||||
|
||||
make b.obj : b.cpp : yfc-compile ;
|
||||
0
test/project-test4/lib/b.cpp
Normal file
0
test/project-test4/lib/b.cpp
Normal file
27
test/project-test4/project-root.jam
Normal file
27
test/project-test4/project-root.jam
Normal file
@@ -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 ;
|
||||
2
test/project-test4/readme.txt
Normal file
2
test/project-test4/readme.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
|
||||
This test checks for correct properties of generated and used targets.
|
||||
32
test/project_test4.py
Normal file
32
test/project_test4.py
Normal file
@@ -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)
|
||||
@@ -17,4 +17,5 @@ import startup_v1
|
||||
import startup_v2
|
||||
import project_test1
|
||||
import project_test2
|
||||
import project_test3
|
||||
import project_test3
|
||||
import project_test4
|
||||
|
||||
@@ -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
|
||||
|
||||
3
v2/test/project-test4/Jamfile
Normal file
3
v2/test/project-test4/Jamfile
Normal file
@@ -0,0 +1,3 @@
|
||||
|
||||
make a.exe : a.obj lib/b.obj/<optimization>on : yfc-link ;
|
||||
make a.obj : a.cpp : yfc-compile ;
|
||||
0
v2/test/project-test4/a.cpp
Normal file
0
v2/test/project-test4/a.cpp
Normal file
2
v2/test/project-test4/lib/Jamfile
Normal file
2
v2/test/project-test4/lib/Jamfile
Normal file
@@ -0,0 +1,2 @@
|
||||
|
||||
make b.obj : b.cpp : yfc-compile ;
|
||||
0
v2/test/project-test4/lib/b.cpp
Normal file
0
v2/test/project-test4/lib/b.cpp
Normal file
27
v2/test/project-test4/project-root.jam
Normal file
27
v2/test/project-test4/project-root.jam
Normal file
@@ -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 ;
|
||||
2
v2/test/project-test4/readme.txt
Normal file
2
v2/test/project-test4/readme.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
|
||||
This test checks for correct properties of generated and used targets.
|
||||
32
v2/test/project_test4.py
Normal file
32
v2/test/project_test4.py
Normal file
@@ -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)
|
||||
@@ -17,4 +17,5 @@ import startup_v1
|
||||
import startup_v2
|
||||
import project_test1
|
||||
import project_test2
|
||||
import project_test3
|
||||
import project_test3
|
||||
import project_test4
|
||||
|
||||
Reference in New Issue
Block a user