mirror of
https://github.com/boostorg/build.git
synced 2026-02-01 08:22:15 +00:00
alias foo : [ run a.cpp ] ; and exe main : main.cpp [ lib helpers : helpers.cpp ] ; Now inline targets are marked explicit, so that they are not build unless requested, and for the alias target, the names of inline targets are not qualified by the name of top-level target. build/ * alias.jam (alias): Pass 'no-renaming' to target.main-target-sources. * target.jam (main-target-sources): New parameter 'no-renaming'. Make inline target explicit. * builtin.jam (lib): Declare 'result' variable, to avoid implicit declaration of a global one. tools/ * testing.jam (test-suite): Make synonymous with 'alias'. test/ * inline.py: Adjust to the fact that alias no longer changes names of inline targets. Check that inline targets are explicit. [SVN r35607]
72 lines
1.7 KiB
Python
72 lines
1.7 KiB
Python
#!/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()
|
|
|
|
t.write("Jamroot", """
|
|
project : requirements <link>static ;
|
|
exe a : a.cpp [ lib helper : helper.cpp ] ;
|
|
""")
|
|
|
|
t.write("a.cpp", """
|
|
extern void helper();
|
|
int main()
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
""")
|
|
|
|
t.write("helper.cpp", """
|
|
void helper()
|
|
{
|
|
}
|
|
""")
|
|
|
|
t.run_build_system()
|
|
t.expect_addition("bin/$toolset/debug/link-static/a__helper.lib")
|
|
t.rm("bin/$toolset/debug/link-static/a__helper.lib")
|
|
|
|
t.run_build_system("a__helper")
|
|
t.expect_addition("bin/$toolset/debug/link-static/a__helper.lib")
|
|
|
|
t.rm("bin")
|
|
|
|
# Now check that inline targets with the same name but
|
|
# present in different places are not confused between
|
|
# each other, and with top-level targets.
|
|
t.write("Jamroot", """
|
|
project : requirements <link>static ;
|
|
exe a : a.cpp [ lib helper : helper.cpp ] ;
|
|
exe a2 : a.cpp [ lib helper : helper.cpp ] ;
|
|
""")
|
|
|
|
t.run_build_system()
|
|
t.expect_addition("bin/$toolset/debug/link-static/a.exe")
|
|
t.expect_addition("bin/$toolset/debug/link-static/a__helper.lib")
|
|
t.expect_addition("bin/$toolset/debug/link-static/a2__helper.lib")
|
|
|
|
# Check that the 'alias' target does not change name of
|
|
# inline targets, and that inline targets are explicit.
|
|
t.write("Jamroot", """
|
|
project : requirements <link>static ;
|
|
alias a : [ lib helper : helper.cpp ] ;
|
|
explicit a ;
|
|
""")
|
|
t.rm("bin")
|
|
|
|
t.run_build_system()
|
|
t.expect_nothing_more()
|
|
|
|
t.run_build_system("a")
|
|
t.expect_addition("bin/$toolset/debug/link-static/helper.lib")
|
|
|
|
t.cleanup()
|
|
|