Imported Upstream version 1.51.0
[platform/upstream/boost.git] / tools / build / v2 / tools / mc.py
1 # Copyright (c) 2005 Alexey Pakhunov.
2 # Copyright (c) 2011 Juraj Ivancic
3 #
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)
7
8 #  Support for Microsoft message compiler tool.
9 #  Notes:
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.
15
16 import bjam
17
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
23
24 def init():
25     pass
26
27 type.register('MC', ['mc'])
28
29
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'])
34
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'])
41
42 generators.register_standard('mc.compile', ['MC'], ['H', 'RC'])
43
44 get_manager().engine().register_action(
45     'mc.compile',
46     'mc $(MCFLAGS) -h "$(<[1]:DW)" -r "$(<[2]:DW)" "$(>:W)"')