Merged revisions 1884-1905 via svnmerge from
[scons.git] / src / engine / SCons / Tool / msvc.xml
index 426014b139e23b6c1f73ec4c4a5072598b977b1c..b85c7aa0cf87b826beace08760a8c3f5da338f5f 100644 (file)
@@ -1,8 +1,55 @@
-<!-- __COPYRIGHT__ -->
+<!--
+__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
+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">
@@ -12,7 +59,7 @@ 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. 
+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:
@@ -29,11 +76,12 @@ 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 
+(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:
+file is scanned for implicit dependencies as though it were a C file.
+Example:
 
 <example>
 env.RES('resource.rc')
@@ -41,6 +89,55 @@ env.RES('resource.rc')
 </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
@@ -48,7 +145,8 @@ 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: 
+dependencies for the PCH file.
+Example:
 
 <example>
 env['PCH'] = 'StdAfx.pch'
@@ -67,7 +165,15 @@ builder to generated a precompiled header.
 <cvar name="PCHCOMSTR">
 <summary>
 The string displayed when generating a precompiled header.
-If this is not set, then &cv-PCHCOM; (the command line) is displayed.
+If this is not set, then &cv-link-PCHCOM; (the command line) is displayed.
+</summary>
+</cvar>
+
+<cvar name="PCHPDBFLAGS">
+<summary>
+A construction variable that, when expanded,
+adds the <literal>/yD</literal> flag to the command line
+only if the &cv-PDB; construction variable is set.
 </summary>
 </cvar>
 
@@ -88,20 +194,23 @@ env['PCHSTOP'] = 'StdAfx.h'
 
 <cvar name="RC">
 <summary>
-The resource compiler used by the RES builder.
+The resource compiler used to build
+a Microsoft Visual C++ resource file.
 </summary>
 </cvar>
 
 <cvar name="RCCOM">
 <summary>
-The command line used by the RES builder.
+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.
-If this is not set, then &cv-RCCOM; (the command line) is displayed.
+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>
 
@@ -110,3 +219,36 @@ If this is not set, then &cv-RCCOM; (the command line) is displayed.
 The flags passed to the resource compiler by the RES builder.
 </summary>
 </cvar>
+
+<cvar name="RCINCFLAGS">
+<summary>
+An automatically-generated construction variable
+containing the command-line options
+for specifying directories to be searched
+by the resource compiler.
+The value of &cv-RCINCFLAGS; is created
+by appending &cv-RCINCPREFIX; and &cv-RCINCSUFFIX;
+to the beginning and end
+of each directory in &cv-CPPPATH;.
+</summary>
+</cvar>
+
+<cvar name="RCINCPREFIX">
+<summary>
+The prefix (flag) used to specify an include directory
+on the resource compiler command line.
+This will be appended to the beginning of each directory
+in the &cv-CPPPATH; construction variable
+when the &cv-RCINCFLAGS; variable is expanded.
+</summary>
+</cvar>
+
+<cvar name="RCINCSUFFIX">
+<summary>
+The suffix used to specify an include directory
+on the resource compiler command line.
+This will be appended to the end of each directory
+in the &cv-CPPPATH; construction variable
+when the &cv-RCINCFLAGS; variable is expanded.
+</summary>
+</cvar>