2.4.6. Variants

You can use variants to create different versions of your project output from the same source files. Typically you use variants to create a debug-release version, or separate debug and release versions of your project output.

You can change variant level variables to control how the project output for the variant is built. The derived files for each variant, such as object files and project output, are created in a subdirectory of the project directory. You specify the project directory when you create the project.

Note

You cannot add a source file to only one variant of your project.

Adding a new variant to a project

Follow these steps to add a new variant to your project template:

  1. Select Add Variant from the Project menu. The Add Variant dialog is displayed (Figure 2.10).

    Figure 2.10. Add Variant dialog

    Add Variant dialog
  2. Select a variant from the Add Variant Like list. The files and variable values from the original are assigned to the new template.

  3. Enter a new variant name. The variant name cannot contain spaces.

  4. Click OK.

Building selected variants

Follow these steps to build a variant or variants:

  1. Select Build Variants from the Project menu. The Build Variants dialog is displayed (Figure 2.11).

    Figure 2.11. Build Variants dialog

    Build Variants dialog
  2. Select one or more variants from the Select Variants to build box.

  3. If you want to force build the selected variants, check Force build regardless of timestamps.

  4. Click OK to initiate the build.

Copyright © 1997, 1998 ARM Limited. All rights reserved.ARM DUI 0040D
Non-Confidential