]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/tools/build/test/custom_generator.py
3 # Copyright 2003, 2004, 2005 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)
7 # Attempt to declare a generator for creating OBJ from RC files. That generator
8 # should be considered together with standard CPP->OBJ generators and
9 # successfully create the target. Since we do not have a RC compiler everywhere,
10 # we fake the action. The resulting OBJ will be unusable, but it must be
15 t
= BoostBuild
.Tester()
17 t
.write("jamroot.jam", """
21 t
.write("rcc.jam", """
26 # Use 'RCC' to avoid conflicts with definitions in the standard rc.jam and
28 type.register RCC : rcc ;
30 rule resource-compile ( targets * : sources * : properties * )
32 print.output $(targets[1]) ;
33 print.text "rc-object" ;
36 generators.register-standard rcc.resource-compile : RCC : OBJ ;
40 import b2.build.type as type
41 import b2.build.generators as generators
43 from b2.manager import get_manager
45 # Use 'RCC' to avoid conflicts with definitions in the standard rc.jam and
47 type.register('RCC', ['rcc'])
49 generators.register_standard("rcc.resource-compile", ["RCC"], ["OBJ"])
51 get_manager().engine().register_action(
52 "rcc.resource-compile",
53 '@($(STDOUT):E=rc-object) > "$(<)"')
56 t
.write("jamfile.jam", """
64 t
.expect_content("bin/$toolset/debug*/r.obj", "rc-object")