---
title: "SDK applications"
---

# SDK applications

Installed Yocto, Wind River and vendor SDKs found on the build hosts and the laptop, applications configured and built with them from the laptop's working copy, and clangd with the SDK's sysroot.

Applications built outside BitBake (with CMake, Meson or make) use the image's SDK. The source can stay in a working copy on the laptop: its changed files are sent to the build host before each configure or build, and problems are shown on the laptop's files.

**State:** modelled with a stand-in SDK in OE-Core scarthgap's documented layout (an aarch64 GCC 13.3.0), CMake 3.28.3, ninja 1.11.1, OpenSSH 9.6p1 and clangd 18.1.3: the SDK found by sourcing, an application sent, configured and built to an AArch64 ELF, a planted error on the laptop's file, clangd over SSH resolving a header from the sysroot, and the running app. Not run with a real Yocto, Wind River or vendor SDK installer, on Windows (`ssh.exe`, path mappings with drive letters), against a remote build server, with Meson and make on real tools, or at realistic size. In one lab run clangd resolved a kernel header in the extracted compiler's own folder rather than the stand-in sysroot; it is to be run again against a real SDK. With the Embedded module also on, two clangd clients serve C and C++ files.

## Installed SDKs

SDKs are found by their `environment-setup-*` scripts on the build hosts and this machine: `/opt` and the home folder are always searched, plus the folders in `neuralInverse.embeddedLinux.sdkDirectories`. Each is sourced in a subshell to read its sysroots, `CC` and `CXX` with `--sysroot`, flags, `OEToolchainConfig.cmake`, the Meson cross file and the product. An extensible SDK is recognised from its `devtool.conf`. **Show Installed SDKs** lists them with GCC version and sysroot and opens an environment script.

## Declare the application

```json
{
  "neuralInverse.embeddedLinux.applications": [
    {
      "name": "can-routerd",
      "host": "build",
      "sdk": "/opt/poky/5.0.13/environment-setup-cortexa53-crypto-poky-linux",
      "sourceDirectory": "~/src/can-routerd",
      "localFolder": "<the working copy on this machine>"
    }
  ]
}
```

| Field | Meaning |
|---|---|
| `name` | The application's name; unique in the workspace |
| `host` | The build host where the SDK is installed; leave out for an SDK on this machine |
| `sdk` | The SDK's environment script on that machine |
| `sourceDirectory` | The source folder on that machine |
| `buildDirectory` | The build folder; `build-<target system>` in the source folder when unset |
| `localFolder` | The working copy on this machine, sent to `sourceDirectory` before each configure or build |
| `buildSystem` | `cmake`, `meson` or `make`; detected when unset |
| `cmakePreset` | A configure preset of `CMakeUserPresets.json`, such as the one `devtool ide-sdk` writes |
| `configureArguments`, `buildArguments` | Extra arguments for configure and build |

## Configure and build

1. **Select Application...** picks the application; the status bar shows it with its last result.
2. **Configure Application with SDK** and **Build Application with SDK** run in a terminal of their own in the SDK's environment, after the changed files are copied to the host (`make` builds go through `bear` for compile commands). **Cancel Application Build**, or Ctrl+C, stops it.
3. Compiler, linker, CMake and Meson problems land in Problems on the working copy's files.

![A compile error of an SDK build in Problems, on the laptop's working copy of the application.](https://neuralinverse.com/docs-images/modules/embedded-linux/sdk-build-problems.webp)

## clangd with the SDK

For the selected application, clangd runs on the build host over SSH (or here for an SDK installed here) with the SDK's compiler as query driver and the working copy's paths mapped, so completion and diagnostics use the target's sysroot and headers. `neuralInverse.embeddedLinux.clangd.arguments` adds clangd arguments. The language status shows **C and C++ with the SDK**.

## Agent tools

Listing SDKs and applications is read-only; configure and build always ask first.

Next: [Static analysis](https://neuralinverse.com/docs/modules/embedded-linux/static-analysis/).
