diff --git a/v2/tools/builtin.jam b/v2/tools/builtin.jam index 13a7bf272..f05b9c51e 100644 --- a/v2/tools/builtin.jam +++ b/v2/tools/builtin.jam @@ -156,10 +156,6 @@ feature.feature warnings-as-errors : # define some of the values here and leave it up to the user to extend this set # as he needs using the feature.extend rule. # -# If a specific toolset requires a default value for this feature other than the -# one defined here it should set the feature's default value using the -# feature.set-default rule. -# # TODO: This should be upgraded as soon as Boost Build adds support for custom # validated feature values or at least features allowing any positive integral # value. See related Boost Build related trac ticket #194. @@ -172,7 +168,7 @@ feature.feature c++-template-depth # conforming programs. 17 : - incidental propagated ; + incidental optional propagated ; feature.feature source : : free dependency incidental ; feature.feature library : : free dependency incidental ; diff --git a/v2/tools/gcc.jam b/v2/tools/gcc.jam index 7f6920431..72e8ca3dc 100644 --- a/v2/tools/gcc.jam +++ b/v2/tools/gcc.jam @@ -367,6 +367,21 @@ rule compile.c++ LANG on $(<) = "-x c++" ; } DEPENDS $(<) : [ on $(<) return $(PCH_FILE) ] ; + + # Here we want to raise the template-depth parameter value to something + # higher than the default value of 17. Note that we could do this using the + # feature.set-default rule but we do not want to set the default value for + # all toolsets as well. + # + # TODO: This 'modified default' has been inherited from some 'older Boost + # Build implementation' and has most likely been added to make some Boost + # library parts compile correctly. We should see what exactly prompted this + # and whether we can get around the problem more locally. + local template-depth = [ on $(<) return $(TEMPLATE_DEPTH) ] ; + if ! $(template-depth) + { + TEMPLATE_DEPTH on $(<) = 128 ; + } } rule compile.c diff --git a/v2/tools/qcc.jam b/v2/tools/qcc.jam index 390c36aef..960309197 100644 --- a/v2/tools/qcc.jam +++ b/v2/tools/qcc.jam @@ -80,9 +80,26 @@ flags qcc.compile INCLUDES ; flags qcc.compile OPTIONS shared : -shared ; flags qcc.compile.c++ TEMPLATE_DEPTH ; -feature.set-default c++-template-depth : 100 ; +rule compile.c++ +{ + # Here we want to raise the template-depth parameter value to something + # higher than the default value of 17. Note that we could do this using the + # feature.set-default rule but we do not want to set the default value for + # all toolsets as well. + # + # TODO: This 'modified default' has been inherited from some 'older Boost + # Build implementation' and has most likely been added to make some Boost + # library parts compile correctly. We should see what exactly prompted this + # and whether we can get around the problem more locally. + local template-depth = [ on $(1) return $(TEMPLATE_DEPTH) ] ; + if ! $(template-depth) + { + TEMPLATE_DEPTH on $(1) = 100 ; + } +} + actions compile.c++ { "$(CONFIG_COMMAND)" -Wc,-ftemplate-depth-$(TEMPLATE_DEPTH) $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -o "$(<)" "$(>)"