[llvm] r191015 - msbuild: Set _MSC_VER to match the CRT we're using

Reid Kleckner reid at kleckner.net
Thu Sep 19 10:18:35 PDT 2013


Author: rnk
Date: Thu Sep 19 12:18:35 2013
New Revision: 191015

URL: http://llvm.org/viewvc/llvm-project?rev=191015&view=rev
Log:
msbuild: Set _MSC_VER to match the CRT we're using

Various Windows SDK headers use _MSC_VER values to figure out what
version of the VC++ headers they're using, in particular for SAL macros.

Patch by Paul Hampson!

Modified:
    llvm/trunk/tools/msbuild/CMakeLists.txt
    llvm/trunk/tools/msbuild/Microsoft.Cpp.Win32.llvm.props.in

Modified: llvm/trunk/tools/msbuild/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/msbuild/CMakeLists.txt?rev=191015&r1=191014&r2=191015&view=diff
==============================================================================
--- llvm/trunk/tools/msbuild/CMakeLists.txt (original)
+++ llvm/trunk/tools/msbuild/CMakeLists.txt Thu Sep 19 12:18:35 2013
@@ -8,14 +8,17 @@ if (WIN32)
   set(REG_KEY "${CMAKE_PROJECT_NAME} ${CPACK_PACKAGE_VERSION}")
 
   set(VS_VERSION "v100")
+  set(MSC_VERSION "1600")
   configure_file(${prop_file_in} ${prop_file_v100})
   set(VS_VERSION "v110")
+  set(MSC_VERSION "1700")
   configure_file(${prop_file_in} ${prop_file_v110})
   set(VS_VERSION "v110_xp")
   configure_file(${prop_file_in} ${prop_file_v110_xp})
 
   set(REG_KEY)
   set(VS_VERSION)
+  set(MSC_VERSION)
   install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${prop_file_v100}" DESTINATION tools/msbuild)
   install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${prop_file_v110}" DESTINATION tools/msbuild)
   install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${prop_file_v110_xp}" DESTINATION tools/msbuild)

Modified: llvm/trunk/tools/msbuild/Microsoft.Cpp.Win32.llvm.props.in
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/msbuild/Microsoft.Cpp.Win32.llvm.props.in?rev=191015&r1=191014&r2=191015&view=diff
==============================================================================
--- llvm/trunk/tools/msbuild/Microsoft.Cpp.Win32.llvm.props.in (original)
+++ llvm/trunk/tools/msbuild/Microsoft.Cpp.Win32.llvm.props.in Thu Sep 19 12:18:35 2013
@@ -7,4 +7,11 @@
     <ExecutablePath>$(LLVMInstallDir)\msbuild-bin;$(ExecutablePath)</ExecutablePath>
     <LibraryPath>$(LLVMInstallDir)\lib\clang\3.4\lib\windows;$(LibraryPath)</LibraryPath>
   </PropertyGroup>
+
+  <ItemDefinitionGroup>
+    <ClCompile>
+      <!-- Set the value of _MSC_VER to claim for compatibility -->
+      <AdditionalOptions>-fmsc-version=@MSC_VERSION@ %(AdditionalOptions)</AdditionalOptions>
+    </ClCompile>
+  </ItemDefinitionGroup>
 </Project>





More information about the llvm-commits mailing list