Metadata-Version: 2.5
Name: dikolab-horde-plugin-c
Version: 0.0.3
Summary: The horde plugin for C — CMake and Conan, with one shared dependency manifest.
Project-URL: Homepage, https://diko316.gitlab.io/dikolab-horde/
Project-URL: Documentation, https://diko316.gitlab.io/dikolab-horde/
Project-URL: Funding, https://paypal.me/dikolab
Author-email: Diko TechSlave <diko316@gmail.com>
License-Expression: MIT
License-File: LICENSE
Keywords: c,cmake,conan,horde,monorepo,plugin
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Topic :: Software Development :: Build Tools
Classifier: Typing :: Typed
Requires-Python: >=3.11
Requires-Dist: dikolab-horde-common>=0.0.3
Requires-Dist: dikolab-horde-sdk>=0.0.3
Description-Content-Type: text/markdown

<img src="https://diko316.gitlab.io/dikolab-horde/assets/horde-logo.png" alt="horde" width="140">

# dikolab-horde-plugin-c

**The horde plugin for C packages**, through CMake and Conan — including C
compiled to WebAssembly.

You do not normally install it yourself: `horde use c` puts it in the workspace
venv and registers it in `horde.toml`. It is not a library you import; it ships a
console script horde spawns as a worker.

> **Status: alpha.** `0.0.2` implements the ten commands plus `format`, `link`
> and `change-compiler` — more than any other plugin. The interfaces may still
> move.

> **`0.0.1` does not run. Install `0.0.2`.** It registers three commands beyond
> the ten, and the `0.0.1` SDK refused any name outside them, so it raised
> before its handshake:
>
> ```
> ValueError: 'format' is not a horde command. The ten are: configure, create,
> list, bump, lint, test, build, run, publish, delete
> ```
>
> The plugin was never at fault — the SDK was too strict. `0.0.2` accepts them,
> and the two must be installed as a pair.

## Prerequisites

- Python 3.11 or newer, and [horde](https://pypi.org/project/dikolab-horde/)
- `cmake`, `conan`, `emcc` and `wasm32-wasip1-clang` on your `PATH`

All four are checked by `horde use c`, which refuses if any is missing.

> **On `wasm32-wasip1-clang`.** It lives in `<wasi-sdk>/bin`, which you should
> **not** put on `PATH` wholesale — that directory also carries generically-named
> `clang`, `ar`, `nm` and `lld`, and its `clang` targets `wasm32-unknown-wasip1`.
> Anything shelling out to `clang` would silently cross-compile. Expose the
> target-prefixed drivers through a directory of symlinks and put *that* on
> `PATH`.

## Getting started

```sh
horde use c
horde c configure
horde c create mathlib --type lib
horde c build mathlib
```

`configure` writes the CMake and Conan setup and the clang-format rules.
`create` scaffolds the package under `c/` with a `CMakeLists.txt` and a
`horde-package.toml`.

Scaffolded templates are written in clang-format's own default style, so a new
package passes its own `format --check` on arrival.

## Commands

Thirteen: the ten horde routes, plus three of its own.

| Command | Runs | Example |
|---|---|---|
| `configure` | CMake and Conan setup, clang-format rules | `horde c configure` |
| `create` | scaffolds a package | `horde c create mathlib --type lib` |
| `list` | this plugin's packages | `horde c list` |
| `bump` | raises the version | `horde c bump mathlib --patch` |
| `lint` | the configured checks | `horde c lint` |
| **`format`** | clang-format | `horde c format` |
| `test` | the package's tests | `horde c test mathlib` |
| `build` | compiles, resolving dependencies first | `horde c build mathlib` |
| **`link`** | links a built object into a consumer | `horde c link mathlib` |
| `run` | runs a package | `horde c run demo` |
| `publish` | uploads to a Conan remote — **only with `-y`** | `horde c publish mathlib -y` |
| `delete` | removes a package | `horde c delete mathlib` |
| **`change-compiler`** | switches the workspace toolchain | `horde c change-compiler clang` |

`change-compiler` is **workspace-wide**, not per package: a C workspace mixing
compilers produces objects that cannot be linked together, so the choice belongs
to the workspace.

Conan's cache is pointed at `.horde/conan` — machine-local, never committed, and
safe to delete.

**The compiler model, Conan, and the WebAssembly targets in detail:**
https://diko316.gitlab.io/dikolab-horde/dikolab-horde-plugin-c/manual/

## Documentation

- [Manual](https://diko316.gitlab.io/dikolab-horde/dikolab-horde-plugin-c/manual/) — getting started and commands
- [The C plugin](https://diko316.gitlab.io/dikolab-horde/plugins/c/) · [WebAssembly](https://diko316.gitlab.io/dikolab-horde/guide/wasm/)
- [Release notes](https://diko316.gitlab.io/dikolab-horde/dikolab-horde-plugin-c/release-notes/)

## Support

If horde saves you time, you can support its development:
https://paypal.me/dikolab

---

© 2025–2026 dikolab. Released under the MIT License.
