From 4ae4590b6648f020e4ca9666fcd4b0abef66741f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Gardou?= Date: Thu, 29 Apr 2021 22:28:33 +0200 Subject: [PATCH] [CMAKE] Do not define _M_AMD64 when using amd64 clang-cl --- CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ac31959a410..d1e1e82eac4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -215,7 +215,11 @@ Enable this if the module uses typeid or dynamic_cast. You will probably need to add_definitions(-DSARCH_PC98) endif() elseif(ARCH STREQUAL "amd64") - add_definitions(-D_M_AMD64 -D_AMD64_ -D__x86_64__ -D_WIN64) + # clang-cl defines this one for itself + if (NOT (MSVC AND CMAKE_C_COMPILER_ID STREQUAL "Clang")) + add_compile_definitions(_M_AMD64) + endif() + add_definitions(-D_AMD64_ -D__x86_64__ -D_WIN64) elseif(ARCH STREQUAL "arm") # _M_ARM is already defined by toolchain add_definitions(-D_ARM_ -D__arm__ -DWIN32)