<commit_before><!--
__COPYRIGHT__

This file is processed by the bin/SConsDoc.py module.
See its __doc__ string for a discussion of the format.
-->
<tool name="msvc">
<summary>
Sets construction variables for the Microsoft Visual C/C++ compiler.
</summary>
<sets>
CCPDBFLAGS
CCPCHFLAGS
<!--CCCOMFLAGS-->
CC
CCFLAGS
CFLAGS
CCCOM
SHCC
SHCCFLAGS
SHCFLAGS
SHCCCOM
CXX
CXXFLAGS
CXXCOM
SHCXX
SHCXXFLAGS
SHCXXCOM
CPPDEFPREFIX
CPPDEFSUFFIX
INCPREFIX
INCSUFFIX
<!--STATIC_AND_SHARED_OBJECTS_ARE_THE_SAME-->
RC
RCFLAGS
RCCOM
BUILDERS
OBJPREFIX
OBJSUFFIX
SHOBJPREFIX
SHOBJSUFFIX
CFILESUFFIX
CXXFILESUFFIX
PCHPDBFLAGS
PCHCOM
</sets>
<uses>
CCCOMSTR
SHCCCOMSTR
CXXCOMSTR
SHCXXCOMSTR
</uses>
</tool>

<builder name="PCH">
<summary>
Builds a Microsoft Visual C++ precompiled header.
Calling this builder method
returns a list of two targets: the PCH as the first element, and the object
file as the second element. Normally the object file is ignored.
This builder method is only
provided when Microsoft Visual C++ is being used as the compiler.
The PCH builder method is generally used in
conjuction with the PCH construction variable to force object files to use
the precompiled header:

<example>
env['PCH'] = env.PCH('StdAfx.cpp')[0]
</example>
</summary>
</builder>

<builder name="RES">
<summary>
Builds a Microsoft Visual C++ resource file.
This builder method is only provided
when Microsoft Visual C++ or MinGW is being used as the compiler. The
<filename>.res</filename>
(or
<filename>.o</filename>
for MinGW) suffix is added to the target name if no other suffix is given.
The source
file is scanned for implicit dependencies as though it were a C file.
Example:

<example>
env.RES('resource.rc')
</example>
</summary>
</builder>

<cvar name="CCPCHFLAGS">
<summary>
Options added to the compiler command line
to support building with precompiled headers.
The default value expands expands to the appropriate
Microsoft Visual C++ command-line options
when the &cv-link-PCH; construction variable is set.
</summary>
</cvar>

<cvar name="CCPDBFLAGS">
<summary>
Options added to the compiler command line
to support storing debugging information in a
Microsoft Visual C++ PDB file.
The default value expands expands to appropriate
Microsoft Visual C++ command-line options
when the &cv-link-PDB; construction variable is set.

The Visual C++ compiler option that SCons uses by default
to generate PDB information is <option>/Z7</option>.
This works correctly with parallel (<option>-j</option>) builds
because it embeds the debug information in the intermediate object files,
as opposed to sharing a single PDB file between multiple object files.
This is also the only way to get debug information
embedded into a static library.
Using the <option>/Zi</option> instead may yield improved
link-time performance,
although parallel builds will no longer work.

You can generate PDB files with the <option>/Zi</option>
switch by overriding the default &cv-link-CCPDBFLAGS; variable as follows:

<example>
import SCons.Util
env['CCPDBFLAGS'] = SCons.Util.CLVar(['${(PDB and "/Zi /Fd%s" % File(PDB)) or ""}'])
</example>

An alternative would be to use the <option>/Zi</option>
to put the debugging information in a separate <filename>.pdb</filename>
file for each object file by overriding
the &cv-link-CCPDBFLAGS; variable as follows:

<example>
env['CCPDBFLAGS'] = '/Zi /Fd${TARGET}.pdb'
</example>
</summary>
</cvar>

<cvar name="PCH">
<summary>
The Microsoft Visual C++ precompiled header that will be used when compiling
object files. This variable is ignored by tools other than Microsoft Visual C++.
When this variable is
defined SCons will add options to the compiler command line to
cause it to use the precompiled header, and will also set up the
dependencies for the PCH file.
Example:

<example>
env['PCH'] = 'StdAfx.pch'
</example>
</summary>
</cvar>
<commit_msg>Issue 1853:  Remove referenc to SCons.Util.CLVar from a doc example.<commit_after><!--
__COPYRIGHT__

