Search notes:

cl options

/c to compile without linking object files.
cl /D to define a preprocessor macro.
/d1 and /d2 to forward specific options to the frontend and backend.
/F… to specify options for output files.
/Gm: minimal rebuild (deprecated).
/GS: insert code (cookies) to detect alterations of the return address
/Gs: set the threshold for stack probes.
/nologo
/E, /P or /EP to preprocess only.
/O… to control how the generated code is optimized.
/T… to specify the language (C or C++) of the compilation unit.
/utf-8
/W… to control the level of warnings emitted when compiling. Specific warnings can be suppresed or treated as errors or put into another warning level with the /w (lowercase) option.
/Zl
/Z7, /Zi, /ZI to set up the created code for debugging.
/Zi and /ZI create symbol (.pdb) files (/ZI is like /Zi but with additional support for edit and continue).
/Za disables all Microsoft specific extensions to C++. This option is therefore recommended for compiling code that is intended to run on other platforms, too.
B… options such as /B1 or /Bd.

Environment variables and command files

The content of the environment variables CL and CL_ are automatically used as options when cl is invoked.
Additionally, a command file that contains options can be specified by prepending the file's name with @ when cl is invoked:
cl @opts

See also

cl

Links

Lectem's list of hidden flags.

Index