Skip to content

chore: eliminate CMake configuration warnings#1243

Merged
18202781743 merged 1 commit into
linuxdeepin:masterfrom
18202781743:master
Sep 5, 2025
Merged

chore: eliminate CMake configuration warnings#1243
18202781743 merged 1 commit into
linuxdeepin:masterfrom
18202781743:master

Conversation

@18202781743

@18202781743 18202781743 commented Sep 5, 2025

Copy link
Copy Markdown
Contributor

The changes address CMake configuration warnings by:

  1. Setting QTP0001 policy to NEW globally in the main CMakeLists.txt
    instead of setting it to OLD in individual modules
  2. Adding POST_BUILD to custom command in packaging macro to ensure
    proper build timing
  3. Removing redundant find_package calls for DdeControlCenter that were
    unnecessary
  4. Removing duplicate QTP0001 policy settings from dock and tray modules

These changes eliminate build warnings while maintaining the same
functionality, making the build output cleaner and more professional.

Influence:

  1. Verify that the project builds without CMake warnings
  2. Test that all modules still compile correctly
  3. Ensure packaging functionality works as expected
  4. Confirm that QML modules are properly generated
  5. Test dock and tray functionality remains unchanged

chore: 消除CMake配置警告

本次修改解决了CMake配置警告问题:

  1. 在主CMakeLists.txt中全局设置QTP0001策略为NEW,而不是在各个模块中设置
    为OLD
  2. 在打包宏中添加POST_BUILD到自定义命令,确保正确的构建时机
  3. 移除对DdeControlCenter的冗余find_package调用
  4. 从dock和tray模块中移除重复的QTP0001策略设置

这些更改在保持相同功能的同时消除了构建警告,使构建输出更加清晰和专业。

Influence:

  1. 验证项目构建时没有CMake警告
  2. 测试所有模块仍能正确编译
  3. 确保打包功能正常工作
  4. 确认QML模块正确生成
  5. 测试dock和tray功能保持不变

Summary by Sourcery

Eliminate CMake configuration warnings by centralizing the QTP0001 policy, cleaning up redundant package calls, and refining the packaging timing in the build system

Build:

  • Set QTP0001 policy to NEW globally in the root CMakeLists instead of per-module settings
  • Add POST_BUILD to the custom packaging command to ensure correct build timing
  • Remove redundant find_package invocation for DdeControlCenter
  • Remove duplicate QTP0001 policy settings from dock and tray modules

The changes address CMake configuration warnings by:
1. Setting QTP0001 policy to NEW globally in the main CMakeLists.txt
instead of setting it to OLD in individual modules
2. Adding POST_BUILD to custom command in packaging macro to ensure
proper build timing
3. Removing redundant find_package calls for DdeControlCenter that were
unnecessary
4. Removing duplicate QTP0001 policy settings from dock and tray modules

These changes eliminate build warnings while maintaining the same
functionality, making the build output cleaner and more professional.

Influence:
1. Verify that the project builds without CMake warnings
2. Test that all modules still compile correctly
3. Ensure packaging functionality works as expected
4. Confirm that QML modules are properly generated
5. Test dock and tray functionality remains unchanged

chore: 消除CMake配置警告

本次修改解决了CMake配置警告问题:
1. 在主CMakeLists.txt中全局设置QTP0001策略为NEW,而不是在各个模块中设置
为OLD
2. 在打包宏中添加POST_BUILD到自定义命令,确保正确的构建时机
3. 移除对DdeControlCenter的冗余find_package调用
4. 从dock和tray模块中移除重复的QTP0001策略设置

这些更改在保持相同功能的同时消除了构建警告,使构建输出更加清晰和专业。

Influence:
1. 验证项目构建时没有CMake警告
2. 测试所有模块仍能正确编译
3. 确保打包功能正常工作
4. 确认QML模块正确生成
5. 测试dock和tray功能保持不变
@sourcery-ai

