c++clangc++-modulesclang-cl

Enable C++ Modules TS in clang-cl


I am using clang (from LLVM version 7.00) on Windows via clang-cl.

I am trying to get C++ Modules to work. I have tried the clang command line arguments -fmodules-ts and -fmodules.

I have also tried the msvc command line arguments (which work under MSVC - I am using 15.8.5) /experimental:module /module:interface (which would be the normal way for non-experimental options).

All options result in the error clang-cl.exe: warning: unknown argument ignored in clang-cl.

Anyone know if it's possible to use the C++ Modules TS under clang-cl?


Solution

  • Use option -Xclang, like this:

    clang-cl -Xclang -fmodules