Closed
Description
Describe the bug
On MSVC dev command prompt (vcvarsall.bat for x64), the build fails when the source directory contains whitespaces.
To Reproduce
Steps to reproduce the behavior:
- Open a x64 MSVC dev prompt
- Execute the commands below to reproduce the issue
SET MY_SRC_DIR=%TEMP%\zstd with spaces SET MY_BUILD_DIR=%TEMP%\zstd-build-dir SET MY_INSTALL_DIR=%TEMP%\zstd-install-dir git clone https://github.com/facebook/zstd "%MY_SRC_DIR%" cmake -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release --install-prefix "%MY_INSTALL_DIR%" -S "%MY_SRC_DIR%\build\cmake" -B "%MY_BUILD_DIR%" cmake --build "%MY_BUILD_DIR%" --config Release
Expected behavior
The build should succeed.
Screenshots and charts
Desktop (please complete the following information):
- OS: Windows
- Version: Windows 11, 24H2, OS Build 26100.2894
- Compiler: MSVC (19.42.34436) for x64 from Visual Studio 2022 Community edition
- Flags: default from vcvarsall.bat for x64
- Other relevant hardware specs: N/A
- Build system: CMake
Additional context
A similar issue has been reported previously #3999, and users told that #4019 fixed it. However, at the time of writing, since the include directory containing whitespaces is unquoted, and the directory is passed AS IS to the command line, the resource compiler fails to work properly.
zstd/build/cmake/lib/CMakeLists.txt
Line 121 in ea0aa03