1#!/usr/bin/python 2 3# Copyright 2003 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 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() 34