Skip to content

Add support for C++20 modules #1252

Open

Description

@ChuanqiXu9

C++20 Named Modules introduce new dependent information to the project, so the legacy dependency discovery method doesn't work properly for C++20 Named Modules. clang-scan-deps has just landed the support for discovering dependencies for named modules. The manual can be found here: https://clang.llvm.org/docs/StandardCPlusPlusModules.html#discover-dependencies. It would be pretty cool if ccache could support named modules.

Activity

  1. changed the title [-]ccache can't handle C+20 Named modules properly now[/-] [+]Add support for C++20 modules[/+] on Feb 16, 2023
  2. added
    help wanted
    on Feb 16, 2023
  3. bharsaklemukesh975 commented on Apr 13, 2023

    @bharsaklemukesh975

    Can I work on this?

  4. ChuanqiXu9 commented on Apr 14, 2023

    @ChuanqiXu9
    Author

    Can I work on this?

    I don't know ccache a lot. But you can contact me if you need information from modules : )

  5. bharsaklemukesh975 commented on Apr 14, 2023

    @bharsaklemukesh975

    Hello @ChuanqiXu9 , Could you please provide some examples of how to use modules? I will start working on it. Looking forward to learning and implementing modules.

  6. ChuanqiXu9 commented on Apr 15, 2023

    @ChuanqiXu9
    Author

    Hello @ChuanqiXu9 , Could you please provide some examples of how to use modules? I will start working on it. Looking forward to learning and implementing modules.

    Hello. https://clang.llvm.org/docs/StandardCPlusPlusModules.html is the document about how to use C++20 modules in clang. And the blog https://www.kitware.com/import-cmake-c20-modules/ tells how to use cmake to compile C++20 modules. It may be a good start to use cmake to compile the hello world example.

    And for the ccache, I think the key point is the p1689 format produced from clang-scan-deps. You can find the document in https://clang.llvm.org/docs/StandardCPlusPlusModules.html#discover-dependencies. And you can find the formal paper in https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1689r5.html.

    For the more complex example, I think https://github.com/alibaba/async_simple/tree/CXX20Modules is the most complex example for modules as far as I know. You can find there a lot of module interfaces there. So I think it would be a great success if the ccache works for that one. Note that for the above example in async_simple, you would better to use the same standard library otherwise there may be problems.

  7. linked a pull request that will close this issueImplement support for C++20 modules #1523on Nov 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedissue: feature

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions