<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/163965>163965</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            feature: Optional version of Clang module map `requires` declaration
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            clang
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          torarnv
      </td>
    </tr>
</table>

<pre>
    As described in https://discourse.llvm.org/t/module-map-requires-as-non-hard-requirement/88589 we're looking for a way to provide Clang module maps for Qt for use with Swift, in a way that guarantees these module maps are _not_ accidentally picked up when building C++/Objective-C code (to avoid #158249 and other possible issues).

I initially thought `requires` would solve this, where Clang would ignore the module if the compilation unit doesn't match the required environment, but I now understand it's a hard error.

It would be nice if there was a syntax to declare a module map as having non-fatal requirements, that effectively hides the module (or submodule) if those are not met.

Thanks! ðŸ™‚
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJxkU8HOozgTfBrn0koE5gPCgUMmv5DmNPq1ex81uIm9n7FZu002b78ySWZndqVIlkO7u6qrCmM0N0fUi_qLqP93wMTah559wOC2w-jVo79EUBSnYEZSYBxo5jWK6iLkIOSgTJx8CpFO1m7LyYebkAMLOSxeJUvHBddjoD-TCRSPGI_Ou6PGoN5_LuRy9flcnzu4k5BtILDefxp3g9kHQLjjA9jDGvxmFMHVorvBsz0suMa97P-8HykS3A1r-O1uZhbymhG_WmhkuCUM6JgoAmuK9EsfDATfnefvgNNkFDlGax-wmumTFKQV7pocjMlYldFdhfyy_4Zv4x80sdnoeIXJKwIhz-wBN28UCFmV9Vl-dIBOgWdNAVYfoxktgYkxURSyO4niIorLVzDOsNnnsvbpphlEU7w3KJoC7j5ZBdHbjYC1iZnkXVN4b-b53dycD7ngB0Uz77fJL6uxyMY7SM4wKE_RCdkyLMiT3ote8xSQ20zw7qnSFcbE8BWcv0NyikLkTMmwkG0EhKwrUAg-vNnwC81I4Mz0xhAI7pgfxIdj_CuLq2iyef34kyCAETRuedXZNTMyWvjJNjvzXVWa5-f-7QO0UU9x352EPPsAMY3Pu5DdE4aPtCvuPMNC_IL8u0b3GYUsQQyF6AbRdeIsD6qvVFd1eKC-bJuiLbqqLQ-6r5uyLitV0Fm1bV22Tde05ThL2aCqmrI6mF4Wsi6Lsi2ruinL04hzNxdS4txO545IfBS0oLE_8nPYPdGXTdU19cHiSDbu-ZRyygILKXNUQ58fHMd0i-KjsCZy_KcFG7bUz4ScAonqAt_WLDha2CjELL2f_xOkfxvtqcnulEMKtv81-DfDOo2nyS9CDnnw6ziuwec0CDm8zT28uGy9_DsAAP__ZUaBBw">