Index: intel-linux.jam =================================================================== --- intel-linux.jam (revision 51259) +++ intel-linux.jam (working copy) @@ -13,6 +13,7 @@ import common ; import errors ; import generators ; +import type ; feature.extend-subfeature toolset intel : platform : linux ; @@ -22,6 +23,12 @@ generators.override intel-linux.prebuilt : builtin.prebuilt ; generators.override intel-linux.searched-lib-generator : searched-lib-generator ; +# Override default do-nothing generators. +generators.override intel-linux.compile.c.pch : pch.default-c-pch-generator ; +generators.override intel-linux.compile.c++.pch : pch.default-cpp-pch-generator ; + +type.set-generated-target-suffix PCH : intel linux : pchi ; + toolset.inherit-rules intel-linux : gcc ; toolset.inherit-flags intel-linux : gcc : off on full space @@ -87,24 +94,48 @@ { gcc.setup-threading $(targets) : $(sources) : $(properties) ; gcc.setup-fpic $(targets) : $(sources) : $(properties) ; + DEPENDS $(<) : [ on $(<) return $(PCH_FILE) ] ; } -actions compile.c++ +actions compile.c++ bind PCH_FILE { - "$(CONFIG_COMMAND)" -c -xc++ $(OPTIONS) $(USER_OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -o "$(<)" "$(>)" + "$(CONFIG_COMMAND)" -c -xc++ $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" "-use_pch "$(PCH_FILE) -c -o "$(<)" "$(>)" } rule compile.c ( targets * : sources * : properties * ) { gcc.setup-threading $(targets) : $(sources) : $(properties) ; gcc.setup-fpic $(targets) : $(sources) : $(properties) ; + DEPENDS $(<) : [ on $(<) return $(PCH_FILE) ] ; } -actions compile.c +actions compile.c bind PCH_FILE { - "$(CONFIG_COMMAND)" -c -xc $(OPTIONS) $(USER_OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -o "$(<)" "$(>)" + "$(CONFIG_COMMAND)" -c -xc $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" "-use_pch "$(PCH_FILE) -c -o "$(<)" "$(>)" } +rule compile.c++.pch ( targets * : sources * : properties * ) +{ + gcc.setup-threading $(targets) : $(sources) : $(properties) ; + gcc.setup-fpic $(targets) : $(sources) : $(properties) ; +} + +actions compile.c++.pch +{ + "$(CONFIG_COMMAND)" -x c++-header $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -create_pch "$(<)" "$(>)" +} + +rule compile.c.pch ( targets * : sources * : properties * ) +{ + gcc.setup-threading $(targets) : $(sources) : $(properties) ; + gcc.setup-fpic $(targets) : $(sources) : $(properties) ; +} + +actions compile.c.pch +{ + "$(CONFIG_COMMAND)" -x c-header $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -create_pch "$(<)" "$(>)" +} + rule link ( targets * : sources * : properties * ) { gcc.setup-threading $(targets) : $(sources) : $(properties) ;