mirror of
https://github.com/boostorg/build.git
synced 2026-02-14 12:42:11 +00:00
Problem: Long command line problem using msvc toolset on BoostBuild V2
Description: If the number of characters exceeds 2047, the cl command fails.
Plattform: MSYS shell, VC++ 7.1
Resolution: Using of the response file facility
* tools/msvc.jam
Change *compile* generators to produce RSP target too.
Change compile actions to use RSP file
And compile rules to call common.response-file
* tools/common.jam
(response-file): Write defines and includes.
Thanks to Johannes Brunen for the patch.
[SVN r26275]
This commit is contained in:
@@ -462,7 +462,12 @@ rule response-file ( targets + : sources * : the-response-file : properties * )
|
||||
[ on $(targets[1])
|
||||
return "$(LIBRARY_OPTION)$(FINDLIBS_ST)"
|
||||
"$(LIBRARY_OPTION)$(FINDLIBS_SA)"
|
||||
] ] ;
|
||||
] ] ;
|
||||
|
||||
print.text
|
||||
[ on $(targets[1])
|
||||
return -D$(DEFINES) -I"$(INCLUDES)"
|
||||
] ;
|
||||
}
|
||||
|
||||
# response-file generation is broken up into two phases, the first of
|
||||
|
||||
@@ -225,8 +225,8 @@ generators.register-linker msvc.link : OBJ SEARCHED_LIB STATIC_LIB IMPORT_LIB :
|
||||
generators.register-linker msvc.link.dll : OBJ SEARCHED_LIB STATIC_LIB IMPORT_LIB : SHARED_LIB IMPORT_LIB RSP : <toolset>msvc ;
|
||||
|
||||
generators.register-archiver msvc.archive : OBJ : STATIC_LIB RSP : <toolset>msvc ;
|
||||
generators.register-c-compiler msvc.compile.c++ : CPP : OBJ : <toolset>msvc ;
|
||||
generators.register-c-compiler msvc.compile.c : C : OBJ : <toolset>msvc ;
|
||||
generators.register-c-compiler msvc.compile.c++ : CPP : OBJ RSP(%_cpp) : <toolset>msvc ;
|
||||
generators.register-c-compiler msvc.compile.c : C : OBJ RSP(%_cpp) : <toolset>msvc ;
|
||||
generators.register-standard msvc.compile.rc : RC : OBJ(%_res) : <toolset>msvc ;
|
||||
generators.override msvc.compile.rc : rc.resource-compile ;
|
||||
|
||||
@@ -265,11 +265,11 @@ flags msvc WHATEVER <toolset-msvc:version> ;
|
||||
# The actions differ only by explicit selection of input language
|
||||
actions compile.c
|
||||
{
|
||||
$(.CC) /Zm800 -nologo -TC -U$(UNDEFS) -D$(DEFINES) $(CFLAGS) $(USER_CFLAGS) -I"$(INCLUDES)" -c -Fo"$(<:W)" "$(>:W)"
|
||||
$(.CC) /Zm800 -nologo -TC -U$(UNDEFS) $(CFLAGS) $(USER_CFLAGS) @"$(<[2]:W)" -c -Fo"$(<[1]:W)"
|
||||
}
|
||||
actions compile.c++
|
||||
{
|
||||
$(.CC) /Zm800 -nologo -TP -U$(UNDEFS) -D$(DEFINES) $(CFLAGS) $(USER_CFLAGS) -I"$(INCLUDES)" -c -Fo"$(<:W)" "$(>:W)"
|
||||
$(.CC) /Zm800 -nologo -TP -U$(UNDEFS) $(CFLAGS) $(USER_CFLAGS) @"$(<[2]:W)" -c -Fo"$(<[1]:W)"
|
||||
}
|
||||
|
||||
actions compile.rc
|
||||
@@ -358,4 +358,14 @@ actions link.dll bind DEF_FILE
|
||||
$(.LD) /NOLOGO $(LINKFLAGS) /out:"$(<[1]:W)" /INCREMENTAL:NO /IMPLIB:"$(<[2]:W)" /LIBPATH:"$(LINKPATH:W)" /def:$(DEF_FILE) $(USER_LINKFLAGS) @"$(<[3]:W)"
|
||||
}
|
||||
|
||||
|
||||
rule compile.c++ ( targets + : sources * : properties * )
|
||||
{
|
||||
common.response-file $(targets) : $(sources) : $(targets[2]) : $(properties) ;
|
||||
}
|
||||
|
||||
rule compile.c ( targets + : sources * : properties * )
|
||||
{
|
||||
common.response-file $(targets) : $(sources) : $(targets[2]) : $(properties) ;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user