Building & Running#

Building and Running#

../_images/pvrstudio-buildingrunning.png

PVRStudio provides support for running and deploying applications built for different target platforms, or using different compilers and debuggers. Kits <glossary-buildandrun-kit> define the tools, device <glossary-device> type and other settings to use when building and running your project.

  • Building for Multiple Platforms

    Build configurations contain everything you need to compile the sources into binaries. Build configurations use the tools and settings defined in their corresponding kit.

  • Running on Multiple Platforms

    Run configurations start the application in the location where it was copied by the deploy configuration. By default, when you select the Run function, PVRStudio builds the project, deploys it to the device defined in the kit, and runs it there. However, if you have not made any changes to the project since you last built and deployed it, PVRStudio simply runs it again.

  • Deploying to Devices

    Deploy configurations handle the packaging and copying of the necessary files to a location you want to run the executable at. The files can be copied to a location in the file system of the development PC or a device.

  • Connecting Devices

    When you install tool chains for device types, the build and run settings for the devices might be set up automatically. However, you might need to install and configure some additional software on the devices to be able to connect to them from the development PC.

  • Customizing the Build Process

    By default, running an application also builds it and deploys it to a location from where it can be run on the device. You can change the relationship between the build, run, and deploy configurations.

Building for Multiple Platforms#

You can build applications for multiple target platforms, or using different compilers or debuggers. Kits define the tools, device type and other settings to use.

By default, when you run the application, you automatically build and deploy it first. However, you can also perform each operation separately.

To check that the application code can be compiled and linked for a device, you can build the project. The build errors and warnings are displayed in the Issues output pane. More detailed information is displayed in the Compile Output pane.

To build an application:

  1. Click the Kit Selector pulldown or select Build > Open Build and Run Kit Selector to select the build and run kit.

    "Kit selector"
  2. Choose Build > Build Project or press Ctrl+B.

    You can also select the Run button to also deploy and run the application after building it.

While the application is being built, the Build button changes to a Cancel Build button. To cancel the build, select the button or press Alt+Backspace.

For more information on the options you have, see Specifying Build Settings.

To quickly check the compile output for changes that you made in one file or subproject, you can use the Build menu commands to build a file or subproject.

To remove all build artifacts, select Build > Clean All or Clean Project.

To build and clean projects without dependencies, select the Build Without Dependencies, Rebuild Without Dependencies, and Clean Without Dependencies options in the context menu in the Projects view.

Running on Multiple Platforms#

By default, running an application also builds it and deploys it to a location from where it can be run on the desktop, on a device emulator or simulator, or on a device that is connected to the development PC.

To run executable files without deploying them first, select Build > Run Without Deployment. To make this the default option, deselect the Tools > Options > Project > Always deploy project before running it option.

To run applications:

  1. Click the Kit Selector pulldown or select Build > Open Build and Run Kit Selector to select the build and run kit.

    "Kit selector"
  2. Click the Run button.

The Application Output pane displays the status of the application while it is running. You can select the Run button in the pane to re-run applications without building them first. Therefore, the application does not need to be built again if you edited only run-time dependent files. This saves time especially if the application contains large image files that would need to be bundled into the resource file before running the application.

../_images/pvrstudio-application-output.png

For more information on the options you have, see Specifying Run Settings.

Running on Embedded Linux Devices

To build the application and run it on a device:

  1. Specify a connection to the device. For more information, see Connecting Embedded Linux Devices.

  2. Click the Run button.

PVRStudio uses the compiler specified in the project build settings (tool chain) to build the application.

PVRStudio copies the application files to the connected device and runs the application. The application views are displayed on the device. Command-line output is visible in the PVRStudio Application Output view.

Choose Projects > Embedded Linux > Run to view the settings for deploying the application to the connected device. For more information, see Specifying Run Settings for Linux-Based Devices. Debugging works transparently if GDB server is installed on the device and it is compatible with the GDB on the host.

Customizing the Build Process#

To specify the relationship between the release, build, and deploy configurations, select Tools > Options > Build & Run. By default, the Always build project before deploying it and the Always deploy project before running it options (1) are enabled. Therefore, when you select the Run function, PVRStudio checks for changes in the project files and also builds and deploys the project if necessary.

"Project General Options"

On Windows, you can use jom instead of nmake for building the project to distribute the compilation process to multiple CPU cores. You can download jom from Qt Downloads. To use jom, select the Use jom instead of nmake check box. Deselect the check box if you experience build problems.

You can specify the default build directory in the Default build directory field using PVRStudio variables (2).