top

Building NaCl Projects

This topic describes how to build a Native Client project in the Tizen Studio.

A Native Client (NaCl) project can be built using the "Debug" or "Release" configurations:

  • When you build using the "Debug" configuration, executable files are generated for all supported architectures (i686, x86_64, and ARMv7) and contain debug symbols.
  • When you build using the "Release" configuration, you can select the architecture to generate the executable file for, without debug symbols.

Basics of Building

To build a NaCl project:

  1. Select a build configuration.
    In the "Project Explorer" view, right-click the project, select "Build Configurations > Set Active", and select the configuration you want.
    The "Debug" configuration is active by default.

    Figure 1. Select build configuration

    Figure 1. Select build configuration

  2. In the "Project Explorer" view, right-click the project and select "Build project".

    Figure 2. Build project

    Figure 2. Build project

In the "Console" view, you can monitor the build progress and status.

Figure 3. Build console

Figure 3. Build console

The build result is located in the "CurrentBin" directory inside the main project directory. This directory is actually a symbolic link to the build directory for the current configuration ("Debug" or "Release").

Figure 4. Build result

Figure 4. Build result

The build process produces the following files:

  • The Portable NaCl executable file (".pexe") contains the NaCl executable code built from the C or C++ source code, independent of the target architecture.
  • NaCl executable files (".nexe") contain the native NaCl executable code for the target architecture. They are translated from the ".pexe" file and listed in the manifest file.
  • The NaCl manifest file (".nmf") contains paths to the ".nexe" files for the supported architectures. The Web browser uses the manifest file to find the appropriate ".nexe" file. In Tizen applications, the manifest file also contains a list of application permissions needed to load the NaCl module.
    Note

    The ".pexe" file is not listed in the manifest file, since it is only supported by the Google Chrome™ browser.

Customizing Build Configurations

To customize a build configuration:

  1. In the "Project Explorer" view, right-click the project and select "Properties > C/C++ Build > Settings".

    Figure 5. Build configuration properties

    Figure 5. Build configuration properties

  2. From the "Configuration" drop-down menu, select the configuration you want to modify.

  3. Modify the desired settings.
    For each tool, you can change the command name and its options.

    Note

    Change the settings with caution, as they can cause the build system to break.

    You can configure the following tools:

    • NaCl Compiler
      • "Includes" specifies the include paths to be passed to the compiler command.
      • "Preprocessor" specifies the defined and undefined preprocessor symbols.
      • "Miscellaneous" specifies other command parameters to be passed to the compiler.
      • "Optimization" defines the optimization level.
    • NaCl Linker
      • "Libraries" specifies the library search paths and library names to be passed to the linker command.
      • "Miscellaneous" specifies other command parameters to be passed to the linker.
    • NaCl Translator
      • "Architecture" defines the architecture to generate the ".nexe" file for. This setting is only available in the "Release" configuration.
      • "Miscellaneous" specifies other command parameters to be passed to the translator.
    • NaCl Manifest Generator specifies the manifest file generation command.
  4. To save the settings, click "OK".