4 This file is processed by the bin/SConsDoc.py module.
5 See its __doc__ string for a discussion of the format.
9 Sets construction variables for the Microsoft Visual C/C++ compiler.
33 <!--STATIC_AND_SHARED_OBJECTS_ARE_THE_SAME-->
60 Builds a Microsoft Visual C++ precompiled header.
61 Calling this builder method
62 returns a list of two targets: the PCH as the first element, and the object
63 file as the second element. Normally the object file is ignored.
64 This builder method is only
65 provided when Microsoft Visual C++ is being used as the compiler.
66 The PCH builder method is generally used in
67 conjuction with the PCH construction variable to force object files to use
68 the precompiled header:
71 env['PCH'] = env.PCH('StdAfx.cpp')[0]
78 Builds a Microsoft Visual C++ resource file.
79 This builder method is only provided
80 when Microsoft Visual C++ or MinGW is being used as the compiler. The
81 <filename>.res</filename>
83 <filename>.o</filename>
84 for MinGW) suffix is added to the target name if no other suffix is given.
86 file is scanned for implicit dependencies as though it were a C file.
90 env.RES('resource.rc')
95 <cvar name="CCPCHFLAGS">
97 Options added to the compiler command line
98 to support building with precompiled headers.
99 The default value expands expands to the appropriate
100 Microsoft Visual C++ command-line options
101 when the &cv-link-PCH; construction variable is set.
105 <cvar name="CCPDBFLAGS">
107 Options added to the compiler command line
108 to support storing debugging information in a
109 Microsoft Visual C++ PDB file.
110 The default value expands expands to appropriate
111 Microsoft Visual C++ command-line options
112 when the &cv-link-PDB; construction variable is set.
114 The Visual C++ compiler option that SCons uses by default
115 to generate PDB information is <option>/Z7</option>.
116 This works correctly with parallel (<option>-j</option>) builds
117 because it embeds the debug information in the intermediate object files,
118 as opposed to sharing a single PDB file between multiple object files.
119 This is also the only way to get debug information
120 embedded into a static library.
121 Using the <option>/Zi</option> instead may yield improved
122 link-time performance,
123 although parallel builds will no longer work.
125 You can generate PDB files with the <option>/Zi</option>
126 switch by overriding the default &cv-link-CCPDBFLAGS; variable as follows:
129 env['CCPDBFLAGS'] = ['${(PDB and "/Zi /Fd%s" % File(PDB)) or ""}']
132 An alternative would be to use the <option>/Zi</option>
133 to put the debugging information in a separate <filename>.pdb</filename>
134 file for each object file by overriding
135 the &cv-link-CCPDBFLAGS; variable as follows:
138 env['CCPDBFLAGS'] = '/Zi /Fd${TARGET}.pdb'
143 <cvar name="MSVC_BATCH">
145 When set to any true value,
146 specifies that &SCons; should batch
147 compilation of object files
148 when calling the Microsoft Visual C/C++ compiler.
149 All compilations of source files from the same source directory
150 that generate target files in a same output directory
151 and were configured in &SCons; using the same construction environment
152 will be built in a single call to the compiler.
153 Only source files that have changed since their
154 object files were built will be passed to each compiler invocation
155 (via the &cv-link-CHANGED_SOURCES; construction variable).
156 Any compilations where the object (target) file base name
157 (minus the <filename>.obj</filename>)
158 does not match the source file base name
159 will be compiled separately.
165 The Microsoft Visual C++ precompiled header that will be used when compiling
166 object files. This variable is ignored by tools other than Microsoft Visual C++.
167 When this variable is
168 defined SCons will add options to the compiler command line to
169 cause it to use the precompiled header, and will also set up the
170 dependencies for the PCH file.
174 env['PCH'] = 'StdAfx.pch'
181 The command line used by the
183 builder to generated a precompiled header.
187 <cvar name="PCHCOMSTR">
189 The string displayed when generating a precompiled header.
190 If this is not set, then &cv-link-PCHCOM; (the command line) is displayed.
194 <cvar name="PCHPDBFLAGS">
196 A construction variable that, when expanded,
197 adds the <literal>/yD</literal> flag to the command line
198 only if the &cv-PDB; construction variable is set.
202 <cvar name="PCHSTOP">
204 This variable specifies how much of a source file is precompiled. This
205 variable is ignored by tools other than Microsoft Visual C++, or when
206 the PCH variable is not being used. When this variable is define it
207 must be a string that is the name of the header that
208 is included at the end of the precompiled portion of the source files, or
209 the empty string if the "#pragma hrdstop" construct is being used:
212 env['PCHSTOP'] = 'StdAfx.h'
219 The resource compiler used to build
220 a Microsoft Visual C++ resource file.
226 The command line used to build
227 a Microsoft Visual C++ resource file.
231 <cvar name="RCCOMSTR">
233 The string displayed when invoking the resource compiler
234 to build a Microsoft Visual C++ resource file.
235 If this is not set, then &cv-link-RCCOM; (the command line) is displayed.
239 <cvar name="RCFLAGS">
241 The flags passed to the resource compiler by the RES builder.
245 <cvar name="RCINCFLAGS">
247 An automatically-generated construction variable
248 containing the command-line options
249 for specifying directories to be searched
250 by the resource compiler.
251 The value of &cv-RCINCFLAGS; is created
252 by appending &cv-RCINCPREFIX; and &cv-RCINCSUFFIX;
253 to the beginning and end
254 of each directory in &cv-CPPPATH;.
258 <cvar name="RCINCPREFIX">
260 The prefix (flag) used to specify an include directory
261 on the resource compiler command line.
262 This will be appended to the beginning of each directory
263 in the &cv-CPPPATH; construction variable
264 when the &cv-RCINCFLAGS; variable is expanded.
268 <cvar name="RCINCSUFFIX">
270 The suffix used to specify an include directory
271 on the resource compiler command line.
272 This will be appended to the end of each directory
273 in the &cv-CPPPATH; construction variable
274 when the &cv-RCINCFLAGS; variable is expanded.
278 <cvar name="MSVC_VERSION">
280 Sets the preferred version of Microsoft Visual C/C++ to use.
282 If &cv-MSVC_VERSION; is not set,
283 &SCons; will (by default) select the latest version
284 of Visual C/C++ installed on your system.
285 If the specified version isn't installed,
286 tool initialization will fail.