SDL_gpu_examples icon indicating copy to clipboard operation
SDL_gpu_examples copied to clipboard

MSVC needs `/utf-8`

Open t-mat opened this issue 6 months ago • 0 comments

We can't compile SDL_gpu_examples with MSVC

cd SDL_gpu_examples
mkdir build
cd build
cmake .. -DSDL3_DIR="**PATH/TO/SDL3**"
cmake --build . --config Release
: NG

Since the following files cause MSVC error C2001

: NG
...\SDL_gpu_examples\Examples\TexturedQuad.c(189,3): error C2001
...\SDL_gpu_examples\Examples\ComputeSampler.c(48,3): error C2001

As a workaround, we can use set _CL_=/utf8

set "_CL_=/utf8"
cmake --build . --config Release
: OK

But I think it'd be nice to have /utf-8 in the CMakeLists.txt. (or SDL3Config.cmake):

add_compile_options("$<$<C_COMPILER_ID:MSVC>:/utf-8>")
add_compile_options("$<$<CXX_COMPILER_ID:MSVC>:/utf-8>")

t-mat avatar May 26 '25 05:05 t-mat