Miscellaneous Environment Variables (Compact 2013)

3/26/2014

The following table contains miscellaneous environment variables that you can use when designing your OS.

Environment variable

Description

BUILD_MULTIPROCESSOR

Used by Build.exe in the Platform Builder user interface.

Specifies the number of threads started concurrently when you run a build. This number can be greater than or fewer than the number of processors on the development computer.

  • If you set this variable to 1, Platform Builder disables multithreaded build and uses only one child thread to run a build.
  • If you set this variable to N, where N is greater than 1, Platform Builder runs Build.exe in multithreaded mode, using N child threads.
  • If you set this variable to 0 (the default setting), then Platform Builder automatically detects the number of processors on the development computer and runs Build.exe in multithreaded mode. Platform Builder determines the optimum number of child threads based on the number of processors, the amount of RAM, and disk performance on the development computer.
  • If you do not set a value for this variable, Platform Builder starts only one child thread to run a build (so that two threads total are needed).

The optimal setting reduces the time Platform Builder requires to complete a build.

Ee479008.note(en-us,WinEmbedded.80).gifNote:
The Build.exe command-line argument -M overrides BUILD_MULTIPROCESSOR if the environment variable is set. For more information, see Build Tool (Build.exe).

If you set this environment variable and you need more information about synchronizing multiple build threads, see <BuildPassName>_PRODUCES and <BuildPassName>_CONSUMES.

BUILDREL_USE_COPY

Used by BuildRel.bat when it copies files into the flat release directory. By default, BuildRel.bat uses copylink to copy files. However, a sharing violation can occur if another program is using the file that you are linking to. If you experience a sharing violation during the copy phase, you can set this variable to 1to instruct BuildRel.bat to use xcopy. This workaround may slow the performance of the copy operation.

BUILDWARNISERROR

Tells Build.exe to treat warnings as errors. Examples of these warnings include those that occur when Build.exe receives an invalid parameter or when it reads sources and dirs files.

When BUILDWARNISERROR is set to 1 in a sources or Sources.cmn file, Build.exe exits after a warning is generated.

You can set this environment variable globally in a Sources.cmn file and unset it locally in a sources file.

LOCALE

Used by Makeimg.exe. Defines the target locale for localizing the build environment.

PBCONFIG

Defines the combination of build support package (BSP) and debug or release settings for the current build.

RI_SUPPRESS_INFO

Tells Romimage.exe to limit output to a list of errors and the completion list.

In the Platform Builder output window, on the Build tab, set RI_SUPPRESS_INFO to All.

_TGTCPUFAMILY

Defines the CPU family for a BSP.

_TGTPLAT

Defines the name of the BSP.

WINCEDEBUG

Determines whether debugging information is generated in object files. Set to retail or debug.

Ee479008.note(en-us,WinEmbedded.80).gifNote:
This environment variable is case sensitive.

Retail (WINCEDEBUG=retail)

  • Does not generate debugging information in object files; object files are put in the Release directory.
  • Because this setting enables compiler optimization, it is not recommended for use with the debugger. The debugger could highlight the wrong source line if the compiler rearranges code.
  • The default setting.

Debug (WINCEDEBUG=debug)

  • Generates debugging information in object files; object files are put in the Debug directory.
  • Compiler optimizations are disabled.

WINCEREL

Used by Build.exe.

Set (WINCEREL=1)

  • Copies the built components to the %_FLATRELEASEDIR% directory.
  • When a build is set up you can make incremental changes, rebuild a component, and make a new runtime image without rerunning the Build Release Directory tool, Buildrel.bat.
  • The recommended setting.

Not set (WINCEREL=)

  • Copies the built components to the Public directory.
  • The default setting.

WINCESHIP

Specifies whether this build is for shipping or testing. This is available only in release configurations and is hidden in debug configurations.

Set (WINCESHIP=1)

  • The OS does not generate debug messages.
  • The compile time flag -DSHIP_BUILD can be used to conditionally compile code.

Not set (WINCESHIP=)

  • The OS generates verbose debug messages to aid final testing.

ENABLE_OPTIMIZER

Used to override the default optimization mode of the compiler in either DEBUG or RETAIL compilations.

If you compile with WINCEDEBUG set to retail, the default optimization mode is enabled. You can disable by using the command set ENABLE_OPTIMIZER=0. This lets you create code that is easier to debug while keeping the other effects of setting WINCEDEBUG to retail, such as the removal of DEBUG and ASSERT messages.

