]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/tools/build/test/ndebug.py
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / boost / tools / build / test / ndebug.py
CommitLineData
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
11import BoostBuild
12
13t = BoostBuild.Tester(use_test_config=False)
14
15t.write("jamroot.jam", "exe hello : hello.cpp lib//lib1 ;")
16t.write("hello.cpp", """\
17#ifdef NDEBUG
18void foo();
19int main() { foo(); }
20#endif
21""")
22t.write("lib/jamfile.jam", "lib lib1 : lib1.cpp ;")
23t.write("lib/lib1.cpp", """\
24#ifdef NDEBUG
25void 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.
31t.run_build_system(["link=static", "release"])
32
33t.cleanup()