]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | #!/usr/bin/python |
2 | ||
3 | # Copyright 2003 Vladimir Prus | |
4 | # Distributed under the Boost Software License, Version 1.0. | |
1e59de90 | 5 | # (See accompanying file LICENSE.txt or https://www.bfgroup.xyz/b2/LICENSE.txt) |
7c673cae FG |
6 | |
7 | # Test that building with optimization brings NDEBUG define, and, more | |
8 | # importantly, that dependency targets are built with NDEBUG as well, even if | |
9 | # they are not directly requested. | |
10 | ||
11 | import BoostBuild | |
12 | ||
13 | t = BoostBuild.Tester(use_test_config=False) | |
14 | ||
15 | t.write("jamroot.jam", "exe hello : hello.cpp lib//lib1 ;") | |
16 | t.write("hello.cpp", """\ | |
17 | #ifdef NDEBUG | |
18 | void foo(); | |
19 | int main() { foo(); } | |
20 | #endif | |
21 | """) | |
22 | t.write("lib/jamfile.jam", "lib lib1 : lib1.cpp ;") | |
23 | t.write("lib/lib1.cpp", """\ | |
24 | #ifdef NDEBUG | |
25 | void foo() {} | |
26 | #endif | |
27 | """) | |
28 | ||
29 | # 'release' builds should get the NDEBUG define. We use static linking to avoid | |
30 | # messing with imports/exports on Windows. | |
31 | t.run_build_system(["link=static", "release"]) | |
32 | ||
33 | t.cleanup() |