Link the pinned LiveKit C++ SDK into the core library
Adds cmake/LiveKitSDK.cmake, adapted from livekit-examples/cpp-example-collection's helper of the same name, with the VERSION="latest" GitHub-API resolution path removed: this project pins an exact client-sdk-cpp release (1.10.1, the newest tag as of today), and the pin should not be silently bypassable. The module also now exports the runtime shared libraries so packaging can stage liblivekit/liblivekit_ffi next to the plugin module later. core/ links LiveKit::livekit PUBLIC. A new smoke test proves the SDK is not just linked but loadable and callable: livekit::initialize()/shutdown() round-trip in-process, a second initialize() reports "already initialized", the log level round-trips, and the SDK's generated LIVEKIT_BUILD_VERSION is asserted equal to the version CMake pinned (so a stale extracted SDK directory fails loudly rather than being silently reused). Also adds core/tests/test_util.h, a dependency-free assertion harness that keeps running after a failure and prints a pass/fail count, so CI output says how much actually ran instead of dying on the first bare assert(). cmake_minimum_required goes 3.16 -> 3.19 (file(ARCHIVE_EXTRACT)). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RL8abRmgFXkVASHkkqiJbE
This commit is contained in:
+35
-14
@@ -1,8 +1,8 @@
|
||||
cmake_minimum_required(VERSION 3.16)
|
||||
cmake_minimum_required(VERSION 3.19)
|
||||
|
||||
project(obs-streamer-tools-plugin
|
||||
VERSION 0.0.1
|
||||
DESCRIPTION "OBS Studio source plugin for streamer-tools camera feeds (scaffold, no LiveKit integration yet)"
|
||||
VERSION 0.1.0
|
||||
DESCRIPTION "OBS Studio source plugin for streamer-tools camera feeds"
|
||||
LANGUAGES C CXX
|
||||
)
|
||||
|
||||
@@ -11,19 +11,40 @@ set(CMAKE_C_STANDARD_REQUIRED ON)
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
|
||||
set(CMAKE_BUILD_TYPE Release CACHE STRING "Build type" FORCE)
|
||||
endif()
|
||||
|
||||
enable_testing()
|
||||
|
||||
# --- Scaffolding note ------------------------------------------------------
|
||||
# This deliberately does NOT use the full obsproject/obs-plugintemplate
|
||||
# build system (its cmake/common/bootstrap.cmake + buildspec.json, which
|
||||
# download complete OBS source archives and prebuilt dependency bundles
|
||||
# for macOS/Windows). That machinery is real and may be worth adopting
|
||||
# wholesale in a later phase; for this scaffolding pass the goal is a much
|
||||
# simpler CMakeLists.txt that proves out find_package(libobs) plus the
|
||||
# core/adapter split on the platform we can actually verify locally
|
||||
# (Linux, via the system libobs-dev package). See README.md for the full
|
||||
# writeup of what was verified vs. what remains.
|
||||
# ----------------------------------------------------------------------------
|
||||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
|
||||
|
||||
# --- LiveKit C++ client SDK -------------------------------------------------
|
||||
# Pinned, prebuilt release of livekit/client-sdk-cpp, downloaded and unpacked
|
||||
# by cmake/LiveKitSDK.cmake, then consumed through its own CMake package
|
||||
# config as the LiveKit::livekit imported target. See the design doc's
|
||||
# "Resolved (2026-09-07)" section: an exact pin, never "latest".
|
||||
set(STPLUGIN_LIVEKIT_SDK_VERSION "1.10.1" CACHE STRING
|
||||
"Pinned livekit/client-sdk-cpp release version")
|
||||
set(STPLUGIN_LIVEKIT_SDK_TRIPLE "" CACHE STRING
|
||||
"Override the client-sdk-cpp release triple (e.g. ubuntu-24.04-x64); empty = autodetect")
|
||||
set(STPLUGIN_LIVEKIT_SDK_DIR "${CMAKE_BINARY_DIR}/_deps/livekit-sdk" CACHE PATH
|
||||
"Directory the client-sdk-cpp release archive is extracted into (point at a persistent path to cache it across CI builds)")
|
||||
|
||||
include(LiveKitSDK)
|
||||
if(STPLUGIN_LIVEKIT_SDK_TRIPLE)
|
||||
livekit_sdk_setup(
|
||||
VERSION "${STPLUGIN_LIVEKIT_SDK_VERSION}"
|
||||
SDK_DIR "${STPLUGIN_LIVEKIT_SDK_DIR}"
|
||||
TRIPLE "${STPLUGIN_LIVEKIT_SDK_TRIPLE}"
|
||||
)
|
||||
else()
|
||||
livekit_sdk_setup(
|
||||
VERSION "${STPLUGIN_LIVEKIT_SDK_VERSION}"
|
||||
SDK_DIR "${STPLUGIN_LIVEKIT_SDK_DIR}"
|
||||
)
|
||||
endif()
|
||||
find_package(LiveKit CONFIG REQUIRED)
|
||||
|
||||
add_subdirectory(core)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user