fix: use DTK_NAME_SUFFIX for CMake namespace - #25
Merged
Conversation
The CMake export configuration was using DTK_VERSION_MAJOR for
the namespace in the installed targets file, but this should use
DTK_NAME_SUFFIX instead. This ensures consistent naming across the
build system and proper namespace resolution when other projects link
against DLog. The change affects the INSTALL command for exporting
targets, updating the namespace from Dtk${DTK_VERSION_MAJOR}:: to
Dtk${DTK_NAME_SUFFIX}::.
Influence:
1. Verify CMake configuration builds successfully
2. Test that the exported targets file is generated with the correct
namespace
3. Check that dependent projects can find and link against DLog using
the new namespace
4. Ensure no regression in installation and packaging processes
fix: 使用 DTK_NAME_SUFFIX 作为 CMake 命名空间
CMake 导出配置原本使用 DTK_VERSION_MAJOR 作为已安装目标文件的命名空间,
现应改为使用 DTK_NAME_SUFFIX。这确保了构建系统中的命名一致性,以及其他项
目链接 DLog 时的正确命名空间解析。此更改影响了导出目标的 INSTALL 命令,
将命名空间从 Dtk${DTK_VERSION_MAJOR}:: 更新为 Dtk${DTK_NAME_SUFFIX}::。
Influence:
1. 验证 CMake 配置构建成功
2. 测试导出的目标文件是否使用正确的命名空间生成
3. 检查依赖项目是否可以使用新的命名空间找到并链接 DLog
4. 确保安装和打包过程没有回归问题
deepin-ci-robot
added a commit
to linuxdeepin/dtk6log
that referenced
this pull request
Jan 6, 2026
Synchronize source files from linuxdeepin/dtklog. Source-pull-request: linuxdeepin/dtklog#25
deepin pr auto review我来分析一下这个CMakeLists.txt的变更:
改进建议:
if(NOT DEFINED DTK_NAME_SUFFIX)
message(FATAL_ERROR "DTK_NAME_SUFFIX is not defined")
endif()
if(NOT DTK_NAME_SUFFIX MATCHES "^[a-zA-Z0-9_]+$")
message(FATAL_ERROR "DTK_NAME_SUFFIX contains invalid characters")
endif()
总体来说,这是一个合理的改动,提高了代码的可维护性和灵活性,但需要确保新变量的正确性和安全性。 |
Contributor
|
Note
详情{
"CMakeLists.txt": [
{
"line": " HOMEPAGE_URL \"https://github.com/linuxdeepin/dtklog\"",
"line_number": 13,
"rule": "S35",
"reason": "Url link | 6fabe13a51"
}
]
} |
yixinshark
approved these changes
Jan 6, 2026
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 18202781743, yixinshark 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 |
Contributor
Author
|
/forcemerge |
Contributor
|
This pr force merged! (status: blocked) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The CMake export configuration was using DTK_VERSION_MAJOR for
the namespace in the installed targets file, but this should use
DTK_NAME_SUFFIX instead. This ensures consistent naming across the
build system and proper namespace resolution when other projects link
against DLog. The change affects the INSTALL command for exporting
targets, updating the namespace from Dtk${DTK_VERSION_MAJOR}:: to
Dtk${DTK_NAME_SUFFIX}::.
Influence:
namespace
the new namespace
fix: 使用 DTK_NAME_SUFFIX 作为 CMake 命名空间
CMake 导出配置原本使用 DTK_VERSION_MAJOR 作为已安装目标文件的命名空间,
现应改为使用 DTK_NAME_SUFFIX。这确保了构建系统中的命名一致性,以及其他项
目链接 DLog 时的正确命名空间解析。此更改影响了导出目标的 INSTALL 命令,
将命名空间从 Dtk${DTK_VERSION_MAJOR}:: 更新为 Dtk${DTK_NAME_SUFFIX}::。
Influence: