1#!/usr/bin/python 2 3# Copyright (C) Vladimir Prus 2006. 4# Distributed under the Boost Software License, Version 1.0. (See 5# accompanying file LICENSE_1_0.txt or copy at 6# http://www.boost.org/LICENSE_1_0.txt) 7 8# Regression test: if a library had no explicit sources, but only <source> 9# properties, it was built as if it were a searched library, and the specified 10# sources were not compiled. 11 12import BoostBuild 13 14t = BoostBuild.Tester(use_test_config=False) 15 16t.write("jamroot.jam", """ 17lib a : : <source>a.cpp ; 18""") 19 20t.write("a.cpp", """ 21#ifdef _WIN32 22__declspec(dllexport) 23#endif 24void foo() {} 25""") 26 27t.run_build_system() 28t.expect_addition("bin/$toolset/debug*/a.obj") 29 30t.rm("bin") 31 32 33# Now try with <conditional>. 34t.write("jamroot.jam", """ 35rule test ( properties * ) 36{ 37 return <source>a.cpp ; 38} 39lib a : : <conditional>@test ; 40""") 41 42t.run_build_system() 43t.expect_addition("bin/$toolset/debug*/a.obj") 44 45t.cleanup() 46