vgpu in-guest producer in-tree, release CI, flexible vmie discovery

- src/si/vgpu-stream: in-guest vgpu producer built as a Windows cross-compiled target (if(WIN32))
- .gitea: release workflow — cross-build the agent and build/publish the deb against system vmie
- cmake/makefile: resolve vmie from a source tree (LIBVMIE_PATH) or installed libvmie-dev
This commit is contained in:
2026-06-22 18:35:12 +03:00
parent 9bde398b6c
commit bd8b966017
31 changed files with 2393 additions and 8 deletions
+45 -4
View File
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.16)
project(vmsig VERSION 0.3.0 LANGUAGES C)
project(vmsig VERSION 0.3.1 LANGUAGES C)
set(CMAKE_C_STANDARD 17)
set(CMAKE_C_STANDARD_REQUIRED ON)
@@ -16,6 +16,37 @@ option(VMSIG_WITH_VMIE "Link real vmie (libvmie.a, PIC) for armed memctx" OFF)
# The input driver (vmctl) is ABSORBED in-tree (src/si/input/) — no external flag.
set(LIBVMIE_PATH "" CACHE PATH "Path to the vmie library sources (for VMSIG_WITH_VMIE)")
# ---- in-guest vgpu producer (Windows agent, cross-compiled) -----------------
# The host signaling stack below is Linux-only (epoll/eventfd/timerfd), so a Windows-targeted
# build (mingw toolchain, CMAKE_SYSTEM_NAME=Windows) produces ONLY this agent. Producer and
# host consumer share the ABI header include/vgpu_stream.h, so they version together in one tree.
# cmake -S . -B .build-win -DCMAKE_TOOLCHAIN_FILE=cmake/toolchain-mingw-w64.cmake
if(WIN32)
add_executable(vgpu-streamer
src/si/vgpu-stream/win32/main.c
src/si/vgpu-stream/publish.c
src/si/vgpu-stream/win32/region.c
src/si/vgpu-stream/win32/present.c
src/si/vgpu-stream/win32/cursor.c
src/si/vgpu-stream/win32/geometry.c
src/si/vgpu-stream/win32/capture.c
src/si/vgpu-stream/win32/capture_nvfbc.c
src/si/vgpu-stream/win32/capture_dda.c
src/si/vgpu-stream/win32/capture_gdi.c)
target_include_directories(vgpu-streamer PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/include
${CMAKE_CURRENT_SOURCE_DIR}/src/si/vgpu-stream/include
${CMAKE_CURRENT_SOURCE_DIR}/src/si/vgpu-stream/win32
${CMAKE_CURRENT_SOURCE_DIR}/third_party) # vendor NvFBC + Windows.h shim
target_compile_definitions(vgpu-streamer PRIVATE CINTERFACE WIN32_LEAN_AND_MEAN=)
target_compile_options(vgpu-streamer PRIVATE
$<$<C_COMPILER_ID:GNU>:-O2;-Wall;-Wextra>
$<$<C_COMPILER_ID:MSVC>:/O2;/W3>)
target_link_libraries(vgpu-streamer PRIVATE d3d11 dxgi dxguid uuid user32 gdi32)
target_link_options(vgpu-streamer PRIVATE $<$<C_COMPILER_ID:GNU>:-static;-s>)
return() # a Windows-targeted build is the agent ONLY; the host stack below is skipped
endif()
find_package(Threads REQUIRED)
# ---- signaling library ------------------------------------------------------
@@ -58,9 +89,19 @@ target_link_libraries(vmsig PRIVATE Threads::Threads)
# package Depends on libvmie). Headers + symbols come from the imported target.
if(VMSIG_WITH_VMIE)
add_library(vmie SHARED IMPORTED)
set_target_properties(vmie PROPERTIES
IMPORTED_LOCATION ${LIBVMIE_PATH}/.build/libvmie.so
INTERFACE_INCLUDE_DIRECTORIES ${LIBVMIE_PATH}/include)
if(LIBVMIE_PATH)
# dev: link against an in-place source-tree build
set_target_properties(vmie PROPERTIES
IMPORTED_LOCATION ${LIBVMIE_PATH}/.build/libvmie.so
INTERFACE_INCLUDE_DIRECTORIES ${LIBVMIE_PATH}/include)
else()
# CI/system: the installed libvmie-dev package (/usr, or via CMAKE_PREFIX_PATH)
find_library(VMIE_LIBRARY NAMES vmie REQUIRED)
find_path( VMIE_INCLUDE_DIR NAMES memmodel.h PATH_SUFFIXES vmie REQUIRED)
set_target_properties(vmie PROPERTIES
IMPORTED_LOCATION ${VMIE_LIBRARY}
INTERFACE_INCLUDE_DIRECTORIES ${VMIE_INCLUDE_DIR})
endif()
target_link_libraries(vmsig PRIVATE vmie)
target_compile_definitions(vmsig PRIVATE VMSIG_WITH_VMIE)
endif()