aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/cc
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2024-09-30 14:41:22 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2024-09-30 14:41:22 +0200
commit9f7789ffdae2ea0aa5a3b389ca9745ff160fa60f (patch)
tree79e9759013f755a06cd107a30d1e80cfe8cf0b96 /libbuild2/cc
parent9a7904fc891c9fe7a48e6f53707100983574118c (diff)
Fix issues in MSVC ARM64 support
Diffstat (limited to 'libbuild2/cc')
-rw-r--r--libbuild2/cc/guess.cxx21
-rw-r--r--libbuild2/cc/msvc.cxx12
2 files changed, 22 insertions, 11 deletions
diff --git a/libbuild2/cc/guess.cxx b/libbuild2/cc/guess.cxx
index f092933..406534d 100644
--- a/libbuild2/cc/guess.cxx
+++ b/libbuild2/cc/guess.cxx
@@ -949,9 +949,15 @@ namespace build2
// there is nothing like -m32/-m64 or /MACHINE). Targeting
// 64-bit seems like as good of a default as any.
//
- fb = ((dir_path (mi->msvc_dir) /= "bin") /= "Hostx64") /=
- "x64";
-
+ fb = dir_path (mi->msvc_dir) /= "bin";
+
+#if defined(_M_ARM64) || defined(__aarch64__)
+ fb /= "HostARM64";
+ fb /= "ARM64";
+#else
+ fb /= "Hostx64";
+ fb /= "x64";
+#endif
search_info = info_ptr (
new msvc_info (move (*mi)), msvc_info_deleter);
}
@@ -1631,8 +1637,13 @@ namespace build2
// MSVC tools (link.exe, etc). In case of the Platform SDK, it's unclear
// what the CPU signifies (host, target, both).
//
- r = (((dir_path (mi.msvc_dir) /= "bin") /= "Hostx64") /= cpu).
- representation ();
+ r = (((dir_path (mi.msvc_dir) /= "bin") /=
+#if defined(_M_ARM64) || defined(__aarch64__)
+ "HostARM64"
+#else
+ "Hostx64"
+#endif
+ ) /= cpu).representation ();
r += path::traits_type::path_separator;
diff --git a/libbuild2/cc/msvc.cxx b/libbuild2/cc/msvc.cxx
index d21969c..416df36 100644
--- a/libbuild2/cc/msvc.cxx
+++ b/libbuild2/cc/msvc.cxx
@@ -33,10 +33,10 @@ namespace build2
const char*
msvc_cpu (const string& cpu)
{
- const char* m (cpu == "i386" || cpu == "i686" ? "x86" :
- cpu == "x86_64" ? "x64" :
+ const char* m (cpu == "x86_64" ? "x64" :
+ cpu == "i386" || cpu == "i686" ? "x86" :
+ cpu == "aarch64" ? "arm64" :
cpu == "arm" ? "arm" :
- cpu == "arm64" ? "arm64" :
nullptr);
if (m == nullptr)
@@ -51,10 +51,10 @@ namespace build2
const char*
msvc_machine (const string& cpu)
{
- const char* m (cpu == "i386" || cpu == "i686" ? "/MACHINE:x86" :
- cpu == "x86_64" ? "/MACHINE:x64" :
+ const char* m (cpu == "x86_64" ? "/MACHINE:x64" :
+ cpu == "i386" || cpu == "i686" ? "/MACHINE:x86" :
+ cpu == "aarch64" ? "/MACHINE:ARM64" :
cpu == "arm" ? "/MACHINE:ARM" :
- cpu == "arm64" ? "/MACHINE:ARM64" :
nullptr);
if (m == nullptr)