It could be a Cargo plugin, and we looked at doing that. There may also be some neat tricks around build.rs integration.
However, we decided to wait on those. After all: it only supports rust today, but we're eyeing a future where we support Go + Javascript too. We want Riff to work relatively consistently across these ecosystems.