summaryrefslogtreecommitdiff
path: root/src/engine/SCons/Tool/msvc.xml
blob: 0ea260269014118dc7fa4abd5a3209d9589c0440 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
<!--
__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>
XXX
</summary>
</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>

<cvar name="PCHCOM">
<summary>
The command line used by the
&b-PCH;
builder to generated a precompiled header.
</summary>
</cvar>

<cvar name="PCHCOMSTR">
<summary>
The string displayed when generating a precompiled header.
If this is not set, then &cv-link-PCHCOM; (the command line) is displayed.
</summary>
</cvar>

<cvar name="PCHSTOP">
<summary>
This variable specifies how much of a source file is precompiled. This
variable is ignored by tools other than Microsoft Visual C++, or when
the PCH variable is not being used. When this variable is define it
must be a string that is the name of the header that
is included at the end of the precompiled portion of the source files, or
the empty string if the "#pragma hrdstop" construct is being used:

<example>
env['PCHSTOP'] = 'StdAfx.h'
</example>
</summary>
</cvar>

<cvar name="RC">
<summary>
The resource compiler used to build
a Microsoft Visual C++ resource file.
</summary>
</cvar>

<cvar name="RCCOM">
<summary>
The command line used to build
a Microsoft Visual C++ resource file.
</summary>
</cvar>

<cvar name="RCCOMSTR">
<summary>
The string displayed when invoking the resource compiler
to build a Microsoft Visual C++ resource file.
If this is not set, then &cv-link-RCCOM; (the command line) is displayed.
</summary>
</cvar>

<cvar name="RCFLAGS">
<summary>
The flags passed to the resource compiler by the RES builder.
</summary>
</cvar>