Google celebrates Women's History Month. See how.

GN C++ Frontend SDK


Supported host platforms and build systems

The GN C++ Frontend SDK samples only support Linux hosts and the GN build system.

Supported Fuchsia device CPU architectures

Fuchsia devices or emulators must have one of the following CPU architectures to run Fuchsia:

  • x64
  • arm64


  1. Install required dependencies:

    sudo apt-get install curl unzip python2
  2. Clone the samples repo and submodules:

    git clone --recursive
  3. Change directory to the root of the repo and run the tests:

    cd samples

    This script:

    • Downloads additional build tool dependencies (may take 5-30 minutes)
    • Builds the samples
    • Runs tests on your host

    If the script fails with an error, address the issue and run the script again.

Testing on a Fuchsia compatible device

  1. Setup your device and install Zedboot:

    Find the instructions for your device (for example, a NUC) to setup and install Zedboot on your device.

  2. From the samples directory, create Ninja build files for the samples by running the following command:

    buildtools/linux64/gn gen out/generic-x64 --args='target_os="fuchsia" target_cpu="x64"'
  3. Build the samples by executing the Ninja build files you created in the previous step:

    buildtools/linux64/ninja -C out/generic-x64
  4. Make sure your Fuchsia device is booted to Zedboot and connected to your host machine the pave your device:

    third_party/fuchsia-sdk/bin/ --image generic-x64
  5. Start a package server from your host machine:

    third_party/fuchsia-sdk/tools/x64/fserve --image generic-x64
  6. To publish your packages open another another terminal window and run:

    third_party/fuchsia-sdk/tools/x64/fpublish out/generic-x64/hello_far.far
    third_party/fuchsia-sdk/tools/x64/fpublish out/generic-x64/rot13_server.far
    third_party/fuchsia-sdk/tools/x64/fpublish out/generic-x64/rot13_client.far
  7. Run the sample components on your Fuchsia device:

    1. SSH to the device:

    2. Once SSHed into the device, run the hello world component on the device:

      run fuchsia-pkg://
    3. Run the rot13 server:

      run fuchsia-pkg://
    4. In a new terminal window on your host machine, open a new ssh connection to your device, and run the rot13 client:

      run fuchsia-pkg://