glslang failed to build due to error C2664 with /std:c++latest option in VS 2022
The MSVC team regularly builds popular open-source projects, including yours, with development versions of the build tools in order to find and fix regressions in the compiler and libraries before they can ship and cause trouble for the world. This also allows us to provide advance notice of breaking changes, which is the case here.
Glslang failed to build due to error C2664 with /std:c++latest option in VS 2022 . Could you please help to take a look? Thanks!
Repro steps:
- Open VS2022 x64 CMD.
- git clone https://github.com/KhronosGroup/glslang C:\gitP\KhronosGroup\glslang
- set CL=/std:c++latest
- cd /d C:\gitP\KhronosGroup\glslang
- python .\update_glslang_sources.py
- mkdir build_amd64 && cd build_amd64
- cmake -G "Visual Studio 17 2022" -A x64 -DCMAKE_SYSTEM_VERSION=10.0.26100.0 ..
- msbuild /m /p:Platform=x64 /p:Configuration=Release glslang.sln /t:Rebuild
Actual result: C:\gitP\KhronosGroup\glslang\External\spirv-tools\tools\val\val.cpp(276,12): error C2664: 'bool process_single_file(const char *,spv_target_env &,spvtools::ValidatorOptions &,bool)': cannot convert argument 1 from 'const _Elem *' to 'const char *' [C:\gitP\KhronosGroup\glslang\build_amd64\External\spirv-tools\tools\spirv-val.vcxproj] C:\gitP\KhronosGroup\glslang\External\spirv-tools\tools\val\val.cpp(276,12): error C2664: with [C:\gitP\KhronosGroup\glslang\build_amd64\External\spirv-tools\tools\spirv-val.vcxproj] C:\gitP\KhronosGroup\glslang\External\spirv-tools\tools\val\val.cpp(276,12): error C2664: [ [C:\gitP\KhronosGroup\glslang\build_amd64\External\spirv-tools\tools\spirv-val.vcxproj] C:\gitP\KhronosGroup\glslang\External\spirv-tools\tools\val\val.cpp(276,12): error C2664: _Elem=char8_t [C:\gitP\KhronosGroup\glslang\build_amd64\External\spirv-tools\tools\spirv-val.vcxproj] C:\gitP\KhronosGroup\glslang\External\spirv-tools\tools\val\val.cpp(276,12): error C2664: ] [C:\gitP\KhronosGroup\glslang\build_amd64\External\spirv-tools\tools\spirv-val.vcxproj]