Skip to content

MSVC needs /utf-8 #61

@t-mat

Description

@t-mat

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>")

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions