From 46d8458e7ea24e318abc716f9ce4fac953f2ff05 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Mon, 5 Dec 2005 15:07:53 +0000 Subject: [PATCH] Support for Microsoft message compiler. Patch from Alexey Pakhunov. [SVN r31917] --- src/tools/mc.jam | 44 ++++++++++++++++++++++++++++++++++++++++++++ src/tools/msvc.jam | 16 ++++++++++++++++ 2 files changed, 60 insertions(+) create mode 100644 src/tools/mc.jam diff --git a/src/tools/mc.jam b/src/tools/mc.jam new file mode 100644 index 000000000..578377735 --- /dev/null +++ b/src/tools/mc.jam @@ -0,0 +1,44 @@ +#~ Copyright 2005 Alexey Pakhunov. +#~ Distributed under the Boost Software License, Version 1.0. +#~ (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) + +# Support for Microsoft message compiler tool. +# Notes: +# - there's just message compiler tool, there's no tool for +# extracting message strings from sources +# - This file allows to use Microsoft message compiler +# with any toolset. In msvc.jam, there's more specific +# message compiling action. + +import common ; +import generators ; +import feature : feature get-values ; +import toolset : flags ; +import type ; +import rc ; + +rule init ( ) +{ +} + +type.register MC : mc ; + + +# Command line options +feature mc-input-encoding : ansi unicode : free ; +feature mc-output-encoding : unicode ansi : free ; +feature mc-set-customer-bit : no yes : free ; + +flags mc.compile MCFLAGS ansi : -a ; +flags mc.compile MCFLAGS unicode : -u ; +flags mc.compile MCFLAGS ansi : -A ; +flags mc.compile MCFLAGS unicode : -U ; +flags mc.compile MCFLAGS no : ; +flags mc.compile MCFLAGS yes : -c ; + +generators.register-standard mc.compile : MC : H RC ; + +actions compile +{ + mc $(MCFLAGS) -h "$(<[1]:DW)" -r "$(<[2]:DW)" "$(>:W)" +} diff --git a/src/tools/msvc.jam b/src/tools/msvc.jam index 4dc08e33a..55734d350 100644 --- a/src/tools/msvc.jam +++ b/src/tools/msvc.jam @@ -19,6 +19,7 @@ import common ; import "class" : new ; import rc ; import midl ; +import mc ; if [ MATCH (--debug-configuration) : [ modules.peek : ARGV ] ] { @@ -40,6 +41,9 @@ feature.subfeature toolset msvc : vendor # Inherit MIDL flags toolset.inherit-flags msvc : midl ; +# Inherit MC flags +toolset.inherit-flags msvc : mc ; + RM = [ common.rm-command ] ; nl = " " ; @@ -328,6 +332,9 @@ local rule configure-really ( idl-compiler = [ get-values : $(options) ] ; idl-compiler ?= midl ; + mc-compiler = [ get-values : $(options) ] ; + mc-compiler ?= mc ; + for local i in 1 2 3 { @@ -350,6 +357,7 @@ local rule configure-really ( flags msvc.link .LD $(cond) : $(command[$(i)])$(linker) ; flags msvc.archive .LD $(cond) : $(command[$(i)])$(linker) ; flags msvc.compile .IDL $(cond) : $(command[$(i)])$(idl-compiler) ; + flags msvc.compile .MC $(cond) : $(command[$(i)])$(mc-compiler) ; } } @@ -498,6 +506,9 @@ generators.register-standard msvc.compile.asm : ASM : OBJ : msvc ; generators.register-c-compiler msvc.compile.idl : IDL : MSTYPELIB H C(%_i) C(%_proxy) C(%_dlldata) : msvc ; generators.override msvc.compile.idl : midl.compile.idl ; +generators.register-standard msvc.compile.mc : MC : H RC : msvc ; +generators.override msvc.compile.mc : mc.compile ; + # # Declare flags and action for compilation # @@ -681,6 +692,11 @@ actions link.dll bind DEF_FILE $(MANIFEST)$(<[1]).manifest $(OUTPUTRESOURCE)$(<[1]);2 } +actions compile.mc +{ + $(.MC) $(MCFLAGS) -h "$(<[1]:DW)" -r "$(<[2]:DW)" "$(>:W)" +} + # # Autodetection code