1 parent ec87742 commit c35f1b4Copy full SHA for c35f1b4
1 file changed
src/cli/cmd_build.cppm
@@ -80,8 +80,10 @@ export int cmd_build(const mcpplibs::cmdline::ParsedArgs& parsed) {
80
// configure-only deliberately includes dev-dependencies and test TUs:
81
// clangd needs the same include/module surface as `mcpp test`, even
82
// though Ninja is run in dry-run mode and compiles no object.
83
+ // 必须在移动 targets 前读取状态;函数实参的求值顺序未指定。
84
+ const bool includeDevDeps = !discovered->targets.empty();
85
auto ctx = mcpp::build::prepare_build(
- print_fp, /*includeDevDeps=*/!discovered->targets.empty(),
86
+ print_fp, includeDevDeps,
87
std::move(discovered->targets), std::move(memberOv));
88
if (!ctx) {
89
std::println(stderr, "error: {}", ctx.error());
0 commit comments