Support MSVC and MinGW SDK consumers
Compared with dc08a95:
- Add explicit module-definition files for the capture and preview DLLs so their public C export names remain stable and can be consumed without compiler-specific C++ symbol conventions.
- Keep the SDK implementation built with MSVC while automatically using MinGW dlltool to generate libgvfg.dll.a and libgvfg_preview.dll.a alongside the existing MSVC import libraries.
- Make the public capture header portable by including SAL only under MSVC and defining no-op annotations required by non-MSVC C and C++ compilers.
- Replace the Qt sample's compiler-specific wait on std::thread::native_handle() with an explicit atomic worker-completion state while preserving synchronous window-message servicing during shutdown.
- Document that MSVC and MinGW consumers use different import libraries while loading the same gvfg.dll and gvfg_preview.dll at runtime.
Validation: MSVC Debug and Release SDK builds passed and produced both MSVC and MinGW import libraries. Qt MSVC Debug, Qt MinGW Debug, and Qt MinGW Release sample builds and links passed. MinGW C and C++ public-header syntax checks passed, the MinGW executable import table references the expected GVFG DLLs and C exports, and git diff --check passed. No runtime launch, capture, audio playback, clean-machine deployment, or hardware validation was run.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
project(gvfg_preview LANGUAGES CXX)
|
||||
|
||||
add_library(gvfg_preview SHARED
|
||||
gvfg_preview.def
|
||||
include/gvfg_preview.h
|
||||
../../sdk/gvfg/src/gpu/d3d_conversion_pipeline.cpp
|
||||
../../sdk/gvfg/src/gpu/d3d_conversion_pipeline.h
|
||||
@@ -38,6 +39,18 @@ if (MSVC)
|
||||
target_compile_options(gvfg_preview PRIVATE /utf-8 /EHsc)
|
||||
endif()
|
||||
|
||||
if (MSVC AND GVFG_MINGW_DLLTOOL)
|
||||
add_custom_command(TARGET gvfg_preview POST_BUILD
|
||||
COMMAND "${GVFG_MINGW_DLLTOOL}"
|
||||
-d "${CMAKE_CURRENT_SOURCE_DIR}/gvfg_preview.def"
|
||||
-D gvfg_preview.dll
|
||||
-l libgvfg_preview.dll.a
|
||||
WORKING_DIRECTORY "${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}"
|
||||
COMMENT "Generating MinGW import library for gvfg_preview.dll"
|
||||
VERBATIM
|
||||
)
|
||||
endif()
|
||||
|
||||
install(TARGETS gvfg_preview
|
||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
@@ -46,3 +59,9 @@ install(TARGETS gvfg_preview
|
||||
install(FILES include/gvfg_preview.h
|
||||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
|
||||
)
|
||||
|
||||
if (MSVC AND GVFG_MINGW_DLLTOOL)
|
||||
install(FILES "${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}/libgvfg_preview.dll.a"
|
||||
DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
)
|
||||
endif()
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
LIBRARY gvfg_preview
|
||||
|
||||
EXPORTS
|
||||
gvfg_preview_get_delivery_stats
|
||||
gvfg_preview_wait_idle
|
||||
gvfg_preview_create
|
||||
gvfg_preview_destroy
|
||||
gvfg_preview_attach_window
|
||||
gvfg_preview_prepare
|
||||
gvfg_preview_render_frame
|
||||
gvfg_preview_clear
|
||||
gvfg_preview_get_info
|
||||
gvfg_preview_get_stats
|
||||
gvfg_preview_shutdown
|
||||
gvfg_preview_strerror
|
||||
Reference in New Issue
Block a user