Skip to content

fix: support .ccm/.cxxm/.ixx module interface extensions#272

Open
ZheFeng7110 wants to merge 2 commits into
mcpp-community:mainfrom
ZheFeng7110:fix/support-not-only-cppm
Open

fix: support .ccm/.cxxm/.ixx module interface extensions#272
ZheFeng7110 wants to merge 2 commits into
mcpp-community:mainfrom
ZheFeng7110:fix/support-not-only-cppm

Conversation

@ZheFeng7110

Copy link
Copy Markdown
Contributor

Summary

plan.cppm hardcoded .cppm extension checks, causing non-.cppm module interface files (.ccm, .cxxm, .ixx) to have their object files excluded from link units, resulting in "module not found" linker errors.

Changes

  • src/build/plan.cppm: Link object collection now uses cu.providesModule semantic check instead of extension check; object_filename_for treats all 4 module extensions equally with .m prefix
  • src/build/execute.cppm: Freshness check now recognizes .ccm/.cxxm/.ixx
  • tests/unit/test_module_extensions.cpp (new): Unit tests for object_filename_for disambiguation
  • tests/e2e/152_module_extensions.sh (new): End-to-end build→link→run test for all 4 extensions

Test plan

  • mcpp build self-host passes
  • CI unit tests pass
  • CI E2E tests pass

@Sunrisepeak

Copy link
Copy Markdown
Member

这几个后缀比较小众, 先保留PR 后面看是否有很多相关项目真实使用 到时候 再评估是否再合入, 目前先以推荐 cppm / cpp 为推荐 看是否可以形成共识 简化表达

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants