https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124593

            Bug ID: 124593
           Summary: scaning module deps with unicode characters path error
           Product: gcc
           Version: 15.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: yjdyamv at tutamail dot com
  Target Milestone: ---

hello, I set my cpp standard is 23, and use cmake to build my project. My
project is on my desktop and my machine lang is Chinese, and so has Chinese
charaters in headers path. It error below:

```console
[build] [2/7  14% :: 0.032] Generating CXX dyndep file
CMakeFiles/hello_lib.dir/Debug/CXX.dd
[build] [3/7  28% :: 0.100] Scanning '/home/dony/桌面/中文/testc/main.cpp' for CXX
dependencies
[build] FAILED: [code=1] CMakeFiles/testc.dir/Debug/main.cpp.o.ddi 
[build] /usr/bin/g++ -DCMAKE_INTDIR=\"Debug\"  -Wall -Wextra -Wpedantic -g -O0
-gdwarf-5 -fdiagnostics-color=always -fno-omit-frame-pointer -std=gnu++23 -fPIE
-fdiagnostics-color=always -E -x c++ '/home/dony/桌面/中文/testc/main.cpp' -MT
CMakeFiles/testc.dir/Debug/main.cpp.o.ddi -MD -MF
CMakeFiles/testc.dir/Debug/main.cpp.o.ddi.d -fmodules-ts
-fdeps-file=CMakeFiles/testc.dir/Debug/main.cpp.o.ddi
-fdeps-target=CMakeFiles/testc.dir/Debug/main.cpp.o -fdeps-format=p1689r5 -o
CMakeFiles/testc.dir/Debug/main.cpp.o.ddi.i
[build] /home/dony/桌面/中文/testc/main.cpp:3:10: error: cannot determine
‘#include’ translation of /home/dony/桌面/中文/testc/hello.hpp: malformed string
'ERROR 'unrecognized \'INCLUDE-TRANSLATE
\'/home/dony/桌面/中文/testc/hello.hpp\'\'''
[build]     3 | #include "hello.hpp"
[build]       |          ^~~~~~~~~~~
[build] [3/7  42% :: 1.695] Building CXX object
CMakeFiles/hello_lib.dir/Debug/hello.cpp.o
[build] ninja: build stopped: subcommand failed.
```

and so I move my project to other position to let path dont include Chinese
charcters, and it works. 
Another try: In origin path, I set `CMAKE_CXX_SCAN_FOR_MODULES` `OFF`, and it
works. And if I set use clang to compiler without set
`CMAKE_CXX_SCAN_FOR_MODULES` `OFF`, it works.

Reply via email to