From 3e4b1dab0cdf5bc4a2613430e7e9250f2ddf60dd Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Fri, 11 Aug 2023 02:07:40 -0500 Subject: [PATCH] Add win-arm64 support (#2745) --- libmamba/include/mamba/specs/platform.hpp | 1 + libmamba/src/core/channel.cpp | 2 +- libmamba/src/specs/platform.cpp | 9 +++++++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/libmamba/include/mamba/specs/platform.hpp b/libmamba/include/mamba/specs/platform.hpp index ddb42c6456..bf6c3fbd91 100644 --- a/libmamba/include/mamba/specs/platform.hpp +++ b/libmamba/include/mamba/specs/platform.hpp @@ -31,6 +31,7 @@ namespace mamba::specs osx_arm64, win_32, win_64, + win_arm64, }; /** diff --git a/libmamba/src/core/channel.cpp b/libmamba/src/core/channel.cpp index 20ef372b1b..9dba369a4e 100644 --- a/libmamba/src/core/channel.cpp +++ b/libmamba/src/core/channel.cpp @@ -48,7 +48,7 @@ namespace mamba const std::vector KNOWN_PLATFORMS = { "noarch", "linux-32", "linux-64", "linux-aarch64", "linux-armv6l", "linux-armv7l", "linux-ppc64le", "linux-ppc64", "osx-64", "osx-arm64", - "win-32", "win-64", "zos-z" + "win-32", "win-64", "win-arm64", "zos-z" }; } // namespace diff --git a/libmamba/src/specs/platform.cpp b/libmamba/src/specs/platform.cpp index 94d00e9d9f..c3913ebb19 100644 --- a/libmamba/src/specs/platform.cpp +++ b/libmamba/src/specs/platform.cpp @@ -51,6 +51,8 @@ namespace mamba::specs return "win-32"; case Platform::win_64: return "win-64"; + case Platform::win_arm64: + return "win-arm64"; default: // All enum cases must be handled assert(false); @@ -76,6 +78,7 @@ namespace mamba::specs Platform::osx_arm64, Platform::win_32, Platform::win_64, + Platform::win_arm64, }) { if (str_clean == platform_name(p)) @@ -136,7 +139,13 @@ namespace mamba::specs #endif #elif defined(_WIN64) +#if defined(_M_AMD64) return Platform::win_64; +#elif defined(_M_ARM64) + return Platform::win_arm64; +#else +#error "Unknown Windows platform" +#endif #elif defined(_WIN32) return Platform::win_32;