]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
cmake: Use multithreaded compilation on VS 2008+
authorMatias N. Goldberg <dark_sylinc@yahoo.com.ar>
Thu, 20 May 2021 18:11:57 +0000 (15:11 -0300)
committerJay Satiro <raysatiro@yahoo.com>
Fri, 21 May 2021 07:37:37 +0000 (03:37 -0400)
Multithreaded compilation has been supported since at least VS 2005 and
been robustly stable since at least VS 2008

Closes https://github.com/curl/curl/pull/7109

CMakeLists.txt

index 549a38a6d22c4d8734c9c441f648dcd1a829de8f..63944877a99b4ae571fbe5d44b88bd978791e4e2 100644 (file)
@@ -1284,6 +1284,11 @@ if(MSVC)
   else()
     set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W4")
   endif()
+
+  # Use multithreaded compilation on VS 2008+
+  if(MSVC_VERSION GREATER_EQUAL 1500)
+    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /MP")
+  endif()
 endif()
 
 if(CURL_WERROR)