diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2016-07-22 16:20:21 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2016-07-22 16:20:21 +0200 |
commit | 77869a0567f4c2e029c679525b29da53433d8d9f (patch) | |
tree | 602114470f105f5d90c46477fd3c142f8f25bd03 /build2/cxx/msvc.cxx | |
parent | 77c763542d2effdd6e76a23893c10dbaadfe70ae (diff) |
Factor target CPU to VC /MACHINE option translation
Diffstat (limited to 'build2/cxx/msvc.cxx')
-rw-r--r-- | build2/cxx/msvc.cxx | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/build2/cxx/msvc.cxx b/build2/cxx/msvc.cxx index ff91018..97d8fd5 100644 --- a/build2/cxx/msvc.cxx +++ b/build2/cxx/msvc.cxx @@ -20,6 +20,23 @@ namespace build2 { using namespace bin; + // Translate the target triplet CPU to lib.exe/link.exe /MACHINE option. + // + const char* + msvc_machine (const string& cpu) + { + const char* m (cpu == "i386" || cpu == "i686" ? "/MACHINE:x86" : + cpu == "x86_64" ? "/MACHINE:x64" : + cpu == "arm" ? "/MACHINE:ARM" : + cpu == "arm64" ? "/MACHINE:ARM64" : + nullptr); + + if (m == nullptr) + fail << "unable to translate CPU " << cpu << " to /MACHINE"; + + return m; + } + // Extract system library search paths from MSVC. // void |