Skip to content

Commit

Permalink
[Aarch64] Fix assumption that Windows implies x86
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
DavidTruby committed Oct 30, 2020
1 parent 7819172 commit 81b96bb
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion llvm/lib/DebugInfo/PDB/CMakeLists.txt
Expand Up @@ -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)
Expand Down

0 comments on commit 81b96bb

Please sign in to comment.