Make GetVisualStudioVersionCompiledWith private, and error out for untested versions.

Signed-off-by: Vassil Vassilev <vvasilev@cern.ch>
This commit is contained in:
Roman Zulak 2016-10-13 23:13:49 -04:00 committed by sftnight
parent 71eb51a1d2
commit b2ab0a55e0
2 changed files with 9 additions and 7 deletions

View File

@ -128,9 +128,6 @@ inline namespace windows {
std::string* WindSDK = nullptr,
std::string* UniversalSDK = nullptr,
bool Verbose = false);
///\brief Returns the VisualStudio version cling was compiled with
int GetVisualStudioVersionCompiledWith();
} // namespace windows
#endif // LLVM_ON_WIN32

View File

@ -352,11 +352,16 @@ bool GetSystemRegistryString(const char *keyPath, const char *valueName,
return returnValue;
}
int GetVisualStudioVersionCompiledWith() {
#if (_MSC_VER >= 1900)
return 14;
#endif
static int GetVisualStudioVersionCompiledWith() {
#if (_MSC_VER < 1900)
return (_MSC_VER / 100) - 6;
#elif (_MSC_VER < 1910)
return 14;
#else
#error "Unsupported/Untested _MSC_VER"
// As of now this is what is should be...have fun!
return 15;
#endif
}
static void fixupPath(std::string& Path, const char* Append = nullptr) {