diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2019-10-07 09:41:13 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2019-10-07 09:41:13 +0200 |
commit | 4d43fc686427252367576bb1a37724bb45958358 (patch) | |
tree | ccc5bef784457788a1ff5c5f93c39f5b9090b107 /libbuild2/cc/msvc.cxx | |
parent | a90eecb47438303ae3f6409276f8d9bb77c9f6fc (diff) |
Pass MSVC system library search paths to linker if LIB envvar is unset
Diffstat (limited to 'libbuild2/cc/msvc.cxx')
-rw-r--r-- | libbuild2/cc/msvc.cxx | 22 |
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; } |