C · Installation

Installation

4.0.0-rc.1 · f2ef38ea

Ask your coding agent about this page, or add the docs server to it

curl -s 'https://www.unum.cloud/docs/forkunion/c/installation.md' | claude -p "How would this fit my code?"

Fetch the repository at configure time and link one of the two compiled libraries:

FetchContent_Declare(
    forkunion
    GIT_REPOSITORY https://github.com/ashvardanian/ForkUnion
    GIT_TAG v4.0.0-rc.1
)
FetchContent_MakeAvailable(forkunion)
target_link_libraries(your_target PRIVATE forkunion::static) # or forkunion::shared

forkunion::static links the C ABI into your binary, forkunion::shared keeps one copy per process, and forkunion::abi is the C header alone, with nothing to link. Installing also drops a forkunion.pc, so pkg-config --cflags --libs forkunion works outside CMake. The archive is C++ behind a C facade, so a C consumer linking it by hand names the C++ runtime itself: -lstdc++ -lpthread, or -lc++ under Apple’s toolchain.