From 81b96bb6f1caee90ad64c9c7c80b55c163b1f6a8 Mon Sep 17 00:00:00 2001 From: David Truby Date: Mon, 26 Oct 2020 14:45:11 +0000 Subject: [PATCH] [Aarch64] Fix assumption that Windows implies x86 When compiling for Windows on Arm the amd64 debug interfce from the Visual Studio SDK is used as the cmake currently only distinguishes between x86 and amd64 by checking the pointer size. Instead we can get the target architecture for the compilier and check that to distinguish between architectures. --- llvm/lib/DebugInfo/PDB/CMakeLists.txt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/llvm/lib/DebugInfo/PDB/CMakeLists.txt b/llvm/lib/DebugInfo/PDB/CMakeLists.txt index 9088bc8..21f8fa9 100644 --- a/llvm/lib/DebugInfo/PDB/CMakeLists.txt +++ b/llvm/lib/DebugInfo/PDB/CMakeLists.txt @@ -6,7 +6,12 @@ endmacro() if(LLVM_ENABLE_DIA_SDK) include_directories(${MSVC_DIA_SDK_DIR}/include) set(LIBPDB_LINK_FOLDERS "${MSVC_DIA_SDK_DIR}\\lib") - if (CMAKE_SIZEOF_VOID_P EQUAL 8) + + if ("$ENV{VSCMD_ARG_TGT_ARCH}" STREQUAL "arm64") + set(LIBPDB_LINK_FOLDERS "${LIBPDB_LINK_FOLDERS}\\arm64") + elseif ("$ENV{VSCMD_ARG_TGT_ARCH}" STREQUAL "arm") + set(LIBPDB_LINK_FOLDERS "${LIBPDB_LINK_FOLDERS}\\arm") + elseif (CMAKE_SIZEOF_VOID_P EQUAL 8) set(LIBPDB_LINK_FOLDERS "${LIBPDB_LINK_FOLDERS}\\amd64") endif() file(TO_CMAKE_PATH "${LIBPDB_LINK_FOLDERS}\\diaguids.lib" LIBPDB_ADDITIONAL_LIBRARIES) -- 2.7.4