Skip to content

Commit 968e06f

Browse files
committed
refactor(prepare): 扩展名表按包建一次,不再每个生成物重建一次
1 parent e8b17cf commit 968e06f

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

src/build/prepare.cppm

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3159,18 +3159,18 @@ prepare_build(bool print_fingerprint,
31593159
std::copy(fresh.begin(), fresh.end(),
31603160
mm.buildConfig.actions.begin()
31613161
+ static_cast<std::ptrdiff_t>(firstNewAction));
3162+
// The package that DECLARED the outputs classifies them: a dependency
3163+
// generating a `.ixx` asks its own manifest, not the root project's.
3164+
// Built once per package, not once per output.
3165+
const auto pkgExtTable =
3166+
mcpp::extension_table_for(mm.buildConfig.moduleExtensions);
31623167
for (auto const& a : fresh) {
31633168
if (a.role != mcpp::manifest::BuildAction::Role::Source) continue;
31643169
for (auto const& o : a.outputs) {
31653170
if (o.find("${mcpp.") != std::string::npos) continue;
31663171
// Companion outputs (protoc's .pb.h next to its .pb.cc) are
31673172
// produced by the edge but are NOT translation units.
3168-
// The package that DECLARED the output classifies it: a
3169-
// dependency generating a `.ixx` is asking its own manifest,
3170-
// not the root project's.
3171-
if (!mcpp::build::directives::is_compilable_output(
3172-
o, mcpp::extension_table_for(
3173-
mm.buildConfig.moduleExtensions)))
3173+
if (!mcpp::build::directives::is_compilable_output(o, pkgExtTable))
31743174
continue;
31753175
mm.buildConfig.sources.push_back(o);
31763176
mm.modules.sources.push_back(o);

0 commit comments

Comments
 (0)