build(windows): the forced -include of HostStandardStreams.hpp breaks the build when the source path contains a space #8607

Closed
opened 2026-10-20 18:13:00 +00:00 by DProkos · 1 comment
DProkos commented 2026-10-20 18:13:00 +00:00 (Migrated from github.com)
Contributor

Imported from boykopovar/AnyPS5. Originally posted by DProkos on 2026-10-20T18:13:00Z.


Since #7807 (c03168fb4), a Windows build from a source tree whose path contains a space fails on the first libc file:

FAILED: [code=1] core/libs/CMakeFiles/libc.dir/prx/libc/Export.cpp.obj
C:\mingw64\bin\g++.exe ... -include C:/Users/Deni/Desktop/AI Scprits/AnyPS5/core/libs/prx/libc/include/HostStandardStreams.hpp ... -c "C:/Users/Deni/Desktop/AI Scprits/AnyPS5/core/libs/prx/libc/Export.cpp"
g++.exe: fatal error: cannot specify '-o' with '-c', '-S' or '-E' with multiple files

SHELL: splits its argument with shell-like quoting, so the unquoted path becomes two words: -include C:/Users/Deni/Desktop/AI and a second input file Scprits/AnyPS5/.... The same option is added in three places, all under if(WIN32):

  • core/libs/CMakeLists.txt line 86 (libc)
  • core/libs/CMakeLists.txt line 146 (every library in the loop)
  • core/shader/recompiler/CMakeLists.txt line 172

Quoting the path inside SHELL: fixes it:

-    target_compile_options(libc PRIVATE "SHELL:-include ${CMAKE_CURRENT_SOURCE_DIR}/prx/libc/include/HostStandardStreams.hpp")
+    target_compile_options(libc PRIVATE "SHELL:-include \"${CMAKE_CURRENT_SOURCE_DIR}/prx/libc/include/HostStandardStreams.hpp\"")

and the same \"...\" for the other two lines.

Tested: Windows 11 Pro 26200, WinLibs GCC 15.2.0 r7 UCRT, CMake 4.4.4, Ninja, Release, source at C:\Users\Deni\Desktop\AI Scprits\AnyPS5, main 892a4f132. Without the change cmake --build build --target libs stops on the first libc object; with the three lines quoted, the libs target builds (1625 steps). A path without spaces was not built with the change. Linux and macOS do not take this branch.

I can open the pull request with this change if that helps.

AI-assisted: yes

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5947041870 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/8607). Originally posted by [DProkos](https://github.com/DProkos) on 2026-10-20T18:13:00Z. --- Since #7807 (`c03168fb4`), a Windows build from a source tree whose path contains a space fails on the first libc file: ``` FAILED: [code=1] core/libs/CMakeFiles/libc.dir/prx/libc/Export.cpp.obj C:\mingw64\bin\g++.exe ... -include C:/Users/Deni/Desktop/AI Scprits/AnyPS5/core/libs/prx/libc/include/HostStandardStreams.hpp ... -c "C:/Users/Deni/Desktop/AI Scprits/AnyPS5/core/libs/prx/libc/Export.cpp" g++.exe: fatal error: cannot specify '-o' with '-c', '-S' or '-E' with multiple files ``` `SHELL:` splits its argument with shell-like quoting, so the unquoted path becomes two words: `-include C:/Users/Deni/Desktop/AI` and a second input file `Scprits/AnyPS5/...`. The same option is added in three places, all under `if(WIN32)`: - `core/libs/CMakeLists.txt` line 86 (`libc`) - `core/libs/CMakeLists.txt` line 146 (every library in the loop) - `core/shader/recompiler/CMakeLists.txt` line 172 Quoting the path inside `SHELL:` fixes it: ```diff - target_compile_options(libc PRIVATE "SHELL:-include ${CMAKE_CURRENT_SOURCE_DIR}/prx/libc/include/HostStandardStreams.hpp") + target_compile_options(libc PRIVATE "SHELL:-include \"${CMAKE_CURRENT_SOURCE_DIR}/prx/libc/include/HostStandardStreams.hpp\"") ``` and the same `\"...\"` for the other two lines. Tested: Windows 11 Pro 26200, WinLibs GCC 15.2.0 r7 UCRT, CMake 4.4.4, Ninja, Release, source at `C:\Users\Deni\Desktop\AI Scprits\AnyPS5`, `main` `892a4f132`. Without the change `cmake --build build --target libs` stops on the first libc object; with the three lines quoted, the `libs` target builds (1625 steps). A path without spaces was not built with the change. Linux and macOS do not take this branch. I can open the pull request with this change if that helps. AI-assisted: yes
JJenkx commented 2026-10-22 08:12:29 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by JJenkx on 2026-10-22T08:12:29Z.


Reproduced on a second machine, and the proposed quoting checked on both kinds of path: Windows 11 Enterprise 10.0.22621, WinLibs GCC 15.2.0 r7 (UCRT), Ninja, Release, main d6eafa54d0.

  • Path with a space (the source reached through a junction named space src, a fresh build directory):
    • main: cmake --build --target libc stops on libc.dir/prx/libc/Export.cpp.obj with cannot specify '-o' with '-c', '-S' or '-E' with multiple files, as in the report.
    • With the three lines quoted as above: build.ninja has the -include path in quotes, and cmake --build --target libs completes (exit 0).
  • Path without a space (the usual -DBUILD_TESTING=ON tree), the gap left in the report: with the quoting, Ninja writes the same unquoted -include C:/.../HostStandardStreams.hpp as before, and the whole tree builds (2008 steps, no failures). So the change is a no-op there.
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6336025367 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/8607#issuecomment-6336025367). Originally posted by [JJenkx](https://github.com/JJenkx) on 2026-10-22T08:12:29Z. --- Reproduced on a second machine, and the proposed quoting checked on both kinds of path: Windows 11 Enterprise 10.0.22621, WinLibs GCC 15.2.0 r7 (UCRT), Ninja, Release, `main` d6eafa54d0. - **Path with a space** (the source reached through a junction named `space src`, a fresh build directory): - `main`: `cmake --build --target libc` stops on `libc.dir/prx/libc/Export.cpp.obj` with `cannot specify '-o' with '-c', '-S' or '-E' with multiple files`, as in the report. - With the three lines quoted as above: `build.ninja` has the `-include` path in quotes, and `cmake --build --target libs` completes (exit 0). - **Path without a space** (the usual `-DBUILD_TESTING=ON` tree), the gap left in the report: with the quoting, Ninja writes the same unquoted `-include C:/.../HostStandardStreams.hpp` as before, and the whole tree builds (2008 steps, no failures). So the change is a no-op there.
Sign in to join this conversation.
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5#8607
No description provided.