-
Notifications
You must be signed in to change notification settings - Fork 11
Sqhh99/windows vcpkg support #24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
livekit.vcxproj -> D:\workspace\lib-workspace\client-sdk-cpp\build\Release\livekit.lib SimpleDataStream.vcxproj -> D:\workspace\lib-workspace\client-sdk-cpp\build\examples\Release\SimpleDataStream.exe SimpleRoom.vcxproj -> D:\workspace\lib-workspace\client-sdk-cpp\build\examples\Release\SimpleRoom.exe SimpleRpc.vcxproj -> D:\workspace\lib-workspace\client-sdk-cpp\build\examples\Release\SimpleRpc.exe Build Succeeded.
- Fix "file path too long" errors by switching from CMAKE_SOURCE_DIR to CMAKE_CURRENT_SOURCE_DIR for relative path resolution. - Refactor CMakeLists.txt to support nested project usage via LIVEKIT_IS_TOPLEVEL check. - Align MSVC runtime library with Rust static CRT (MultiThreaded) to prevent link-time conflicts. - Implement unified binary output directory (bin/lib/include) with config-specific subfolders. - Add robust cargo build integration using run_cargo.cmake script. - Introduce install logic and full clean targets (clean_all).
- Added CMakePresets.json for unified cross-platform build configurations. - Optimized Rust FFI build logic to prevent unnecessary recompilation when C++ code changes. - Fixed MSVC runtime library (MT/MD) mismatch on Windows. - Added automatic header aggregation to build/include directory. - Refactored CMakeLists.txt to support both top-level and subdirectory integration.
…cies - Add GitHub Actions workflow for Windows, Linux, and macOS - Integrate vcpkg manifest mode with CMake Presets - Fix missing Linux dependencies (libva, alsa, libclang, etc.) - Add CXXFLAGS to ignore deprecated warnings from WebRTC on newer GCC - Synchronize git submodules and fix protocol file paths - Configure build.h template for build metadata injection
- Remove livekit_ffi.h inclusion from public participant.h - Add livekit_ffi.h to room.cpp for internal access to INVALID_HANDLE - Improve header encapsulation by hiding internal FFI definitions from SDK users
…T conflicts
Motivation:
The prebuilt libwebrtc library is strictly compiled with the /MT runtime,
causing severe symbol redefinition and runtime mismatch errors (LNK2038)
when linked against /MD-based Qt applications.
Changes:
1. Architecture Redesign: Refactored livekit-ffi to build as a shared library
(cdylib/DLL) instead of a static library on Windows.
2. Binary Isolation: Leveraged the DLL boundary to encapsulate /MT dependencies,
allowing the consumer layer (livekit.lib) to safely use /MD.
3. CMake Infrastructure Enhancements:
- Explicitly set CMAKE_MSVC_RUNTIME_LIBRARY to MultiThreadedDLL for
MSVC targets.
- Automated the Rust build pipeline with PROTOC environment variable
injection for protobuf generation.
- Added POST_BUILD commands to automatically deploy livekit_ffi.dll and
third-party dependencies (protobuf, abseil) to the output directory.
4. Platform Consistency: Maintained the original static linking logic for
Linux and macOS to preserve performance and simplicity.
Verification:
Validated the generated livekit.lib using `dumpbin /DIRECTIVES`, confirming
the RuntimeLibrary is correctly set to MD_DynamicRelease.
- Automatically copy libprotobuf.lib and abseil_dll.lib to SDK lib
Collaborator
|
The PR looks good, why it was closed ? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces significant improvements to the build system for cross-platform support, dependency management, and artifact handling. The changes migrate the build workflow to use CMake presets and vcpkg for dependencies, streamline Rust FFI integration, and enhance Windows support. The build outputs and artifact uploads are now more consistent across platforms.
Build System and Dependency Management
build.bat,vcpkg.json, andCMakePresets.jsonto tracked files. (.github/workflows/builds.yml, [1] [2].github/workflows/builds.yml, .github/workflows/builds.ymlL50-L85).github/workflows/builds.yml, .github/workflows/builds.ymlL50-L85)Cross-Platform Build and Artifact Handling
.github/workflows/builds.yml, [1] [2]CMakeLists.txt, CMakeLists.txtL217-L243)CMake and Project Structure Enhancements
CMakeLists.txtto set project version, root/binary directories, and output paths based on platform. Added options for building examples and using vcpkg. (CMakeLists.txt, CMakeLists.txtL1-R55)CMakeLists.txt, CMakeLists.txtL122-R226)CMakeLists.txt, CMakeLists.txtL217-L243)Abseil and Protobuf Handling
CMakeLists.txt, CMakeLists.txtL286-R421)Related Issue: Fixes #23
Note to maintainers: I've implemented the build.cmd with automatic LIBCLANG_PATH detection to make the environment setup as smooth as possible for Windows users.