Browse Source

Remove partially implemented attempt to copy VS2015 c runtime system dlls, add support for VS2017

Alex Szpakowski 8 years ago
parent
commit
7140763fce
1 changed files with 6 additions and 21 deletions
  1. 6 21
      CMakeLists.txt

+ 6 - 21
CMakeLists.txt

@@ -67,11 +67,13 @@ endfunction()
 
 # Look for dynamic runtime DLLs.
 if(MSVC)
-	if(MSVC14)
+	if(MSVC_VERSION EQUAL 1910)
+		set(VSVERSION "141")
+	elseif(MSVC_VERSION EQUAL 1900)
 		set(VSVERSION "140")
-	elseif(MSVC12)
+	elseif(MSVC_VERSION EQUAL 1800)
 		set(VSVERSION "120")
-	elseif(MSVC11 OR MSVC10)
+	elseif(MSVC_VERSION LESS 1800)
 		message(WARNING "Visual Studio 2013 (VS12) or newer is required!")
 	else()
 		message(WARNING "Cannot determine Visual Studio version!")
@@ -85,11 +87,10 @@ if(MSVC)
 	else()
 		get_filename_component(VS_REDIST_DIR ${VSCOMNTOOLS}/../../VC/redist/${MEGA_ARCH}/Microsoft.VC${VSVERSION}.CRT ABSOLUTE)
 		set(MSVCP_DLL ${VS_REDIST_DIR}/msvcp${VSVERSION}.dll)
-		if(MSVC12)
+		if(MSVC_VERSION EQUAL 1800)
 			set(MSVCR_DLL ${VS_REDIST_DIR}/msvcr${VSVERSION}.dll)
 		else()
 			set(MSVCR_DLL ${VS_REDIST_DIR}/vcruntime${VSVERSION}.dll)
-			# TODO: add ucrtbase.dll from Program Files (x86)\Windows Kits\10\Redist\ucrt\ ($(UniversalCRT_LibraryPath_${MEGA_ARCH}))
 		endif()
 
 		if (EXISTS ${MSVCP_DLL} AND EXISTS ${MSVCR_DLL})
@@ -99,22 +100,6 @@ if(MSVC)
 			message(WARNING "Could not find Visual C and C++ runtime .dll files")
 		endif()
 
-		# FIXME: Find some way to avoid hard-coding the version and paths here...
-		if(MSVC14)
-			get_filename_component(UCRT_DIR "${VSCOMNTOOLS}/../../../Windows Kits/10" ABSOLUTE)
-			if(EXISTS ${UCRT_DIR})
-				set(UCRT_DLL ${UCRT_DIR}/Redist/ucrt/DLLs/${MEGA_ARCH}/ucrtbase.dll)
-				if(EXISTS ${UCRT_DLL})
-					set(MEGA_MSVC_DLLS ${MEGA_MSVC_DLLS} ${UCRT_DLL})
-					message(STATUS "Found universal C runtime .dll")
-				else()
-					message(STATUS "Could not find universal C runtime .dll")
-				endif()
-			else()
-				message(STATUS "Could not find universal C runtime folder")
-			endif()
-		endif()
-
 		# Find vcvarsall.bat.
 		get_filename_component(VS_VCVARSALL_BAT ${VSCOMNTOOLS}/../../VC/vcvarsall.bat ABSOLUTE)