This file is processed by the bin/SConsDoc.py module.
See its __doc__ string for a discussion of the format.
-->
<tool name="msvc">
<summary>
Sets construction variables for the Microsoft Visual C/C++ compiler.
</summary>
<sets>
CCPDBFLAGS
CCPCHFLAGS
<!--CCCOMFLAGS-->
CC
CCFLAGS
CFLAGS
CCCOM
SHCC
SHCCFLAGS
SHCFLAGS
SHCCCOM
CXX
CXXFLAGS
CXXCOM
SHCXX
SHCXXFLAGS
SHCXXCOM
CPPDEFPREFIX
CPPDEFSUFFIX
INCPREFIX
INCSUFFIX
<!--STATIC_AND_SHARED_OBJECTS_ARE_THE_SAME-->
RC
RCFLAGS
RCCOM
BUILDERS
OBJPREFIX
OBJSUFFIX
SHOBJPREFIX
SHOBJSUFFIX
CFILESUFFIX
CXXFILESUFFIX
PCHPDBFLAGS
PCHCOM
</sets>
<uses>
CCCOMSTR
SHCCCOMSTR
CXXCOMSTR
SHCXXCOMSTR
</uses>
</tool>

<builder name="PCH">
<summary>
Builds a Microsoft Visual C++ precompiled header.
Calling this builder method
returns a list of two targets: the PCH as the first element, and the object
file as the second element. Normally the object file is ignored.
This builder method is only
provided when Microsoft Visual C++ is being used as the compiler.
The PCH builder method is generally used in
conjuction with the PCH construction variable to force object files to use
the precompiled header:

<example>
env['PCH'] = env.PCH('StdAfx.cpp')[0]
</example>
</summary>
</builder>

<builder name="RES">
<summary>
Builds a Microsoft Visual C++ resource file.
This builder method is only provided
when Microsoft Visual C++ or MinGW is being used as the compiler. The
<filename>.res</filename>
(or
<filename>.o</filename>
for MinGW) suffix is added to the target name if no other suffix is given.
The source
file is scanned for implicit dependencies as though it were a C file.
Example:

<example>
env.RES('resource.rc')
</example>
</summary>
</builder>

<cvar name="CCPCHFLAGS">
<summary>
Options added to the compiler command line
to support building with precompiled headers.
The default value expands expands to the appropriate
Microsoft Visual C++ command-line options
when the &cv-link-PCH; construction variable is set.
</summary>
</cvar>

<cvar name="CCPDBFLAGS">
<summary>
Options added to the compiler command line
to support storing debugging information in a
Microsoft Visual C++ PDB file.
The default value expands expands to appropriate
Microsoft Visual C++ command-line options
when the &cv-link-PDB; construction variable is set.

The Visual C++ compiler option that SCons uses by default
to generate PDB information is <option>/Z7</option>.
This works correctly with parallel (<option>-j</option>) builds
because it embeds the debug information in the intermediate object files,
as opposed to sharing a single PDB file between multiple object files.
This is also the only way to get debug information
embedded into a static library.
Using the <option>/Zi</option> instead may yield improved
link-time performance,
although parallel builds will no longer work.

You can generate PDB files with the <option>/Zi</option>
switch by overriding the default &cv-link-CCPDBFLAGS; variable as follows:

<example>
env['CCPDBFLAGS'] = ['${(PDB and "/Zi /Fd%s" % File(PDB)) or ""}']
</example>

An alternative would be to use the <option>/Zi</option>
to put the debugging information in a separate <filename>.pdb</filename>
file for each object file by overriding
the &cv-link-CCPDBFLAGS; variable as follows:

<example>
env['CCPDBFLAGS'] = '/Zi /Fd${TARGET}.pdb'
</example>
</summary>
</cvar>

<cvar name="PCH">
<summary>
The Microsoft Visual C++ precompiled header that will be used when compiling
object files. This variable is ignored by tools other than Microsoft Visual C++.
When this variable is
defined SCons will add options to the compiler command line to
cause it to use the precompiled header, and will also set up the
dependencies for the PCH file.
Example:

<example>
env['PCH'] = 'StdAfx.pch'
</example>
</summary>
</cvar>

{'fraction_non_alphanumeric': 0.08612007746933506, 'fraction_numerical': 0.0010329244673983216, 'mean_word_length': 5.065779169929522, 'pattern_counts': {'":': 0, '<': 117, '<?xml version=': 0, '>': 117, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1185438', 'n_tokens_mistral': 2379, 'n_tokens_neox': 2292, 'n_words': 1041}