← All tasks
cppfmtlib/fmt #3993Not a task: already works

Build issue with WinLibs GCC on Windows after C++20 modules update

envgap__fmtlib__fmt-3993

01 / FAILURE SIGNATURE

As reported upstream

C:/Users/Home/test4/build/_deps/fmt-src/src/format.cc: error: failed reading mapper '_deps\fmt-build\CMakeFiles\fmt.dir\src\format.cc.obj.modmap'
Not a benchmark task.
  • The project already builds and runs before the fix, so there is nothing to repair.

02 / ENVIRONMENT RECIPE

Base commit
db9365a11b0bcf6be044f8a98e9db17eea35374a
Manifest
CMakeLists.txt
Reproduce
Awaiting issue-specific recipe
Run under trace
Awaiting a meaningful runtime command

03 / ORIGINAL ISSUE TEXT

fmtlib/fmt #3993 · read the original issue
<!--

Please make sure that the problem reproduces on the current master before

submitting an issue.

If possible please provide a repro on Compiler Explorer:

https://godbolt.org/z/fxccbh53W.

-->

# Issue

After commit https://github.com/fmtlib/fmt/commit/a9b851763854ffb21e9569f18e0f34b4f661fbeb (C++20 modules support),

I'm experiencing this build error when I integrate fmt with `FetchContent` on C++20 or later.



I'm using [WinLibs GCC 14.1.0 (MSVCRT)](https://www.winlibs.com/) with [Ninja 1.12.0](https://ninja-build.org/) on Windows 10.



```ps

PS C:\Users\Home\test4> cmake --build .\build\

[1/4] Building CXX object _deps/fmt-build/CMakeFiles/fmt.dir/src/format.cc.obj

FAILED: _deps/fmt-build/CMakeFiles/fmt.dir/src/format.cc.obj

C:\Library\mingw64\bin\c++.exe  -IC:/Users/Home/test4/build/_deps/fmt-src/include -std=c++20 -MD -MT _deps/fmt-build/CMakeFiles/fmt.dir/src/format.cc.obj -MF _deps\fmt-build\CMakeFiles\fmt.dir\src\format.cc.obj.d -fmodules-ts -fmodule-mapper=_deps\fmt-build\CMakeFiles\fmt.dir\src\format.cc.obj.modmap -MD -fdeps-format=p1689r5 -x c++ -o _deps/fmt-build/CMakeFiles/fmt.dir/src/format.cc.obj -c C:/Users/Home/test4/build/_deps/fmt-src/src/format.cc

C:/Users/Home/test4/build/_deps/fmt-src/src/format.cc: error: failed reading mapper '_deps\fmt-build\CMakeFiles\fmt.dir\src\format.cc.obj.modmap'

[2/4] Building CXX object _deps/fmt-build/CMakeFiles/fmt.dir/src/os.cc.obj

FAILED: _deps/fmt-build/CMakeFiles/fmt.dir/src/os.cc.obj

C:\Library\mingw64\bin\c++.exe  -IC:/Users/Home/test4/build/_deps/fmt-src/include -std=c++20 -MD -MT _deps/fmt-build/CMakeFiles/fmt.dir/src/os.cc.obj -MF _deps\fmt-build\CMakeFiles\fmt.dir\src\os.cc.obj.d -fmodules-ts -fmodule-mapper=_deps\fmt-build\CMakeFiles\fmt.dir\src\os.cc.obj.modmap -MD -fdeps-format=p1689r5 -x c++ -o _deps/fmt-build/CMakeFiles/fmt.dir/src/os.cc.obj -c C:/Users/Home/test4/build/_deps/fmt-src/src/os.cc

C:/Users/Home/test4/build/_deps/fmt-src/src/os.cc: error: failed reading mapper '_deps\fmt-build\CMakeFiles\fmt.dir\src\os.cc.obj.modmap'

ninja: build stopped: subcommand failed.

```



## Reproduce



```cmake

cmake_minimum_required(VERSION 3.11)

project(Test)



set(CMAKE_CXX_STANDARD 20)

set(CMAKE_CXX_STANDARD_REQUIRED ON)

set(CMAKE_CXX_EXTENSIONS OFF)



include(FetchContent)

FetchContent_Declare(fmt

    GIT_REPOSITORY https://github.com/fmtlib/fmt.git

    GIT_TAG master

)

FetchContent_MakeAvailable(fmt)



add_executable(Test main.cpp)

target_link_libraries(Test fmt)

```



```cpp

// main.cpp

int main() {}

```
Continue on GitHub ↗

04 / LABELS

Labels from the report text only; not yet run

No supported category has been assigned.

Label rules and the text that matched
[]