sourcery-ai Bot commented Sep 5, 2025

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Consolidates Qt policy settings and refines CMake commands to suppress configuration warnings while preserving existing build behavior and packaging workflows.

File-Level Changes

Change Details Files
Set QTP0001 policy globally to NEW
  • Added qt_policy(SET QTP0001 NEW) in the top-level CMakeLists.txt
CMakeLists.txt
Ensure correct build timing in packaging macro
  • Updated add_custom_command to include POST_BUILD for package targets
cmake/DDEShellPackageMacros.cmake
Remove unnecessary find_package calls
  • Deleted redundant find_package(DdeControlCenter) invocation
panels/dock/CMakeLists.txt
Eliminate per-module QTP0001 overrides
  • Removed qt_policy(SET QTP0001 OLD) from dock and tray modules
panels/dock/CMakeLists.txt
panels/dock/tray/CMakeLists.txt

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@deepin-ci-robot

Copy link
Copy Markdown

deepin pr auto review

Git Diff 代码审查报告

总体评价

这次提交主要涉及 CMake 构建系统的修改,包括添加了 Qt 策略设置、修改了构建命令以及移除了不必要的依赖和策略设置。整体来看,这些修改是为了改进构建系统的稳定性和正确性。

详细分析

1. CMakeLists.txt 修改

+qt_policy(SET QTP0001 NEW)
  • 语法逻辑:正确添加了 Qt 策略设置
  • 代码质量:这是一个积极的改进,明确指定了 Qt 策略
  • 代码性能:不影响性能
  • 代码安全:提高了构建的兼容性和安全性
  • 建议:这个修改是正确的,它确保了使用最新的 Qt 行为

2. DDEShellPackageMacros.cmake 修改

- add_custom_command(TARGET ${_config_PACKAGE}_package
+ add_custom_command(TARGET ${_config_PACKAGE}_package POST_BUILD
  • 语法逻辑:修改正确,添加了 POST_BUILD 阶段
  • 代码质量:改进了构建顺序的明确性
  • 代码性能:确保了命令在构建完成后执行,更合理
  • 代码安全:提高了构建的可预测性
  • 建议:这个修改是正确的,它确保了复制命令在构建完成后执行

3. panels/dock/CMakeLists.txt 修改

- find_package(DdeControlCenter)
- qt_policy(SET QTP0001 OLD)
  • 语法逻辑:移除了不必要的依赖和策略设置
  • 代码质量:简化了构建配置
  • 代码性能:减少了不必要的依赖查找
  • 代码安全:移除了可能引起冲突的策略设置
  • 建议:这个修改是正确的,清理了不必要的依赖和策略

4. panels/dock/tray/CMakeLists.txt 修改

- qt_policy(SET QTP0001 OLD)
  • 语法逻辑:移除了过时的策略设置
  • 代码质量:简化了构建配置
  • 代码性能:无影响
  • 代码安全:移除了可能引起冲突的策略设置
  • 建议:这个修改是正确的,清理了过时的策略设置

改进建议

  1. 一致性检查:确保所有模块都使用统一的 Qt 策略设置,目前有些模块移除了 QTP0001,而主 CMakeLists.txt 中设置了 NEW 策略。

  2. 文档更新:建议更新相关文档,说明 Qt 策略变更对构建系统的影响。

  3. 测试验证:建议在构建系统中添加测试用例,验证 Qt 策略变更的正确性。

  4. 版本兼容性:如果项目需要支持多个 Qt 版本,考虑添加版本检查逻辑,确保在不同版本下都能正确构建。

总结

这次修改整体上是积极的,主要是清理和改进了构建系统。建议在合并前进行完整的构建测试,确保所有模块都能正确构建和运行。

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hey there - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: 18202781743, mhduiy, wjyrich

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@18202781743 18202781743 merged commit d1b1eab into linuxdeepin:master Sep 5, 2025
9 of 10 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.

4 participants