diff --git a/src/tools/common.jam b/src/tools/common.jam index 1b6fe53a4..68aa7eb16 100644 --- a/src/tools/common.jam +++ b/src/tools/common.jam @@ -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 diff --git a/src/tools/msvc.jam b/src/tools/msvc.jam index bad49cf67..ee394156f 100644 --- a/src/tools/msvc.jam +++ b/src/tools/msvc.jam @@ -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 : msvc ; generators.register-archiver msvc.archive : OBJ : STATIC_LIB RSP : msvc ; -generators.register-c-compiler msvc.compile.c++ : CPP : OBJ : msvc ; -generators.register-c-compiler msvc.compile.c : C : OBJ : msvc ; +generators.register-c-compiler msvc.compile.c++ : CPP : OBJ RSP(%_cpp) : msvc ; +generators.register-c-compiler msvc.compile.c : C : OBJ RSP(%_cpp) : msvc ; generators.register-standard msvc.compile.rc : RC : OBJ(%_res) : msvc ; generators.override msvc.compile.rc : rc.resource-compile ; @@ -265,11 +265,11 @@ flags msvc WHATEVER ; # 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) ; +} + +