/cpp_cmd
midl
/cpp_cmd C_preprocessor_command
C_preprocessor_command
Specifies the
command that invokes the C preprocessor. This command allows you to override
the default C preprocessor. By default, MIDL invokes the Microsoft C compiler
for the build environment you are using.
Examples
midl /cpp_cmd "cl386" /cpp_opt
"/E" filename.idl
midl /cpp_cmd "mycpp" /DFLAG=TRUE /Ic:\tmp
filename.idl
midl /cpp_opt "/E /DFLAG=TRUE"
filename.idl
Remarks
The /cpp_cmd
switch specifies the C-compiler preprocessor that the MIDL compiler uses to
preprocess the IDL and ACF files. When this switch is present, the C_preprocessor_command
option is required.
When the
specified C preprocessor does not direct its output to stdout, you must
specify the C compiler switch that redirects output to stdout as part of
the MIDL compiler /cpp_opt switch.
The C
preprocessor is invoked by a command string that is formed from the information
provided to the MIDL compiler /cpp_cmd, /cpp_opt, /D, /I,
and /U switches. The following table summarizes how the command string
is constructed for each combination of /cpp_cmd and /cpp_opt
switches:
/cpp_cmd
present? |
/cpp_opt
present? |
|
Yes |
Yes |
Invokes
specified C compiler with specified options. You must supply /E as
part of /cpp_opt |
Yes |
No |
Invokes
specified C compiler with settings obtained from MIDL /I, /D, /U
switches. Adds C compiler /E switch |
No |
Yes |
Invokes
Microsoft C compiler with specified options. Does not use MIDL /I, /D,
/U options. You must supply /E as part of /cpp_opt |
No |
No |
Invokes
Microsoft C compiler with /E option only |
When the /cpp_cmd
switch is not specified, the MIDL compiler invokes the Microsoft C/C++ compiler
for that environment.
When the /cpp_opt
switch is not present, the MIDL compiler concatenates the string specified by
the /cpp_cmd switch with the information specified by the MIDL /I,
/D, and /U options. The string /E is also concatenated to
the C-compiler invocation string to indicate that the C compiler should perform
preprocessing only. The MIDL compiler uses the concatenated string to invoke
the C preprocessor for each IDL and ACF source file.
When the /cpp_opt
switch is present, the MIDL compiler concatenates the string specified by the /cpp_cmd
switch with the string specified by the /cpp_opt switch. The MIDL
compiler uses the concatenated string to invoke the C preprocessor for each IDL
and ACF source file. When the /cpp_opt switch is present, neither the
MIDL compiler options specified by the /I, /D, and /U
switches nor the C compiler switch /E is concatenated with the string.
You must supply the /E option as part of the string.
See Also