Skip to content

Commit

Permalink
Since some time clang itself figures out the default for ms-compatibi…
Browse files Browse the repository at this point in the history
…lity-version and uses it. Trying to figure it out during build is redundant and also will not work when the environment variable VSINSTALLDIR is not defined (which is not defined if you don't install whole Visual Studio but use Visual C++ Build Tools package).

Tested by bootstrapping clang with clang-cl.

Differential Revision: http://reviews.llvm.org/D20672

llvm-svn: 270860
  • Loading branch information
ismail committed May 26, 2016
1 parent b49c336 commit a1c8c60
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions llvm/cmake/modules/HandleLLVMOptions.cmake
Expand Up @@ -352,19 +352,6 @@ if( MSVC )
# "Enforce type conversion rules".
append("/Zc:rvalueCast" CMAKE_CXX_FLAGS)

if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
# Find and run MSVC (not clang-cl) and get its version. This will tell
# clang-cl what version of MSVC to pretend to be so that the STL works.
execute_process(COMMAND "$ENV{VSINSTALLDIR}/VC/bin/cl.exe"
OUTPUT_QUIET
ERROR_VARIABLE MSVC_COMPAT_VERSION
)
string(REGEX REPLACE "^.*Compiler Version ([0-9.]+) for .*$" "\\1"
MSVC_COMPAT_VERSION "${MSVC_COMPAT_VERSION}")
append("-fms-compatibility-version=${MSVC_COMPAT_VERSION}"
CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
endif()

if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
# clang-cl and cl by default produce non-deterministic binaries because
# link.exe /incremental requires a timestamp in the .obj file. clang-cl
Expand Down

0 comments on commit a1c8c60

Please sign in to comment.