mirror of
https://github.com/boostorg/build.git
synced 2026-02-16 01:12:13 +00:00
* new/builtin.jam (link-action.adjust-properties): Remove. (linking-generator.generated-targets): Do what adjust-properties used to do. (linking-generator.run): Convert <library> properties to sources. (exe-generator): New class. [SVN r20455]
58 lines
1.2 KiB
Python
58 lines
1.2 KiB
Python
#!/usr/bin/python
|
|
|
|
# This tests that
|
|
# 1) the 'make' correctly assigns types to produced targets
|
|
# 2) than if 'make' create targets of type CPP, they are
|
|
# correctly used (there was a bug with it).
|
|
|
|
from BoostBuild import Tester
|
|
t = Tester()
|
|
|
|
# In order to correctly link this app, 'b.cpp', created by 'make'
|
|
# rule, should be compiled.
|
|
t.write("project-root.jam", "import gcc ;")
|
|
t.write("Jamfile", r'''
|
|
rule create ( dst : src * : properties * )
|
|
{
|
|
# hack to echo a space under NT
|
|
setup on $(dst) = "set x=int main(){ return 0; }" ;
|
|
}
|
|
|
|
import modules ;
|
|
if [ modules.peek : NT ]
|
|
{
|
|
actions create
|
|
{
|
|
$(setup)
|
|
echo %x% > $(<)
|
|
}
|
|
}
|
|
else
|
|
{
|
|
actions create
|
|
{
|
|
echo "int main(){ return 0; }" > $(<)
|
|
}
|
|
}
|
|
|
|
IMPORT $(__name__) : create : : create ;
|
|
|
|
exe a : l dummy.cpp ;
|
|
|
|
# needs to be static lib for Windows - main cannot appear in DLL
|
|
static-lib l : a.cpp b.cpp ;
|
|
|
|
make b.cpp : : create ;
|
|
|
|
''')
|
|
t.write("a.cpp", "")
|
|
t.write("dummy.cpp", "// msvc needs at least one object file\n")
|
|
|
|
t.run_build_system()
|
|
n = t.adjust_names("bin/$toolset/debug/main-target-a/a.exe")[0]
|
|
n2 = t.adjust_names("bin/$toolset/debug/a.exe")[0]
|
|
added = t.unexpected_difference.added_files
|
|
t.fail_test(not (n in added) and not (n2 in added))
|
|
|
|
t.cleanup()
|