{"id":21146359,"url":"https://github.com/bhallstein/cpp-modules-test","last_synced_at":"2025-07-20T15:03:03.289Z","repository":{"id":143863453,"uuid":"494770241","full_name":"bhallstein/cpp-modules-test","owner":"bhallstein","description":"Testing C++20 module compilation with Clang","archived":false,"fork":false,"pushed_at":"2022-05-21T12:03:26.000Z","size":1,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"int","last_synced_at":"2025-03-14T13:44:18.133Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bhallstein.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-05-21T11:58:43.000Z","updated_at":"2022-05-21T12:01:27.000Z","dependencies_parsed_at":null,"dependency_job_id":"02460a9a-8646-4379-93cd-6af85af5cf0c","html_url":"https://github.com/bhallstein/cpp-modules-test","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/bhallstein/cpp-modules-test","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bhallstein%2Fcpp-modules-test","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bhallstein%2Fcpp-modules-test/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bhallstein%2Fcpp-modules-test/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bhallstein%2Fcpp-modules-test/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bhallstein","download_url":"https://codeload.github.com/bhallstein/cpp-modules-test/tar.gz/refs/heads/int","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bhallstein%2Fcpp-modules-test/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266143941,"owners_count":23883069,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-20T08:53:04.417Z","updated_at":"2025-07-20T15:03:03.271Z","avatar_url":"https://github.com/bhallstein.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cpp-modules-test\n\nTest of C++ module compilation with clang.\n\nUnfortunately the version of clang/llvm included with xcode 13 doesn't include support for modules, so uses [silkeh/clang](https://hub.docker.com/r/silkeh/clang) docker image.\n\nSee [ecosta.dev](https://blog.ecosta.dev/en/tech/cpp-modules-with-clang)\n\n\n### Module precompilation approach\n\nUnfortunately a module map is required, for reasons I don't understand (it seems like it should be very easy to give the compiler all source files/compilation units to munch on, and for the compiler when encountering one importing an uncompiled module, defer these units to the end of the compilation phase, but that must not be feasible for some reason).\n\n- Here we first compile the module file(s) into `./*.pcm`.\n- Then compile main using `-c -fprebuilt-module-path=.`\n- Then link with `clang++ *.pcm *.o -o test`\n\nFrom [clang.llvm.org/docs/Modules.html](https://clang.llvm.org/docs/Modules.html):\n\n\u003e -fprebuilt-module-path=\\\u003cdirectory\\\u003e\n\u003e\n\u003e Specify the path to the prebuilt modules. If specified, we will look for modules in this directory for a given top-level module name. We don’t need a module map for loading prebuilt modules in this directory and the compiler will not try to rebuild these modules. This can be specified multiple times.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbhallstein%2Fcpp-modules-test","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbhallstein%2Fcpp-modules-test","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbhallstein%2Fcpp-modules-test/lists"}