Skip to main content

Linking and Plugin-Compatibility Strategy for Drogon Self-Registration Symbols

Context

In C++ static libraries, Drogon relies on static-initialization self-registration; whole-archive linking is fragile across platforms/consumers and drags in every symbol.

Decision

Controllers use HttpController<T,false> + an explicit registerController, with no reliance on whole-archive; OAuth2Plugin keeps its class name and the plugins blocks of every config (config.{json,dev,ci,prod,bench}.json) untouched (Option A). Boundary: if the plugin is ever distributed as a static library, consumers will still need whole-archive to pull in the self-registration symbols.

Consequences and Current State

SDK Smoke (a find_package full-stack consumer) validates this strategy in CI; examples/ provides reference hosts.