Skip to content

Commit d34d056

Browse files
committed
[CMAKE] Fix compiling i386 targets via x64 clang-cl
1 parent b114e3a commit d34d056

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

toolchain-msvc.cmake

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ if(USE_CLANG_CL)
3939
set(CMAKE_C_COMPILER_TARGET "arm64-pc-windows-msvc")
4040
set(CMAKE_CXX_COMPILER_TARGET "arm64-pc-windows-msvc")
4141
else()
42+
# -m32 is required for x64 clang-cl to operate in x86 Native Tools environment
43+
set(CMAKE_C_FLAGS "-m32")
44+
set(CMAKE_CXX_FLAGS "-m32")
4245
set(CMAKE_C_COMPILER_TARGET "i686-pc-windows-msvc")
4346
set(CMAKE_CXX_COMPILER_TARGET "i686-pc-windows-msvc")
4447
endif()

0 commit comments

Comments
 (0)