address_model_64 = ['<address-model>', '<address-model>64'] flags('midl.compile.idl', 'MIDLFLAGS', [ar + '/' + m for ar in architecture_x86 for m in address_model_32], ['/win32']) flags('midl.compile.idl', 'MIDLFLAGS', [ar + '/<address-model>64' for ar in architecture_x86], ['/x64']) flags('midl.compile.idl', 'MIDLFLAGS', ['<architecture>ia64/' + m for m in address_model_64], ['/ia64']) flags('midl.compile.idl', 'DEFINES', [], ['<define>']) flags('midl.compile.idl', 'UNDEFS', [], ['<undef>']) flags('midl.compile.idl', 'INCLUDES', [], ['<include>']) builtin.register_c_compiler( 'midl.compile.idl', ['IDL'], ['MSTYPELIB', 'H', 'C(%_i)', 'C(%_proxy)', 'C(%_dlldata)'], []) # MIDL does not always generate '%_proxy.c' and '%_dlldata.c'. This behavior # depends on contents of the source IDL file. Calling TOUCH_FILE below ensures # that both files will be created so bjam will not try to recreate them # constantly. get_manager().engine().register_action( 'midl.compile.idl', '''midl /nologo @"@($(<[1]:W).rsp:E= "$(>:W)" -D$(DEFINES) "-I$(INCLUDES)" -U$(UNDEFS) $(MIDLFLAGS) /tlb "$(<[1]:W)" /h "$(<[2]:W)"
# FIXME: this was originally declared quietly engine.register_action( 'compile.resource.null', 'as /dev/null -o "$(<)"') # Since it's a common practice to write # exe hello : hello.cpp hello.rc # we change the name of object created from RC file, to # avoid conflict with hello.cpp. # The reason we generate OBJ and not RES, is that gcc does not # seem to like RES files, but works OK with OBJ. # See http://article.gmane.org/gmane.comp.lib.boost.build/5643/ # # Using 'register-c-compiler' adds the build directory to INCLUDES # FIXME: switch to generators builtin.register_c_compiler('rc.compile.resource', ['RC'], ['OBJ(%_res)'], []) __angle_include_re = "#include[ ]*<([^<]+)>" # Register scanner for resources class ResScanner(scanner.Scanner): def __init__(self, includes): scanner.__init__ ; self.includes = includes def pattern(self): return "(([^ ]+[ ]+(BITMAP|CURSOR|FONT|ICON|MESSAGETABLE|RT_MANIFEST)" +\ "[ ]+([^ \"]+|\"[^\"]+\"))|(#include[ ]*(<[^<]+>|\"[^\"]+\")))" ; def process(self, target, matches, binding):
# Architecture-specific options architecture_x86 = ['<architecture>' , '<architecture>x86'] address_model_32 = ['<address-model>', '<address-model>32'] address_model_64 = ['<address-model>', '<address-model>64'] flags('midl.compile.idl', 'MIDLFLAGS', [ar + '/' + m for ar in architecture_x86 for m in address_model_32 ], ['/win32']) flags('midl.compile.idl', 'MIDLFLAGS', [ar + '/<address-model>64' for ar in architecture_x86], ['/x64']) flags('midl.compile.idl', 'MIDLFLAGS', ['<architecture>ia64/' + m for m in address_model_64], ['/ia64']) flags('midl.compile.idl', 'DEFINES', [], ['<define>']) flags('midl.compile.idl', 'UNDEFS', [], ['<undef>']) flags('midl.compile.idl', 'INCLUDES', [], ['<include>']) builtin.register_c_compiler('midl.compile.idl', ['IDL'], ['MSTYPELIB', 'H', 'C(%_i)', 'C(%_proxy)', 'C(%_dlldata)'], []) # MIDL does not always generate '%_proxy.c' and '%_dlldata.c'. This behavior # depends on contents of the source IDL file. Calling TOUCH_FILE below ensures # that both files will be created so bjam will not try to recreate them # constantly. get_manager().engine().register_action( 'midl.compile.idl', '''midl /nologo @"@($(<[1]:W).rsp:E= "$(>:W)" -D$(DEFINES) "-I$(INCLUDES)" -U$(UNDEFS) $(MIDLFLAGS) /tlb "$(<[1]:W)"
# across the board. The null RC uses the assembler to create the empty # objects, so configure that. rc_command = common.get_invocation_command('gcc', 'as', [], [bin], path_last=True) rc_type = 'null' rc.configure(rc_command, condition, '<rc-type>' + rc_type) ###if [ os.name ] = NT ###{ ### # This causes single-line command invocation to not go through .bat files, ### # thus avoiding command-line length limitations. ### JAMSHELL = % ; ###} #FIXME: when register_c_compiler is moved to # generators, these should be updated builtin.register_c_compiler('gcc.compile.c++', ['CPP'], ['OBJ'], ['<toolset>gcc']) builtin.register_c_compiler('gcc.compile.c', ['C'], ['OBJ'], ['<toolset>gcc']) builtin.register_c_compiler('gcc.compile.asm', ['ASM'], ['OBJ'], ['<toolset>gcc']) # pch support # The compiler looks for a precompiled header in each directory just before it # looks for the include file in that directory. The name searched for is the # name specified in the #include directive with ".gch" suffix appended. The # logic in gcc-pch-generator will make sure that BASE_PCH suffix is appended to # full name of the header. type.set_generated_target_suffix('PCH', ['<toolset>gcc'], 'gch') # GCC-specific pch generator. class GccPchGenerator(pch.PchGenerator):
'as', [], [bin], path_last=True) rc_type = 'null' rc.configure(rc_command, condition, '<rc-type>' + rc_type) ###if [ os.name ] = NT ###{ ### # This causes single-line command invocation to not go through .bat files, ### # thus avoiding command-line length limitations. ### JAMSHELL = % ; ###} #FIXME: when register_c_compiler is moved to # generators, these should be updated builtin.register_c_compiler('gcc.compile.c++', ['CPP'], ['OBJ'], ['<toolset>gcc']) builtin.register_c_compiler('gcc.compile.c', ['C'], ['OBJ'], ['<toolset>gcc']) builtin.register_c_compiler('gcc.compile.asm', ['ASM'], ['OBJ'], ['<toolset>gcc']) # pch support # The compiler looks for a precompiled header in each directory just before it # looks for the include file in that directory. The name searched for is the # name specified in the #include directive with ".gch" suffix appended. The # logic in gcc-pch-generator will make sure that BASE_PCH suffix is appended to # full name of the header. type.set_generated_target_suffix('PCH', ['<toolset>gcc'], 'gch')
# Architecture-specific options architecture_x86 = ["<architecture>", "<architecture>x86"] address_model_32 = ["<address-model>", "<address-model>32"] address_model_64 = ["<address-model>", "<address-model>64"] flags("midl.compile.idl", "MIDLFLAGS", [ar + "/" + m for ar in architecture_x86 for m in address_model_32], ["/win32"]) flags("midl.compile.idl", "MIDLFLAGS", [ar + "/<address-model>64" for ar in architecture_x86], ["/x64"]) flags("midl.compile.idl", "MIDLFLAGS", ["<architecture>ia64/" + m for m in address_model_64], ["/ia64"]) flags("midl.compile.idl", "DEFINES", [], ["<define>"]) flags("midl.compile.idl", "UNDEFS", [], ["<undef>"]) flags("midl.compile.idl", "INCLUDES", [], ["<include>"]) builtin.register_c_compiler("midl.compile.idl", ["IDL"], ["MSTYPELIB", "H", "C(%_i)", "C(%_proxy)", "C(%_dlldata)"], []) # MIDL does not always generate '%_proxy.c' and '%_dlldata.c'. This behavior # depends on contents of the source IDL file. Calling TOUCH_FILE below ensures # that both files will be created so bjam will not try to recreate them # constantly. get_manager().engine().register_action( "midl.compile.idl", '''midl /nologo @"@($(<[1]:W).rsp:E= "$(>:W)" -D$(DEFINES) "-I$(INCLUDES)" -U$(UNDEFS) $(MIDLFLAGS) /tlb "$(<[1]:W)"
'as', [], [bin], path_last=True) rc_type = 'null' rc.configure([rc_command], condition, ['<rc-type>' + rc_type]) ###if [ os.name ] = NT ###{ ### # This causes single-line command invocation to not go through .bat files, ### # thus avoiding command-line length limitations. ### JAMSHELL = % ; ###} #FIXME: when register_c_compiler is moved to # generators, these should be updated builtin.register_c_compiler('gcc.compile.c++.preprocess', ['CPP'], ['PREPROCESSED_CPP'], ['<toolset>gcc']) builtin.register_c_compiler('gcc.compile.c.preprocess', ['C'], ['PREPROCESSED_C'], ['<toolset>gcc']) builtin.register_c_compiler('gcc.compile.c++', ['CPP'], ['OBJ'], ['<toolset>gcc']) builtin.register_c_compiler('gcc.compile.c', ['C'], ['OBJ'], ['<toolset>gcc']) builtin.register_c_compiler('gcc.compile.asm', ['ASM'], ['OBJ'], ['<toolset>gcc']) # pch support # The compiler looks for a precompiled header in each directory just before it # looks for the include file in that directory. The name searched for is the # name specified in the #include directive with ".gch" suffix appended. The # logic in gcc-pch-generator will make sure that BASE_PCH suffix is appended to # full name of the header.
# across the board. The null RC uses the assembler to create the empty # objects, so configure that. rc_command = common.get_invocation_command('gcc', 'as', [], [bin], path_last=True) rc_type = 'null' rc.configure([rc_command], condition, ['<rc-type>' + rc_type]) ###if [ os.name ] = NT ###{ ### # This causes single-line command invocation to not go through .bat files, ### # thus avoiding command-line length limitations. ### JAMSHELL = % ; ###} #FIXME: when register_c_compiler is moved to # generators, these should be updated builtin.register_c_compiler('gcc.compile.c++.preprocess', ['CPP'], ['PREPROCESSED_CPP'], ['<toolset>gcc']) builtin.register_c_compiler('gcc.compile.c.preprocess', ['C'], ['PREPROCESSED_C'], ['<toolset>gcc']) builtin.register_c_compiler('gcc.compile.c++', ['CPP'], ['OBJ'], ['<toolset>gcc']) builtin.register_c_compiler('gcc.compile.c', ['C'], ['OBJ'], ['<toolset>gcc']) builtin.register_c_compiler('gcc.compile.asm', ['ASM'], ['OBJ'], ['<toolset>gcc']) # pch support # The compiler looks for a precompiled header in each directory just before it # looks for the include file in that directory. The name searched for is the # name specified in the #include directive with ".gch" suffix appended. The # logic in gcc-pch-generator will make sure that BASE_PCH suffix is appended to # full name of the header. type.set_generated_target_suffix('PCH', ['<toolset>gcc'], 'gch')