A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://docs.microsoft.com/en-us/cpp/build/reference/cl-environment-variables below:

CL environment variables | Microsoft Learn

The CL tool uses the following environment variables:

You can set the CL or _CL_ environment variable using the following syntax:

SET CL=[ [option] ... [file] ...] [/link link-opt ...]
SET _CL_=[ [option] ... [file] ...] [/link link-opt ...]

For details on the arguments to the CL and _CL_ environment variables, see MSVC Compiler Command-Line Syntax.

You can use these environment variables to define the files and options you use most often. Then use the command line to give more files and options to CL for specific purposes. The CL and _CL_ environment variables are limited to 1024 characters (the command-line input limit).

You can't use the /D option to define a symbol that uses an equal sign (=). Instead, you can use the number sign (#) for an equal sign. In this way, you can use the CL or _CL_ environment variables to define preprocessor constants with explicit values—for example, /DDEBUG#1 to define DEBUG=1.

For more information, see Use the MSVC toolset from the command line.

Examples

The following command is an example of setting the CL environment variable:

SET CL=/Zp2 /Ox /I\INCLUDE\MYINCLS \LIB\BINMODE.OBJ

When the CL environment variable is set, if you enter CL INPUT.C at the command line, the effective command becomes:

CL /Zp2 /Ox /I\INCLUDE\MYINCLS \LIB\BINMODE.OBJ INPUT.C

The following example causes a plain CL command to compile the source files FILE1.c and FILE2.c, and then link the object files FILE1.obj, FILE2.obj, and FILE3.obj:

SET CL=FILE1.C FILE2.C
SET _CL_=FILE3.OBJ
CL

These environment variables make the call to CL have the same effect as the following command line:

CL FILE1.C FILE2.C FILE3.OBJ

See also

Setting Compiler Options
MSVC Compiler Options


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4