Skip to content

Commit febcb56

Browse files
committed
style: use English comments for shared link configuration
1 parent 5c8d966 commit febcb56

2 files changed

Lines changed: 8 additions & 5 deletions

File tree

‎src/build/plan.cppm‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2586,8 +2586,9 @@ make_plan(const mcpp::manifest::Manifest& manifest,
25862586
}
25872587
}
25882588
}
2589-
// 共享映像先于工作区成员创建,但链接配置仍属于它自己的包。
2590-
// 同包的多个 DLL 共用配置组;只生成链接配置,不重复安排产物部署。
2589+
// Shared images are created before workspace members, but their link
2590+
// configuration belongs to their owning package. Multiple DLLs in one
2591+
// package share a link-only group without scheduling duplicate deployment.
25912592
std::map<std::size_t, int> sharedLinkGroups;
25922593
for (auto const& dep : sharedDepTargets) {
25932594
LinkUnit lu;
@@ -2621,7 +2622,8 @@ make_plan(const mcpp::manifest::Manifest& manifest,
26212622
BuildPlan::LinkGroup group;
26222623
group.linkOnly = true;
26232624
group.productDir = lu.output.parent_path();
2624-
// 虚拟根只含工作区配置;普通消费者的私有链接参数不能进入依赖 DLL。
2625+
// A virtual root holds workspace configuration; an ordinary
2626+
// consumer's private link flags must not enter dependency DLLs.
26252627
if (manifest.package.virtualRoot) group.ldflags = packages[0].linkUsage.ldflags;
26262628
group.ldflags.insert(group.ldflags.end(), packages[dep.packageIndex].linkUsage.ldflags.begin(),
26272629
packages[dep.packageIndex].linkUsage.ldflags.end());

‎src/build/prepare/plan.cpp‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -422,8 +422,9 @@ static std::expected<void, std::string> step13_link_forms(PrepareState& state, B
422422
}
423423

424424
static std::expected<void, std::string> step13_make_plan(PrepareState& state, BuildContext& ctx) {
425-
// 每个映像都读取所属包的链接快照,包括普通 path 依赖中的 DLL。
426-
// 脚本执行后统一刷新,并把搜索路径解析到声明它的包,不能只更新工作区成员。
425+
// Each image reads its owner's link snapshot, including DLLs from ordinary
426+
// path dependencies. Refresh all dependency snapshots after build scripts
427+
// and resolve search paths against their declaring package.
427428
for (std::size_t i = 1; i < state.packages.size(); ++i)
428429
state.packages[i].linkUsage.ldflags = normalized_dependency_ldflags(
429430
state.packages[i].root, state.packages[i].manifest.buildConfig.ldflags);

0 commit comments

Comments
 (0)