-
Notifications
You must be signed in to change notification settings - Fork 10
Edit CMake config to reuse it into moqbs #23
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
Conversation
WalkthroughCMakeLists.txt now declares a MODULE library target named obs-moq and replaces all references to the previous project target with obs-moq for linking, sources, and property configuration. Conditional logic for locating libobs was changed to depend on BUILD_PLUGIN. target_link_libraries, target_sources, include/link directories, and set_target_properties calls were updated to reference obs-moq. CMakePresets.json adds a cached BUILD_PLUGIN variable set to true in the template configure preset. 🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (2 inconclusive)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 📜 Recent review detailsConfiguration used: Organization UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
✏️ Tip: You can disable this entire section by setting Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
CMakeLists.txt (1)
43-54: Inconsistent target reference will break the build when ENABLE_QT is enabled.Lines 46-53 still reference
${CMAKE_PROJECT_NAME}while the target was renamed toobs-moq. This will either cause a CMake error or apply options to the wrong target.🐛 Proposed fix
if(ENABLE_QT) find_package(Qt6 COMPONENTS Widgets Core) target_link_libraries(obs-moq PRIVATE Qt6::Core Qt6::Widgets) target_compile_options( - ${CMAKE_PROJECT_NAME} + obs-moq PRIVATE $<$<C_COMPILER_ID:Clang,AppleClang>:-Wno-quoted-include-in-framework-header -Wno-comma> ) set_target_properties( - ${CMAKE_PROJECT_NAME} + obs-moq PROPERTIES AUTOMOC ON AUTOUIC ON AUTORCC ON ) endif()
🧹 Nitpick comments (2)
CMakeLists.txt (2)
16-18: Prefer idiomatic CMake conditional syntax.Using
${BUILD_PLUGIN}insideif()expands the variable before evaluation, which can behave unexpectedly if the variable is unset or has non-boolean values. The idiomatic CMake approach is to reference the variable directly.♻️ Suggested change
-if(NOT ${BUILD_PLUGIN}) +if(NOT BUILD_PLUGIN) find_package(libobs REQUIRED) endif()
69-73: Same CMake conditional syntax concern.Consistent with the earlier suggestion, prefer
if(BUILD_PLUGIN)overif(${BUILD_PLUGIN}).♻️ Suggested change
-if(${BUILD_PLUGIN}) +if(BUILD_PLUGIN) set_target_properties_plugin(obs-moq PROPERTIES OUTPUT_NAME ${_name}) else() set_target_properties_obs(obs-moq PROPERTIES FOLDER plugins PREFIX "") endif()
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
CMakeLists.txtCMakePresets.json
🧰 Additional context used
📓 Path-based instructions (2)
CMakePresets.json
📄 CodeRabbit inference engine (CLAUDE.md)
Specify MOQ_VERSION in
CMakePresets.jsonto control libmoq library version (platform-specific targets: aarch64-apple-darwin, x86_64-unknown-linux-gnu, x86_64-pc-windows-msvc)
Files:
CMakePresets.json
**/CMakeLists.txt
📄 CodeRabbit inference engine (CLAUDE.md)
Use
./build-aux/run-gersemifor CMake file formatting
Files:
CMakeLists.txt
🧠 Learnings (9)
📓 Common learnings
Learnt from: CR
Repo: moq-dev/obs PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-12T01:37:10.897Z
Learning: For local moq library development, use `just setup ../moq` to point CMake to a local moq repository instead of downloading pre-built binaries
Learnt from: CR
Repo: moq-dev/obs PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-12T01:37:10.897Z
Learning: Applies to CMakePresets.json : Specify MOQ_VERSION in `CMakePresets.json` to control libmoq library version (platform-specific targets: aarch64-apple-darwin, x86_64-unknown-linux-gnu, x86_64-pc-windows-msvc)
Learnt from: CR
Repo: moq-dev/obs PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-12T01:37:10.897Z
Learning: Applies to obs-moq.cpp : Plugin initialization must call `obs_module_load()` in `obs-moq.cpp`, configure Rust library logging via `moq_log_level()`, and register three components: service, output, and source
Learnt from: CR
Repo: moq-dev/obs PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-12T01:37:10.897Z
Learning: Applies to **/*.{cpp,h,hpp} : Use logging macros from `logger.h`: `LOG_DEBUG()`, `LOG_INFO()`, `LOG_WARNING()`, `LOG_ERROR()` with `[obs-moq]` prefix
📚 Learning: 2026-01-12T01:37:10.897Z
Learnt from: CR
Repo: moq-dev/obs PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-12T01:37:10.897Z
Learning: Applies to CMakePresets.json : Specify MOQ_VERSION in `CMakePresets.json` to control libmoq library version (platform-specific targets: aarch64-apple-darwin, x86_64-unknown-linux-gnu, x86_64-pc-windows-msvc)
Applied to files:
CMakePresets.jsonCMakeLists.txt
📚 Learning: 2026-01-12T01:37:10.897Z
Learnt from: CR
Repo: moq-dev/obs PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-12T01:37:10.897Z
Learning: Applies to obs-moq.cpp : Plugin initialization must call `obs_module_load()` in `obs-moq.cpp`, configure Rust library logging via `moq_log_level()`, and register three components: service, output, and source
Applied to files:
CMakeLists.txt
📚 Learning: 2026-01-12T01:37:10.897Z
Learnt from: CR
Repo: moq-dev/obs PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-12T01:37:10.897Z
Learning: Applies to **/*.{cpp,h,hpp} : Use logging macros from `logger.h`: `LOG_DEBUG()`, `LOG_INFO()`, `LOG_WARNING()`, `LOG_ERROR()` with `[obs-moq]` prefix
Applied to files:
CMakeLists.txt
📚 Learning: 2026-01-12T01:37:10.897Z
Learnt from: CR
Repo: moq-dev/obs PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-12T01:37:10.897Z
Learning: For local moq library development, use `just setup ../moq` to point CMake to a local moq repository instead of downloading pre-built binaries
Applied to files:
CMakeLists.txt
📚 Learning: 2026-01-12T01:37:10.897Z
Learnt from: CR
Repo: moq-dev/obs PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-12T01:37:10.897Z
Learning: Applies to moq-source.{cpp,h} : MoQ Source (`moq-source.cpp/h`) is an experimental feature for receiving MoQ broadcasts
Applied to files:
CMakeLists.txt
📚 Learning: 2026-01-12T01:37:10.897Z
Learnt from: CR
Repo: moq-dev/obs PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-12T01:37:10.897Z
Learning: Applies to moq-output.cpp : Use FFI calls `moq_track_send_*()` to send encoder packets from `MoQOutput::Data()` through `VideoData()`/`AudioData()` to the MoQ library
Applied to files:
CMakeLists.txt
📚 Learning: 2026-01-12T01:37:10.897Z
Learnt from: CR
Repo: moq-dev/obs PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-12T01:37:10.897Z
Learning: Applies to moq-service.{cpp,h} : MoQ Service (`moq-service.cpp/h`) should configure connection to MoQ relay: server URL, path, and supported codecs
Applied to files:
CMakeLists.txt
📚 Learning: 2026-01-12T01:37:10.897Z
Learnt from: CR
Repo: moq-dev/obs PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-12T01:37:10.897Z
Learning: Applies to moq-output.{cpp,h} : MoQ Output (`moq-output.cpp/h`) should handle streaming output, manage MoQ server session, and process audio/video data packets
Applied to files:
CMakeLists.txt
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: Build Project 🧱 / Build for macOS 🍏
- GitHub Check: Build Project 🧱 / Build for Ubuntu 🐧 (ubuntu-24.04)
- GitHub Check: Build Project 🧱 / Build for Windows 🪟
🔇 Additional comments (3)
CMakePresets.json (1)
16-16: LGTM!The
BUILD_PLUGINcache variable is correctly added to the template preset and will propagate to all derived presets. This aligns with the conditional logic inCMakeLists.txtfor controlling libobs resolution and target properties.CMakeLists.txt (2)
14-14: LGTM!Creating a dedicated
obs-moqtarget instead of using${CMAKE_PROJECT_NAME}makes the build configuration more explicit and reusable from other CMake projects like moqbs.
59-67: LGTM!FFmpeg dependencies and source files are correctly linked/added to the
obs-moqtarget.
✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@CMakeLists.txt`:
- Around line 69-73: The call to set_target_properties_obs(obs-moq PROPERTIES
FOLDER plugins PREFIX "") is calling an undefined helper
(set_target_properties_obs) when BUILD_PLUGIN is false; either add a definition
for set_target_properties_obs in the platform helper files
(cmake/*/helpers*.cmake) mirroring the behavior of set_target_properties_plugin,
or replace this call with the correct existing function (for example use the
CMake builtin set_target_properties(obs-moq PROPERTIES FOLDER plugins PREFIX "")
or reuse set_target_properties_plugin(obs-moq PROPERTIES ...) if that matches
the intended behavior); update the helper implementations consistently across
the platform-specific helper modules so obs-moq gets the same target properties.
🧹 Nitpick comments (1)
CMakeLists.txt (1)
16-19: Consider adding a target existence check for clarity.When
BUILD_PLUGINis true, the code assumesOBS::libobsis provided by the parent build. If it's not, the build will fail with an unclear error at link time.💡 Optional: Add a guard for better error messaging
if(NOT BUILD_PLUGIN) find_package(libobs REQUIRED) +else() + if(NOT TARGET OBS::libobs) + message(FATAL_ERROR "BUILD_PLUGIN is set but OBS::libobs target not found. This CMakeLists.txt must be included from OBS source tree.") + endif() endif() target_link_libraries(obs-moq PRIVATE OBS::libobs)
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
CMakeLists.txt
🧰 Additional context used
📓 Path-based instructions (1)
**/CMakeLists.txt
📄 CodeRabbit inference engine (CLAUDE.md)
Use
./build-aux/run-gersemifor CMake file formatting
Files:
CMakeLists.txt
🧠 Learnings (9)
📓 Common learnings
Learnt from: CR
Repo: moq-dev/obs PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-12T01:37:10.897Z
Learning: For local moq library development, use `just setup ../moq` to point CMake to a local moq repository instead of downloading pre-built binaries
Learnt from: CR
Repo: moq-dev/obs PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-12T01:37:10.897Z
Learning: Applies to obs-moq.cpp : Plugin initialization must call `obs_module_load()` in `obs-moq.cpp`, configure Rust library logging via `moq_log_level()`, and register three components: service, output, and source
Learnt from: CR
Repo: moq-dev/obs PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-12T01:37:10.897Z
Learning: Applies to CMakePresets.json : Specify MOQ_VERSION in `CMakePresets.json` to control libmoq library version (platform-specific targets: aarch64-apple-darwin, x86_64-unknown-linux-gnu, x86_64-pc-windows-msvc)
Learnt from: CR
Repo: moq-dev/obs PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-12T01:37:10.897Z
Learning: Applies to **/*.{cpp,h,hpp} : Use logging macros from `logger.h`: `LOG_DEBUG()`, `LOG_INFO()`, `LOG_WARNING()`, `LOG_ERROR()` with `[obs-moq]` prefix
📚 Learning: 2026-01-12T01:37:10.897Z
Learnt from: CR
Repo: moq-dev/obs PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-12T01:37:10.897Z
Learning: Applies to obs-moq.cpp : Plugin initialization must call `obs_module_load()` in `obs-moq.cpp`, configure Rust library logging via `moq_log_level()`, and register three components: service, output, and source
Applied to files:
CMakeLists.txt
📚 Learning: 2026-01-12T01:37:10.897Z
Learnt from: CR
Repo: moq-dev/obs PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-12T01:37:10.897Z
Learning: Applies to **/*.{cpp,h,hpp} : Use logging macros from `logger.h`: `LOG_DEBUG()`, `LOG_INFO()`, `LOG_WARNING()`, `LOG_ERROR()` with `[obs-moq]` prefix
Applied to files:
CMakeLists.txt
📚 Learning: 2026-01-12T01:37:10.897Z
Learnt from: CR
Repo: moq-dev/obs PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-12T01:37:10.897Z
Learning: Applies to CMakePresets.json : Specify MOQ_VERSION in `CMakePresets.json` to control libmoq library version (platform-specific targets: aarch64-apple-darwin, x86_64-unknown-linux-gnu, x86_64-pc-windows-msvc)
Applied to files:
CMakeLists.txt
📚 Learning: 2026-01-12T01:37:10.897Z
Learnt from: CR
Repo: moq-dev/obs PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-12T01:37:10.897Z
Learning: For local moq library development, use `just setup ../moq` to point CMake to a local moq repository instead of downloading pre-built binaries
Applied to files:
CMakeLists.txt
📚 Learning: 2026-01-12T01:37:10.897Z
Learnt from: CR
Repo: moq-dev/obs PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-12T01:37:10.897Z
Learning: Applies to moq-source.{cpp,h} : MoQ Source (`moq-source.cpp/h`) is an experimental feature for receiving MoQ broadcasts
Applied to files:
CMakeLists.txt
📚 Learning: 2026-01-12T01:37:10.897Z
Learnt from: CR
Repo: moq-dev/obs PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-12T01:37:10.897Z
Learning: Applies to moq-output.cpp : Use FFI calls `moq_track_send_*()` to send encoder packets from `MoQOutput::Data()` through `VideoData()`/`AudioData()` to the MoQ library
Applied to files:
CMakeLists.txt
📚 Learning: 2026-01-12T01:37:10.897Z
Learnt from: CR
Repo: moq-dev/obs PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-12T01:37:10.897Z
Learning: Applies to moq-output.{cpp,h} : MoQ Output (`moq-output.cpp/h`) should handle streaming output, manage MoQ server session, and process audio/video data packets
Applied to files:
CMakeLists.txt
📚 Learning: 2026-01-12T01:37:10.897Z
Learnt from: CR
Repo: moq-dev/obs PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-12T01:37:10.897Z
Learning: Applies to moq-service.{cpp,h} : MoQ Service (`moq-service.cpp/h`) should configure connection to MoQ relay: server URL, path, and supported codecs
Applied to files:
CMakeLists.txt
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: Build Project 🧱 / Build for Ubuntu 🐧 (ubuntu-24.04)
- GitHub Check: Build Project 🧱 / Build for macOS 🍏
- GitHub Check: Build Project 🧱 / Build for Windows 🪟
🔇 Additional comments (4)
CMakeLists.txt (4)
14-14: LGTM!Hardcoding the target name
obs-moqinstead of using${CMAKE_PROJECT_NAME}correctly enables this CMakeLists.txt to be included as a subdirectory in external projects like moqbs.
25-35: LGTM!Target references correctly updated to
obs-moqfor both local and fetched moq library linkage.
38-61: LGTM!Target references consistently updated to
obs-moqacross frontend API, Qt, and FFmpeg configurations.
63-67: Target reference updated correctly; consider running formatter.The target reference to
obs-moqis correct. As per coding guidelines, consider running./build-aux/run-gersemito ensure consistent CMake formatting (e.g., one source file per line).
✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.
4898375 to
0b788ad
Compare
No description provided.