# Building C++20 Modules

**URL:** https://discourse.cmake.org/t/building-c-20-modules/898
**Category:** Usage
**Created:** [April 1, 2020, 6:07am UTC](https://discourse.cmake.org/t/building-c-20-modules/898 "2020-04-01T06:07:02Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![amaclean](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/a/85e7bf/32.png) [@amaclean](https://discourse.cmake.org/u/amaclean)
#### Post date: [April 1, 2020, 6:07am UTC](https://discourse.cmake.org/t/building-c-20-modules/898/1 "2020-04-01T06:07:02Z")

</div>

Is there a general way to tell the linker that `.mpp` is a CXX extension?

I downloaded [cxx-modules-sandbox](https://github.com/mathstuf/cxx-modules-sandbox) and I was able to successfully build it by code like this after ever `add_library`:

```cmake
set_target_properties(simple PROPERTIES LINKER_LANGUAGE CXX)

```

Obviously this had to be set for every target.  
I am using Microsoft Visual Studio Community 2019  
Version 16.5.2

Visual Studio builds OK, however when using ninja (version 1.10.0) the build fails with lots of linker errors for:

- link-use
- link-use-mask
- good-scanner
- generated

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)
#### Post date: [April 1, 2020, 12:10pm UTC](https://discourse.cmake.org/t/building-c-20-modules/898/2 "2020-04-01T12:10:26Z")

</div>

You need a patched CMake to use that repository. The latest version in use contains the `.mpp` extension logic needed (it’s not accessible from just CMake variables unfortunately). See the `docker` branch of the repo for the instructions to build the needed environment.

---

<div class="post-metadata">

### Author: ![amaclean](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/a/85e7bf/32.png) [@amaclean](https://discourse.cmake.org/u/amaclean)
#### Post date: [April 2, 2020, 10:25am UTC](https://discourse.cmake.org/t/building-c-20-modules/898/3 "2020-04-02T10:25:40Z")

</div>

Thanks for this @ben.boeckel, I sounds like it’s a bit complicated to do at present.
