Skip to content

Commit c35f1b4

Browse files
committed
fix(build): sequence configure-only dependency check
1 parent ec87742 commit c35f1b4

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/cli/cmd_build.cppm

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,10 @@ export int cmd_build(const mcpplibs::cmdline::ParsedArgs& parsed) {
8080
// configure-only deliberately includes dev-dependencies and test TUs:
8181
// clangd needs the same include/module surface as `mcpp test`, even
8282
// though Ninja is run in dry-run mode and compiles no object.
83+
// 必须在移动 targets 前读取状态;函数实参的求值顺序未指定。
84+
const bool includeDevDeps = !discovered->targets.empty();
8385
auto ctx = mcpp::build::prepare_build(
84-
print_fp, /*includeDevDeps=*/!discovered->targets.empty(),
86+
print_fp, includeDevDeps,
8587
std::move(discovered->targets), std::move(memberOv));
8688
if (!ctx) {
8789
std::println(stderr, "error: {}", ctx.error());

0 commit comments

Comments
 (0)