[CMAKE] Fix compiling i386 targets via x64 clang-cl

This commit is contained in:
Vitaly Orekhov 2025-01-06 16:00:15 +03:00 committed by Timo Kreuzer
parent 97ea95c80c
commit 7215e542b1

View file

@ -39,6 +39,9 @@ if(USE_CLANG_CL)
set(CMAKE_C_COMPILER_TARGET "arm64-pc-windows-msvc")
set(CMAKE_CXX_COMPILER_TARGET "arm64-pc-windows-msvc")
else()
# -m32 is required for x64 clang-cl to operate in x86 Native Tools environment
set(CMAKE_C_FLAGS "-m32")
set(CMAKE_CXX_FLAGS "-m32")
set(CMAKE_C_COMPILER_TARGET "i686-pc-windows-msvc")
set(CMAKE_CXX_COMPILER_TARGET "i686-pc-windows-msvc")
endif()