Skip to content

Commit 81b96bb

Browse files
committed
[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.
1 parent 7819172 commit 81b96bb

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

llvm/lib/DebugInfo/PDB/CMakeLists.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,12 @@ endmacro()
66
if(LLVM_ENABLE_DIA_SDK)
77
include_directories(${MSVC_DIA_SDK_DIR}/include)
88
set(LIBPDB_LINK_FOLDERS "${MSVC_DIA_SDK_DIR}\\lib")
9-
if (CMAKE_SIZEOF_VOID_P EQUAL 8)
9+
10+
if ("$ENV{VSCMD_ARG_TGT_ARCH}" STREQUAL "arm64")
11+
set(LIBPDB_LINK_FOLDERS "${LIBPDB_LINK_FOLDERS}\\arm64")
12+
elseif ("$ENV{VSCMD_ARG_TGT_ARCH}" STREQUAL "arm")
13+
set(LIBPDB_LINK_FOLDERS "${LIBPDB_LINK_FOLDERS}\\arm")
14+
elseif (CMAKE_SIZEOF_VOID_P EQUAL 8)
1015
set(LIBPDB_LINK_FOLDERS "${LIBPDB_LINK_FOLDERS}\\amd64")
1116
endif()
1217
file(TO_CMAKE_PATH "${LIBPDB_LINK_FOLDERS}\\diaguids.lib" LIBPDB_ADDITIONAL_LIBRARIES)

0 commit comments

Comments
 (0)