]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | #!/usr/bin/python |
2 | ||
3 | # Copyright 2004 Vladimir Prus | |
4 | # Distributed under the Boost Software License, Version 1.0. | |
5 | # (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) | |
6 | ||
7 | # Test that the <library> property has no effect on "obj" targets. Previously, | |
8 | # it affected all targets, so | |
9 | # | |
10 | # project : requirements <library>foo ; | |
11 | # exe a : a.cpp helper ; | |
12 | # obj helper : helper.cpp : <optimization>off ; | |
13 | # | |
14 | # caused 'foo' to be built with and without optimization. | |
15 | ||
16 | import BoostBuild | |
17 | ||
18 | t = BoostBuild.Tester(use_test_config=False) | |
19 | ||
20 | t.write("jamroot.jam", """ | |
21 | project : requirements <library>lib//x ; | |
22 | exe a : a.cpp foo ; | |
23 | obj foo : foo.cpp : <variant>release ; | |
24 | """) | |
25 | ||
26 | t.write("a.cpp", """ | |
27 | void aux(); | |
28 | int main() { aux(); } | |
29 | """) | |
30 | ||
31 | t.write("foo.cpp", """ | |
32 | void gee(); | |
33 | void aux() { gee(); } | |
34 | """) | |
35 | ||
36 | t.write("lib/x.cpp", """ | |
37 | void | |
38 | #if defined(_WIN32) | |
39 | __declspec(dllexport) | |
40 | #endif | |
41 | gee() {} | |
42 | """) | |
43 | ||
44 | t.write("lib/jamfile.jam", """ | |
45 | lib x : x.cpp ; | |
46 | """) | |
47 | ||
48 | t.write("lib/jamroot.jam", """ | |
49 | """) | |
50 | ||
51 | ||
52 | t.run_build_system() | |
b32b8144 | 53 | t.expect_addition("bin/$toolset/debug*/a.exe") |
7c673cae FG |
54 | t.expect_nothing("lib/bin/$toolset/release/x.obj") |
55 | ||
56 | t.cleanup() |