1#!/usr/local/bin/python3.8 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 16import BoostBuild 17 18t = BoostBuild.Tester(use_test_config=False) 19 20t.write("jamroot.jam", """ 21project : requirements <library>lib//x ; 22exe a : a.cpp foo ; 23obj foo : foo.cpp : <variant>release ; 24""") 25 26t.write("a.cpp", """ 27void aux(); 28int main() { aux(); } 29""") 30 31t.write("foo.cpp", """ 32void gee(); 33void aux() { gee(); } 34""") 35 36t.write("lib/x.cpp", """ 37void 38#if defined(_WIN32) 39__declspec(dllexport) 40#endif 41gee() {} 42""") 43 44t.write("lib/jamfile.jam", """ 45lib x : x.cpp ; 46""") 47 48t.write("lib/jamroot.jam", """ 49""") 50 51 52t.run_build_system() 53t.expect_addition("bin/$toolset/debug*/a.exe") 54t.expect_nothing("lib/bin/$toolset/release/x.obj") 55 56t.cleanup() 57