2
0
mirror of https://github.com/boostorg/build.git synced 2026-02-13 00:12:11 +00:00

Support for Microsoft message compiler.

Patch from Alexey Pakhunov.


[SVN r31917]
This commit is contained in:
Vladimir Prus
2005-12-05 15:07:53 +00:00
parent dee7c9650c
commit 46d8458e7e
2 changed files with 60 additions and 0 deletions

44
src/tools/mc.jam Normal file
View File

@@ -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 <mc-input-encoding>ansi : -a ;
flags mc.compile MCFLAGS <mc-input-encoding>unicode : -u ;
flags mc.compile MCFLAGS <mc-output-encoding>ansi : -A ;
flags mc.compile MCFLAGS <mc-output-encoding>unicode : -U ;
flags mc.compile MCFLAGS <mc-set-customer-bit>no : ;
flags mc.compile MCFLAGS <mc-set-customer-bit>yes : -c ;
generators.register-standard mc.compile : MC : H RC ;
actions compile
{
mc $(MCFLAGS) -h "$(<[1]:DW)" -r "$(<[2]:DW)" "$(>:W)"
}

View File

@@ -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 <idl-compiler> : $(options) ] ;
idl-compiler ?= midl ;
mc-compiler = [ get-values <mc-compiler> : $(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 : <toolset>msvc ;
generators.register-c-compiler msvc.compile.idl : IDL : MSTYPELIB H C(%_i) C(%_proxy) C(%_dlldata) : <toolset>msvc ;
generators.override msvc.compile.idl : midl.compile.idl ;
generators.register-standard msvc.compile.mc : MC : H RC : <toolset>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