Files
GVFG_Standalone/GVFG_SDK/sdk/gvfg/CMakeLists.txt
T
Mark.lin 0af70a59ca Replace the legacy backend with GigabyteLib
Compared with 5f74655:

- Preserve the public gvfg C API while replacing the direct PCIE S2MM register, IOCTL, and giga_ioctl.dll implementation with a per-channel adapter around the supervisor-provided GvfgSdk.lib API.

- Route device open, event creation, video/audio capture, copy and zero-copy frame delivery, zero-copy release, signal metadata, and stream teardown through GigabyteLib while retaining the existing facade ownership and timeout contracts.

- Remove the obsolete giga_ioctl target and legacy register/video-format backend files, and stop requiring or packaging giga_ioctl.dll in the Qt sample and customer archives.

- Vendor the matched GigabyteLib 1.0.0 headers and static library with provenance and checksum documentation, and update build, architecture, frame-flow, and customer deployment documentation for the new boundary.

- Keep gvfg_set_channel_video_format source-compatible, but report GVFG_ENOTSUP when the connected native input format differs because the supplied GigabyteLib API does not expose output-format conversion. Direct debug register reads and writes are likewise unsupported by this backend.

Validation: git diff --cached --check passed. MSVC x64 Release and Debug gvfg.dll builds passed, the Release Qt sample linked successfully, dumpbin confirmed gvfg.dll has no giga_ioctl.dll dependency and retains all 32 public exports, and the Release package script produced an archive without giga_ioctl.dll or private GigabyteLib files. No runtime capture, audio, zero-copy, hot-plug, dual-channel, device shutdown, MinGW, or hardware validation was run.
2026-09-14 09:46:37 +08:00

86 lines
2.2 KiB
CMake

# Inherit the version from the standalone root project. The root project()
# declaration is the single source of truth for the public SDK version.
set(_GVFG_VERSION "${PROJECT_VERSION}")
project(gvfg VERSION ${_GVFG_VERSION} LANGUAGES CXX)
add_library(gvfg SHARED
gvfg.def
include/gvfg_capture.h
include/gvfg_debug.h
src/backend/gigabyte/gigabyte_backend_types.h
src/backend/gigabyte/gigabyte_capture_session.cpp
src/backend/gigabyte/gigabyte_capture_session.h
src/backend/gigabyte/gigabyte_device.cpp
src/backend/gigabyte/gigabyte_device.h
src/gpu/d3d_conversion_pipeline.cpp
src/gpu/d3d_conversion_pipeline.h
src/gpu/gvfg_gpu_convert.cpp
src/gvfg_error_state.h
src/gvfg_capture.cpp
)
set_target_properties(gvfg PROPERTIES
AUTOMOC OFF
AUTOUIC OFF
AUTORCC OFF
)
target_include_directories(gvfg
PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/include
PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/src
${CMAKE_CURRENT_SOURCE_DIR}/src/backend/gigabyte
${CMAKE_CURRENT_SOURCE_DIR}/src/gpu
${CMAKE_CURRENT_SOURCE_DIR}/../../third_party/GigabyteLib
)
target_compile_definitions(gvfg PRIVATE
GVFG_BUILD
GVFG_VERSION_STRING="${PROJECT_VERSION}"
)
target_compile_definitions(gvfg PRIVATE
GVFG_INTERNAL_DIAGNOSTICS=$<IF:$<CONFIG:Debug>,1,0>
)
target_link_libraries(gvfg PRIVATE
"${CMAKE_CURRENT_SOURCE_DIR}/../../third_party/GigabyteLib/GvfgSdk.lib"
setupapi
user32
dxgi
d3d11
D3DCompiler
)
if (MSVC)
target_compile_options(gvfg PRIVATE /utf-8 /EHsc)
endif()
if (MSVC AND GVFG_MINGW_DLLTOOL)
add_custom_command(TARGET gvfg POST_BUILD
COMMAND "${GVFG_MINGW_DLLTOOL}"
-d "${CMAKE_CURRENT_SOURCE_DIR}/gvfg.def"
-D gvfg.dll
-l libgvfg.dll.a
WORKING_DIRECTORY "${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}"
COMMENT "Generating MinGW import library for gvfg.dll"
VERBATIM
)
endif()
install(TARGETS gvfg
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
)
install(FILES include/gvfg_capture.h
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)
if (MSVC AND GVFG_MINGW_DLLTOOL)
install(FILES "${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}/libgvfg.dll.a"
DESTINATION ${CMAKE_INSTALL_LIBDIR}
)
endif()