Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
copyrat90 opened this issue Jun 6, 2024 · 1 comment · Fixed by #3997
Closed

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

copyrat90 opened this issue Jun 6, 2024 · 1 comment · Fixed by #3997

Comments

@copyrat90
Copy link

copyrat90 commented Jun 6, 2024

Issue

After commit a9b8517 (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) with Ninja 1.12.0 on Windows 10.

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_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)
// main.cpp
int main() {}
@vitaut
Copy link
Contributor

vitaut commented Jun 6, 2024

cc @yujincheng08

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants