mirror of
https://github.com/boostorg/build.git
synced 2026-02-13 12:22:17 +00:00
Added a new c++-template-depth Boost Build feature allowing configuring compilers supporting this feature with the maximal template instantiation depth. Currently supported for gcc & qcc toolsets.
[SVN r47727]
This commit is contained in:
@@ -769,6 +769,32 @@ path-constant DATA : data/a.txt ;
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry><term><literal>c++-template-depth</literal></term>
|
||||
<indexterm><primary>64-bit compilation</primary></indexterm>
|
||||
<listitem>
|
||||
<para>
|
||||
<emphasis role="bold">Allowed values:</emphasis> Any positive
|
||||
integer.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
This feature allows configuring a C++ compiler with the maximal
|
||||
template instantiation depth parameter. Exact default values as well
|
||||
as whether this feature is supported at all depend on the toolset
|
||||
used.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
<emphasis role="bold">Note:</emphasis> Due to some internal details
|
||||
in the current Boost Build implementation it is not possible to have
|
||||
features whose valid values are all positive integer. As a
|
||||
workaround a large set of allowed values has been defined for this
|
||||
feature and, if a different one is needed, user can easily add it by
|
||||
calling the feature.extend rule.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
</variablelist>
|
||||
</section>
|
||||
|
||||
|
||||
@@ -15,6 +15,7 @@ import toolset : flags ;
|
||||
import errors : error ;
|
||||
import generate ;
|
||||
import generators ;
|
||||
import numbers ;
|
||||
import os ;
|
||||
import print ;
|
||||
import project ;
|
||||
@@ -146,6 +147,33 @@ feature.feature warnings-as-errors :
|
||||
on # Fail the compilation if there are warnings.
|
||||
: incidental propagated ;
|
||||
|
||||
# Feature that allows us to configure the maximal template instantiation depth
|
||||
# level allowed by a C++ compiler. Applies only to C++ toolsets whose compilers
|
||||
# actually support this configuration setting.
|
||||
#
|
||||
# Note that Boost Build currently does not allow defining features that take any
|
||||
# positive integral value as a parameter, which is what we need here, so we just
|
||||
# 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.
|
||||
#
|
||||
feature.feature c++-template-depth
|
||||
:
|
||||
[ numbers.range 128 1024 : 128 ]
|
||||
[ numbers.range 20 1000 : 10 ]
|
||||
# Maximum template instantiation depth guaranteed for ANSI/ISO C++
|
||||
# conforming programs.
|
||||
17
|
||||
:
|
||||
incidental propagated ;
|
||||
|
||||
feature.feature source : : free dependency incidental ;
|
||||
feature.feature library : : free dependency incidental ;
|
||||
feature.feature file : : free dependency incidental ;
|
||||
|
||||
@@ -345,6 +345,8 @@ flags gcc.compile USER_OPTIONS <cflags> ;
|
||||
flags gcc.compile.c++ USER_OPTIONS <cxxflags> ;
|
||||
flags gcc.compile DEFINES <define> ;
|
||||
flags gcc.compile INCLUDES <include> ;
|
||||
flags gcc.compile.c++ TEMPLATE_DEPTH <c++-template-depth> ;
|
||||
|
||||
|
||||
actions compile.c++.pch
|
||||
{
|
||||
@@ -381,7 +383,7 @@ rule compile.c
|
||||
|
||||
actions compile.c++ bind PCH_FILE
|
||||
{
|
||||
"$(CONFIG_COMMAND)" $(LANG) -ftemplate-depth-128 $(OPTIONS) $(USER_OPTIONS) -D$(DEFINES) -I"$(PCH_FILE:D)" -I"$(INCLUDES)" -c -o "$(<:W)" "$(>:W)"
|
||||
"$(CONFIG_COMMAND)" $(LANG) -ftemplate-depth-$(TEMPLATE_DEPTH) $(OPTIONS) $(USER_OPTIONS) -D$(DEFINES) -I"$(PCH_FILE:D)" -I"$(INCLUDES)" -c -o "$(<:W)" "$(>:W)"
|
||||
}
|
||||
|
||||
actions compile.c bind PCH_FILE
|
||||
|
||||
@@ -79,10 +79,13 @@ flags qcc.compile INCLUDES <include> ;
|
||||
|
||||
flags qcc.compile OPTIONS <link>shared : -shared ;
|
||||
|
||||
flags qcc.compile.c++ TEMPLATE_DEPTH <c++-template-depth> ;
|
||||
feature.set-default c++-template-depth : 100 ;
|
||||
|
||||
|
||||
actions compile.c++
|
||||
{
|
||||
"$(CONFIG_COMMAND)" -Wc,-ftemplate-depth-100 $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -o "$(<)" "$(>)"
|
||||
"$(CONFIG_COMMAND)" -Wc,-ftemplate-depth-$(TEMPLATE_DEPTH) $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -o "$(<)" "$(>)"
|
||||
}
|
||||
|
||||
actions compile.c
|
||||
|
||||
Reference in New Issue
Block a user