-
Notifications
You must be signed in to change notification settings - Fork 17
Cmake: Cmake ffmpeg library fix for Windows #31
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
base: main
Are you sure you want to change the base?
Changes from 9 commits
b83a5c7
ea1c0a9
9ffc4e3
8a2174d
a5a16c1
af0d546
e1ad0af
44877ff
d86e382
e54b024
0d6e7f8
9d45afd
c34bf51
fa05997
63cb4ae
02bff6d
136cfb8
9dc4a05
1ac1ca3
b0d4fa3
b4d6945
3cb4031
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| ## Windows Build Instructions | ||
|
|
||
| ### Build Setup | ||
|
|
||
| ```powershell | ||
| Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1')) | ||
| choco install -y git | ||
| choco install -y cmake --installargs 'ADD_CMAKE_TO_PATH=System' | ||
| choco install visualstudio2026buildtools --package-parameters "--add Microsoft.VisualStudio.Workload.VCTools --includeRecommended" | ||
| choco install rustup | ||
| ``` | ||
|
|
||
| During the rustup installation choose the `nightly` variant. | ||
|
|
||
| Locate "Visual Studio Installer". Click "Modify". Choose "Desktop Development with C++". Check C++ ATL For x64 | ||
|
|
||
| ### Build the OBS fork | ||
|
|
||
| ```powershell | ||
| cd obs-studio | ||
| cmake -G "Visual Studio 18 2026" -A x64 --preset windows-x64 | ||
| cmake --build --preset windows-x64 | ||
| ``` | ||
|
|
||
| ### Build the obs-moq plugin | ||
|
|
||
| ```powershell | ||
| cd obs | ||
| cmake -G "Visual Studio 18 2026" -A x64 --preset windows-x64 | ||
| cmake --build --preset windows-x64 | ||
| ``` | ||
|
|
||
| For now copy the build plugin libraries to the build obs fork | ||
|
|
||
| ```powershell | ||
| Copy-Item -Path "build_x64/rundir/RelWithDebInfo/" -Destination "../obs-studio/build_x64/rundir/RelWithDebInfo/obs-plugins" -Recurse | ||
| ``` | ||
|
|
||
| ## Debugging Moq Plugin | ||
| $env:RUST_LOG="debug"; $env:RUST_BACKTRACE=1; $env:OBS_LOG_LEVEL="debug"; .\obs64.exe -verbose |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -60,6 +60,20 @@ function(_setup_obs_studio) | |
| set(_cmake_generator "Xcode") | ||
| set(_cmake_arch "-DCMAKE_OSX_ARCHITECTURES:STRING='arm64;x86_64'") | ||
| set(_cmake_extra "-DCMAKE_OSX_DEPLOYMENT_TARGET=${CMAKE_OSX_DEPLOYMENT_TARGET}") | ||
|
|
||
| #Patch libobs-metal if required | ||
| if (_obs_version VERSION_LESS_EQUAL "32.1.2") | ||
|
|
||
| file(READ "${dependencies_dir}/${_obs_destination}/libobs-metal/CMakeLists.txt" CONTENTS) | ||
|
|
||
| #check if Swift is not available | ||
| if(NOT "${CONTENTS}" MATCHES "enable_language\\(Swift\\)") | ||
| string(REGEX REPLACE "cmake_minimum_required\\(VERSION 3.28...3.30\\)" "cmake_minimum_required(VERSION 3.28...3.30)\nenable_language(Swift)" NEW_CONTENTS "${CONTENTS}") | ||
| message(STATUS "Patching libobs-metal") | ||
| file(WRITE "${dependencies_dir}/${_obs_destination}/libobs-metal/CMakeLists.txt" "${NEW_CONTENTS}") | ||
| endif() | ||
|
Comment on lines
+65
to
+74
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add
🛠️ Proposed fix- `#Patch` libobs-metal if required
- if (_obs_version VERSION_LESS_EQUAL "32.1.2")
-
- file(READ "${dependencies_dir}/${_obs_destination}/libobs-metal/CMakeLists.txt" CONTENTS)
-
- `#check` if Swift is not available
- if(NOT "${CONTENTS}" MATCHES "enable_language\\(Swift\\)")
- string(REGEX REPLACE "cmake_minimum_required\\(VERSION 3.28...3.30\\)" "cmake_minimum_required(VERSION 3.28...3.30)\nenable_language(Swift)" NEW_CONTENTS "${CONTENTS}")
- message(STATUS "Patching libobs-metal")
- file(WRITE "${dependencies_dir}/${_obs_destination}/libobs-metal/CMakeLists.txt" "${NEW_CONTENTS}")
- endif()
-
- endif()
+ # Patch libobs-metal if required
+ if(_obs_version VERSION_LESS_EQUAL "32.1.2")
+ set(_libobs_metal_cmake "${dependencies_dir}/${_obs_destination}/libobs-metal/CMakeLists.txt")
+ if(EXISTS "${_libobs_metal_cmake}")
+ file(READ "${_libobs_metal_cmake}" CONTENTS)
+ # Check if Swift is not already enabled
+ if(NOT "${CONTENTS}" MATCHES "enable_language\\(Swift\\)")
+ string(
+ REGEX REPLACE
+ "cmake_minimum_required\\(VERSION 3\\.28\\.\\.\\. ?3\\.30\\)"
+ "cmake_minimum_required(VERSION 3.28...3.30)\nenable_language(Swift)"
+ NEW_CONTENTS
+ "${CONTENTS}"
+ )
+ if(NOT NEW_CONTENTS STREQUAL CONTENTS)
+ message(STATUS "Patching libobs-metal")
+ file(WRITE "${_libobs_metal_cmake}" "${NEW_CONTENTS}")
+ else()
+ message(WARNING "libobs-metal patch: regex did not match; Swift may not be enabled")
+ endif()
+ endif()
+ else()
+ message(WARNING "libobs-metal/CMakeLists.txt not found at ${_libobs_metal_cmake}; skipping Swift patch")
+ endif()
+ endif()The proposed fix also escapes the 🤖 Prompt for AI Agents |
||
|
|
||
| endif() | ||
| endif() | ||
|
|
||
| message(STATUS "Configure ${label} (${arch})") | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.