@@ -64,6 +64,30 @@ IS_WSL=`echo $UNAME_RELEASE | grep Microsoft`
6464IS_MSYS=` echo $UNAME_OS | grep -i Msys`
6565MSYS2_ARG_CONV_EXCL=" *" # make "cmd.exe /c" work for msys2
6666CMD_EXE=" cmd.exe /c"
67+
68+ # Detect host architecture to determine devkit platform support
69+ # Note: The devkit always includes x86, x64, and aarch64 libraries and tools
70+ # The difference is in toolchain capabilities:
71+ # - On x64|AMD64 hosts: aarch64 tools are cross-compilation tools (Hostx64/arm64)
72+ # - On aarch64|ARMv8 hosts: aarch64 tools are native tools (Hostarm64/arm64)
73+ HOST_ARCH=` echo $PROCESSOR_IDENTIFIER `
74+ case $HOST_ARCH in
75+ AMD64)
76+ echo " Running on x64 host - generating devkit with native x86/x64 tools and cross-compiled aarch64 tools."
77+ echo " For native aarch64 compilation tools, run this script on a Windows/aarch64 machine."
78+ SUPPORTED_PLATFORMS=" x86, x64 (native) and aarch64 (cross-compiled)"
79+ ;;
80+ ARMv8)
81+ echo " Running on aarch64 host - generating devkit with native tools for all platforms (x86, x64, aarch64)."
82+ SUPPORTED_PLATFORMS=" x86, x64, and aarch64 (all native)"
83+ ;;
84+ * )
85+ echo " Unknown host architecture: $HOST_ARCH "
86+ echo " Proceeding with devkit generation - toolchain capabilities may vary."
87+ SUPPORTED_PLATFORMS=" x86, x64, and aarch64"
88+ ;;
89+ esac
90+
6791if test " x$IS_CYGWIN " ! = " x" ; then
6892 BUILD_ENV=" cygwin"
6993elif test " x$IS_MSYS " ! = " x" ; then
@@ -139,6 +163,7 @@ DEVKIT_ROOT="${BUILD_DIR}/VS${VS_VERSION}-${VS_VERSION_SP}-devkit"
139163DEVKIT_BUNDLE=" ${DEVKIT_ROOT} .tar.gz"
140164
141165echo " Creating devkit in $DEVKIT_ROOT "
166+ echo " Platform support: $SUPPORTED_PLATFORMS "
142167
143168MSVCR_DLL=${MSVC_CRT_DIR} /vcruntime${VS_DLL_VERSION} .dll
144169VCRUNTIME_1_DLL=${MSVC_CRT_DIR} /vcruntime${VS_DLL_VERSION} _1.dll
@@ -156,7 +181,11 @@ REDIST_SUBDIR="VC/Redist/MSVC/$REDIST_VERSION"
156181echo " Copying VC..."
157182rm -rf $DEVKIT_ROOT /VC
158183mkdir -p $DEVKIT_ROOT /VC/bin
159- cp -r " $VS_INSTALL_DIR /${VC_SUBDIR} /bin/Hostx64/arm64" $DEVKIT_ROOT /VC/bin/
184+ if [ -d " $VS_INSTALL_DIR /${VC_SUBDIR} /bin/Hostarm64/arm64" ]; then
185+ cp -r " $VS_INSTALL_DIR /${VC_SUBDIR} /bin/Hostarm64/arm64" $DEVKIT_ROOT /VC/bin/
186+ else
187+ cp -r " $VS_INSTALL_DIR /${VC_SUBDIR} /bin/Hostx64/arm64" $DEVKIT_ROOT /VC/bin/
188+ fi
160189cp -r " $VS_INSTALL_DIR /${VC_SUBDIR} /bin/Hostx64/x64" $DEVKIT_ROOT /VC/bin/
161190cp -r " $VS_INSTALL_DIR /${VC_SUBDIR} /bin/Hostx86/x86" $DEVKIT_ROOT /VC/bin/
162191mkdir -p $DEVKIT_ROOT /VC/lib
0 commit comments