If you compile with WINCEDEBUG set to debug, the default optimization mode is disabled. You can enable optimization by using the command setENABLE_OPTIMIZER=1. Because this reduces the size of the runtime image, it may be useful during the development process when you must have the error-tracking benefits of DEBUG and ASSERT messages on a device with limited ROM.

_WINCEOSVER

Defines the OS version that is set in wince.bat. The default value is 800.

__LOCLANGIDLIST

A list of locale identifiers (identifiers with data type LCID), which determine the languages for which Build.exe builds localized versions.

_IMAGELANGIDLIST

Determines the list of LCIDs for the Multilingual User Interface (MUI) resources that are included in the runtime image. This corresponds to the LCIDs provided in __LOCLANGIDLIST.

_IMAGELANGIDBOOT

An LCID that determines the default UI language when the system boots and the current UI language. This LCID must be contained in the _IMAGELANGIDLIST.

LOCALE

Sets the default user interface (UI) language to use when the device boots.

DEFAULT_LOCALE

Sets the system default locale. The value of this variable is a locale name (for example, DEFAULT_LOCALE=zh-CN). For a list of locale names, see National/Regional Language Support (NLS) Catalog Items and Sysgen Variables.

The following table contains miscellaneous environment variables that you can use to specify directory paths. Many of these variables are set in wince.bat.

Environment variable

Description

_WINCEROOT

Defines the root directory.

If you have sufficient space for the OS on a single partition, create a root directory on that partition such as C:\WINCE800, and install the OS under it.

To do this, set %_WINCEROOT% to the full root directory path.

_FLATRELEASEDIR

Defines the directory where the released source code and binary files are saved.

The default is %PBWORKSPACEROOT%\RelDir\%_TGTPLAT%_%_TGTCPUFAMILY%(_Release, _Debug or _Checked).

_OSDESIGNDDKROOT

Defines the location of the OEM Adaptation Kit (OAK) directory for your project. Windows Embedded Compact 7 users should use this environment variable instead of the _PROJECTDDKROOT variable.

During the build process, Build.exe saves the files that it builds to this directory.

The default is %_PROJECTROOT%\DDK.

_OSDESIGNOAKROOT

Defines the location of the OEM Adaptation Kit (OAK) directory for your project. Windows Embedded Compact 2013 users should use this environment variable instead of the _PROJECTOAKROOT variable.

During the build process, Build.exe saves the files that it builds to this directory.

The default is %_PROJECTROOT%\OAK.

_OSDESIGNSDKROOT

Defines the location of the OEM Adaptation Kit (OAK) directory for your project. Windows Embedded Compact 7 users should use this environment variable instead of the _PROJECTSDKROOT variable.

During the build process, Build.exe saves the files that it builds to this directory.

The default is %_PROJECTROOT%\SDK.

PBWORKSPACEROOT

Defines the location of the Platform Builder workspace for the current project.

The default is %_WINCEROOT%\OSDesigns\<Project_Name>\<Project_Name>.

However, if your root directory is in a location other than the default, that location is used as the definition for %PBWORKSPACEROOT%.

_PLATFORMROOT

Defines the location of the platform directory.

The default is %_WINCEROOT%\Platform.

_PRIVATEROOT

Defines the location of another root directory, such as a directory to private code. The default is %_WINCEROOT%\Private.

_PROJECTOAKROOT

Defines the location of the OEM Adaptation Kit (OAK) directory for your project. Windows Embedded Compact 2013 users should use the environment variable _OSDESIGNOAKROOT instead of this variable.

During the build process, Build.exe saves the files that it builds to this directory.

The default is %_PROJECTROOT%\OAK.

_PROJECTROOT

Defines the location of the project that you are building. The default is %_WINCEROOT%\Public\CEBASE.

_PUBLICROOT

Defines the location of public projects.

The default is %_WINCEROOT%\Public.

_SDKROOT

Defines the location of the tools that you use to build projects, such as the command-line compiler, linker, debugger, and runtime libraries.

The default is %_WINCEROOT%\SDK.

_TGTPROJ

Always set to "cebase". Do not change the value of this environment variable.

SG_OUTPUT_ROOT

Defines the location to which SYSGEN output is directed during the build process for an OS design that uses a specific BSP.

By default, this environment variable is set in wince.bat to: %_PROJECTROOT%\Cesysgen\TGTPLAT%_%CPU%.

However, the value can be overridden. For example, in a build window opened from the IDE, the value is set to: %_OSDESIGNROOT%\WINCE800\%TGTPLAT%_%CPU%_%WINCEDEBUG%\cesysgen.

See Also

Reference

BSP Environment Variables
PRJ Environment Variables
IMG Environment Variables

Other Resources

Environment Variables