@@ -195,7 +195,10 @@ if(NOT MSVC_IDE)
195195endif ()
196196
197197if (MSVC )
198- if (CMAKE_SIZEOF_VOID_P EQUAL 8)
198+ if ($ENV{VSCMD_ARG_TGT_ARCH} STREQUAL "arm64" )
199+ message (STATUS "Let D host compiler output arm64 object files" )
200+ append ("-mtriple=aarch64-windows-msvc" DFLAGS_BASE)
201+ elseif (CMAKE_SIZEOF_VOID_P EQUAL 8)
199202 message (STATUS "Let D host compiler output 64-bit object files" )
200203 append ("-m64" DFLAGS_BASE)
201204 else ()
@@ -300,7 +303,9 @@ endif()
300303if (MSVC )
301304 separate_arguments (LLVM_LDFLAGS WINDOWS_COMMAND "${LLVM_LDFLAGS} " )
302305 if (NOT MSVC_IDE ) # apparently not needed for VS (and spaces in path are problematic)
303- if (CMAKE_SIZEOF_VOID_P EQUAL 8)
306+ if ($ENV{VSCMD_ARG_TGT_ARCH} STREQUAL "arm64" )
307+ list (APPEND LLVM_LDFLAGS "$ENV{VSINSTALLDIR} DIA SDK\\ lib\\ arm64\\ diaguids.lib" )
308+ elseif (CMAKE_SIZEOF_VOID_P EQUAL 8)
304309 list (APPEND LLVM_LDFLAGS "$ENV{VSINSTALLDIR} DIA SDK\\ lib\\ amd64\\ diaguids.lib" )
305310 else ()
306311 list (APPEND LLVM_LDFLAGS "$ENV{VSINSTALLDIR} DIA SDK\\ lib\\ diaguids.lib" )
@@ -895,7 +900,9 @@ if (LDC_INSTALL_LLVM_RUNTIME_LIBS)
895900 copy_compilerrt_lib("libclang_rt.xray-profiling${compilerrt_suffix} .a" "libldc_rt.xray-profiling.a" FALSE )
896901 elseif (WIN32 )
897902 set (compilerrt_arch_suffix "x86_64" )
898- if (CMAKE_SIZEOF_VOID_P EQUAL 4)
903+ if ($ENV{VSCMD_ARG_TGT_ARCH} STREQUAL "arm64" )
904+ set (compilerrt_arch_suffix "aarch64" )
905+ elseif (CMAKE_SIZEOF_VOID_P EQUAL 4)
899906 set (compilerrt_arch_suffix "i386" )
900907 endif ()
901908 if (LDC_LLVM_VER LESS 2000)
0 commit comments