Skip to content

Conversation

@kixelated
Copy link
Collaborator

No description provided.

@gemini-code-assist
Copy link

Summary of Changes

Hello @kixelated, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly refactors the project's CMake build system to enhance the integration of the libmoq dependency. It updates the source location for fetching libmoq to its official repository and adopts a more standard find_package mechanism for linking, which streamlines dependency management. Furthermore, it introduces platform-specific CMake variables within CMakePresets.json to ensure accurate fetching and linking of libmoq across various operating systems and architectures.

Highlights

  • Updated libmoq Source: The libmoq dependency is now fetched from the official moq-dev/moq GitHub repository, moving away from a personal fork.
  • Standardized CMake Integration: The project transitions from manually importing libmoq to using a more robust find_package(moq) approach, leveraging libmoq's own CMake configuration for linking.
  • Platform-Specific Build Variables: New CMake variables (MOQ_VERSION, MOQ_TARGET, MOQ_ARCHIVE, MOQ_LIB) have been introduced and configured in CMakePresets.json to correctly handle platform-specific libmoq archive names and library types across different operating systems.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors the handling of the moq dependency by using FetchContent combined with find_package. This is a great improvement over the previous manual IMPORTED library creation, making the build more robust and portable across different platforms. The changes in CMakePresets.json correctly configure the new variables required for fetching the platform-specific moq library archives. I have one minor suggestion to further improve the code structure in CMakeLists.txt.

Comment on lines 21 to 34
if(MOQ_LOCAL)
add_subdirectory(${MOQ_LOCAL}/rs/libmoq moq)
target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE moq)
else()
include(FetchContent)
FetchContent_Declare(
moq
URL
https://github.com/kixelated/moq/releases/download/v${MOQ_VERSION}/moq-${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR}.tar.gz
URL https://github.com/moq-dev/moq/releases/download/libmoq-v${MOQ_VERSION}/moq-${MOQ_VERSION}-${MOQ_TARGET}.${MOQ_ARCHIVE}
)
FetchContent_MakeAvailable(moq)

add_library(moq SHARED IMPORTED GLOBAL)
set_target_properties(
moq
PROPERTIES
IMPORTED_LOCATION "${moq_SOURCE_DIR}/lib/libmoq.dylib"
INTERFACE_INCLUDE_DIRECTORIES "${moq_SOURCE_DIR}/include"
)
find_package(moq REQUIRED PATHS ${moq_SOURCE_DIR} NO_DEFAULT_PATH)
target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE moq::moq)
endif()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

To improve maintainability and avoid duplicating the target_link_libraries call, you could use a variable to store the moq target name within the if/else block and then call target_link_libraries once after the block. This makes the logic for handling the local vs. fetched dependency slightly cleaner by separating the dependency resolution from the linking.

if(MOQ_LOCAL)
  add_subdirectory(${MOQ_LOCAL}/rs/libmoq moq)
  set(MOQ_TARGET_TO_LINK moq)
else()
  include(FetchContent)
  FetchContent_Declare(
    moq
    URL https://github.com/moq-dev/moq/releases/download/libmoq-v${MOQ_VERSION}/moq-${MOQ_VERSION}-${MOQ_TARGET}.${MOQ_ARCHIVE}
  )
  FetchContent_MakeAvailable(moq)

  find_package(moq REQUIRED PATHS ${moq_SOURCE_DIR} NO_DEFAULT_PATH)
  set(MOQ_TARGET_TO_LINK moq::moq)
endif()

target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE ${MOQ_TARGET_TO_LINK})

@kixelated kixelated merged commit 0f719e2 into moq-dev:master Dec 18, 2025
3 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant