# GSoC 2025 - Support simple C++20 modules use from the Clang driver without a build system

DevFeed: [GSoC 2025 - Support simple C++20 modules use from the Clang driver without a build system](<https://devfeed.tech/articles/gsoc-2025-support-simple-c-20-modules-use-from-the-clang-driver-without-a-build-system-43121.md>)

Original publisher: [Read original article](<https://blog.llvm.org/posts/2025-08-gsoc-modules-driver/>)

Author: Naveen Seth Hanig

Published: 2025-10-06T00:00:00Z

Content type: article

Language: en

Sources: [LLVM Project](<https://devfeed.tech/sources/the-llvm-project-blog.md>)

Topics: [modules](<https://devfeed.tech/topics/modules.md>), [clang](<https://devfeed.tech/topics/clang.md>), [C++](<https://devfeed.tech/topics/c-plus-plus.md>), [builds](<https://devfeed.tech/topics/builds.md>)

Tags: [build](<https://devfeed.tech/tags/build.md>), [build-system](<https://devfeed.tech/tags/build-system.md>), [c-plus-plus](<https://devfeed.tech/tags/c-plus-plus.md>), [clang](<https://devfeed.tech/tags/clang.md>), [code](<https://devfeed.tech/tags/code.md>), [library](<https://devfeed.tech/tags/library.md>), [make](<https://devfeed.tech/tags/make.md>), [modules](<https://devfeed.tech/tags/modules.md>), [scope](<https://devfeed.tech/tags/scope.md>)

## AI overview

This post describes a Google Summer of Code project adding native support for simple Clang and C++20 named modules in the Clang driver without requiring a build system. It covers module dependency scanning, build ordering, standard library module imports, and implementation challenges.

## Source excerpt

Hi, my name is Naveen. For Google Summer of Code 2025, I've been working on adding native support for simple Clang and C++20 named module use from the Clang driver.This post outlines the project and its current status. My mentor for this project was Michael Spencer. Background Modules solve many of the long-standing problems with the traditional header-based way of sharing code. They prevent leaking macros, let you explicitly choose what to export, and can improve compile time at scale. However, because modules must be precompiled before use, builds that rely on them need to schedule compilations in the right order, according to their imports. At the moment, Clang's driver lacks native support to do this, which makes even simple tests or tiny programs using modules hard to compile without first setting up a build system. Goals The goal of this project is to extend the build system in Clang's driver to natievly support simple use of Clang or C++20 named modules, by integrating Clang's existing support for module dependency scanning. This should also support importing the C++ Standard library modules std and std.compat, and add no overhead to cases where modules are not used. With the feature fully implemented, the following example should compile without any issue: clang++ -std=c++23 main.cpp A.cpp -fmodules-driver -fmodules -fmodule-map-file=module.modulemap // main.cpp#include "MyLib.h"import std;import A;auto main() -> int { std::println("{}", make_greeting("modules")); std::println("The answer is: {}", get_answer());} // A.cppexport module A;import std;export auto make_greeting(std::string_view Name) -> std::string { return std::format("Hello, {}!", Name);} // module.modulemapmodule MyLib { header "MyLib.h" export *} // MyLib.hauto get_answer() -> int { return 42; } Although one of the main advantages of modules is that they can be precompiled once and reused for future uses, support for caching was not included in the scope of this GSoC project. Design Overview