1 # Copyright (c) 2005 Alexey Pakhunov.
2 # Copyright (c) 2011 Juraj Ivancic
4 # Use, modification and distribution is subject to the Boost Software
5 # License Version 1.0. (See accompanying file LICENSE_1_0.txt or
6 # http://www.boost.org/LICENSE_1_0.txt)
8 # Support for Microsoft message compiler tool.
10 # - there's just message compiler tool, there's no tool for
11 # extracting message strings from sources
12 # - This file allows to use Microsoft message compiler
13 # with any toolset. In msvc.jam, there's more specific
14 # message compiling action.
18 from b2.tools import common, rc
19 from b2.build import generators, type
20 from b2.build.toolset import flags
21 from b2.build.feature import feature
22 from b2.manager import get_manager
27 type.register('MC', ['mc'])
30 # Command line options
31 feature('mc-input-encoding', ['ansi', 'unicode'], ['free'])
32 feature('mc-output-encoding', ['unicode', 'ansi'], ['free'])
33 feature('mc-set-customer-bit', ['no', 'yes'], ['free'])
35 flags('mc.compile', 'MCFLAGS', ['<mc-input-encoding>ansi'], ['-a'])
36 flags('mc.compile', 'MCFLAGS', ['<mc-input-encoding>unicode'], ['-u'])
37 flags('mc.compile', 'MCFLAGS', ['<mc-output-encoding>ansi'], '-A')
38 flags('mc.compile', 'MCFLAGS', ['<mc-output-encoding>unicode'], ['-U'])
39 flags('mc.compile', 'MCFLAGS', ['<mc-set-customer-bit>no'], [])
40 flags('mc.compile', 'MCFLAGS', ['<mc-set-customer-bit>yes'], ['-c'])
42 generators.register_standard('mc.compile', ['MC'], ['H', 'RC'])
44 get_manager().engine().register_action(
46 'mc $(MCFLAGS) -h "$(<[1]:DW)" -r "$(<[2]:DW)" "$(>:W)"')