Pass -fms-compatibility-version when building test inferiors.

-fms-compatibility-version defaults to VS 2013.  When using
VS 2015, this will lead to compilation failures of the test
inferiors in the C++ standard library for language conformance
reasons.

The fix here is to simply pass -fms-compatibility-version=19.0 when
we detect that a VS 2015 compiler is present.  Even though we're
actually using clang to do the compilation, clang uses this same
detection algorithm to determine the location of the standard
library.  So this check is tantanmount to saying "If clang is going
to find MSVC 2015's standard library, then pass 19.0 for
-fms-compatibility-version.

llvm-svn: 253589
This commit is contained in:
Zachary Turner 2015-11-19 19:10:54 +00:00
parent 4bc5ad4c37
commit 7aac24805b
1 changed files with 3 additions and 0 deletions

View File

@ -253,6 +253,9 @@ ifeq "$(OS)" "Windows_NT"
# Clang for Windows doesn't support C++ Exceptions
CXXFLAGS += -fno-exceptions
CXXFLAGS += -D_HAS_EXCEPTIONS=0
ifeq "$(VisualStudioVersion)" "14.0"
CXXFLAGS += -fms-compatibility-version=19.0
endif
# The MSVC linker doesn't understand long section names
# generated by the clang compiler.
LDFLAGS += -fuse-ld=lld