aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/cc/msvc.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'libbuild2/cc/msvc.cxx')
-rw-r--r--libbuild2/cc/msvc.cxx22
1 files changed, 21 insertions, 1 deletions
diff --git a/libbuild2/cc/msvc.cxx b/libbuild2/cc/msvc.cxx
index 2d53b69..e7251ac 100644
--- a/libbuild2/cc/msvc.cxx
+++ b/libbuild2/cc/msvc.cxx
@@ -28,6 +28,25 @@ namespace build2
{
using namespace bin;
+ // Translate the target triplet CPU to MSVC CPU (used in directory names,
+ // etc).
+ //
+ const char*
+ msvc_cpu (const string& cpu)
+ {
+ const char* m (cpu == "i386" || cpu == "i686" ? "x86" :
+ cpu == "x86_64" ? "x64" :
+ cpu == "arm" ? "arm" :
+ cpu == "arm64" ? "arm64" :
+ nullptr);
+
+ if (m == nullptr)
+ fail << "unable to translate target triplet CPU " << cpu
+ << " to MSVC CPU";
+
+ return m;
+ }
+
// Translate the target triplet CPU to lib.exe/link.exe /MACHINE option.
//
const char*
@@ -40,7 +59,8 @@ namespace build2
nullptr);
if (m == nullptr)
- fail << "unable to translate CPU " << cpu << " to /MACHINE";
+ fail << "unable to translate target triplet CPU " << cpu
+ << " to /MACHINE";
return m;
}