-
Notifications
You must be signed in to change notification settings - Fork 42
fix: cmake error about WaylandClientPrivate not found #319
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
Fixes the following error on Arch:
```
CMake Error at src/dbus/CMakeLists.txt:31 (target_link_libraries):
Target "dde_am_dbus" links to:
Qt::WaylandClientPrivate
but the target was not found. Possible reasons include:
* There is a typo in the target name.
* A find_package call is missing for an IMPORTED target.
* An ALIAS target is missing.
-- Generating done (0.1s)
CMake Generate step failed. Build files cannot be regenerated correctly.
```
Reviewer's guide (collapsed on small PRs)Reviewer's GuideExtends the Qt6 CMake dependency list to explicitly require the private Wayland client component so that the dde_am_dbus target can link against Qt::WaylandClientPrivate without configuration failures on systems like Arch. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
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.
Hey - I've left some high level feedback:
- Since
WaylandClientPrivateis a private Qt module that may not be present or exported in all Qt builds, consider making this dependency optional (e.g., usingfind_package(Qt6 COMPONENTS WaylandClientPrivate QUIET)plus a feature toggle) or gating the code that uses it behind a CMake option to avoid hard build failures on platforms without this target.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Since `WaylandClientPrivate` is a private Qt module that may not be present or exported in all Qt builds, consider making this dependency optional (e.g., using `find_package(Qt6 COMPONENTS WaylandClientPrivate QUIET)` plus a feature toggle) or gating the code that uses it behind a CMake option to avoid hard build failures on platforms without this target.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Co-authored-by: Gary Wang <git@blumia.net>
deepin pr auto review这段代码在 CMake 构建脚本中添加了对 Qt 6.10 及以上版本中 1. 语法逻辑
2. 代码质量
3. 代码性能
4. 代码安全
改进建议为了提高代码的健壮性和可维护性,建议对代码进行如下微调:
优化后的代码示例: find_package(Qt6 REQUIRED COMPONENTS Core DBus Concurrent WaylandClient Gui)
# 引入 WaylandClientPrivate 以支持 Qt 6.10+ 的新特性
# 注意:使用私有 API 需谨慎,未来版本可能会变动
if(Qt6_VERSION VERSION_GREATER_EQUAL 6.10)
find_package(Qt6 COMPONENTS WaylandClientPrivate)
if(Qt6WaylandClientPrivate_FOUND)
# 如果找到了,定义一个宏,方便在 C++ 代码中进行条件编译
add_definitions(-DQT_WAYLANDCLIENT_PRIVATE_SUPPORT)
else()
message(WARNING "Qt 6.10+ detected but WaylandClientPrivate module not found. Some features may be disabled.")
endif()
endif()
find_package(Dtk6 REQUIRED COMPONENTS Core)
find_package Threads REQUIRED)
find_package(TreelandProtocols REQUIRED)修改点说明:
如果该模块是必须的(即没有它程序无法运行),则保持原样即可,但建议添加注释。 |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: felixonmars, zccrs The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Fixes the following error on Arch:
Summary by Sourcery
Build: