plugin is a small C++20 toolkit. It builds into three artefacts:

TargetKindNamespaceNeeds
dsoldshared libraryfedem::dsolibdl (standard)
pluginheader-onlyplugin::
plugin-signstatic libraryfedem::signOpenSSL ≥ 3.0

The dso-keygen / dso-sign / dso-verify command-line tools build alongside them when OpenSSL is present. dsold gains its signed-load overloads (loadSigned, loadVerified) only when plugin-sign is in the build.

Requirements

  • A C++20 compiler — GCC 12+ or Clang 15+. plugin-sign and the tools compile as C++23.
  • CMake ≥ 3.20.
  • OpenSSL ≥ 3.0 development headers — only for the signing half. Leave it out and dsold + plugin still build; the signing library, the tools and the signed-load overloads are silently skipped.
  • Linux. The loader is dlopen-based and the signer walks the ELF section table; other ELF platforms should work but only Linux is tested.

Standalone build

git clone <plugin-repo> && cd plugin
cmake -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build -j
sudo cmake --install build

CMake options (all ON by default in a standalone build):

OptionEffect
APPSBuild dso-keygen, dso-sign, dso-verify (needs OpenSSL).
EXAMPLEBuild the example/plugin Shape demo (testShape + the plugin .sos).
TESTINGBuild the GoogleTest suite (skipped automatically if GTest is absent).

The Conan recipe turns EXAMPLE and TESTING off — they are not part of the shipped package.

Embedding with add_subdirectory

add_subdirectory(third_party/plugin)   # sets PLUGIN_STANDALONE OFF automatically

target_link_libraries(my_host PRIVATE dsold plugin)
# add plugin-sign too if you want loadVerified():
target_link_libraries(my_host PRIVATE plugin-sign)

PLUGIN_STANDALONE is auto-detected (CMAKE_SOURCE_DIR == CMAKE_CURRENT_SOURCE_DIR). When off, the docs Doxygen target is not created, so it never clashes with a host that has its own.

Conan

The recipe exposes the three artefacts as components:

def requirements(self):
    self.requires("plugin/2.1.2")

def generate(self):
    # in your CMakeLists:
    #   find_package(plugin CONFIG REQUIRED)
    #   target_link_libraries(app PRIVATE plugin::dsold plugin::plugin plugin::plugin-sign)

conan create . builds and packages the libraries, the three CLI tools and their shell completions. The package version is taken from the project(... VERSION x.y.z.w) line in CMakeLists.txt — that number is the single source of truth.

pkg-config

A plugin.pc is installed to <prefix>/share/pkgconfig:

pkg-config --cflags --libs plugin

CPack packages

cpack in the build directory produces 7Z, TGZ, ZIP, DEB and RPM archives, split by component (plugin, plugin_development, plugin_apps). Prebuilt binary packages are not published yet — build from the source archive for now.

Verifying the build

cmake -B build -DEXAMPLE=ON
cmake --build build -j --target testShape
cd build/example/plugin
./testShape

Expected first lines:

=== Config-based creation demo ===

Circle (config r=42): Circle r:42
Ellipse (config a=10 b=20): Ellipse a:10 b:20
Circle (default + setSize 7): Circle r:7
Square (default + setSize 15): Square a:15

Then read User Guide › Getting Started.