]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
cmake: limit `CURL_STATIC_CRT` to MSVC
authorViktor Szakats <commit@vsz.me>
Thu, 24 Oct 2024 14:50:33 +0000 (16:50 +0200)
committerViktor Szakats <commit@vsz.me>
Thu, 24 Oct 2024 17:16:10 +0000 (19:16 +0200)
`CURL_STATIC_CRT` supports MSVC only. Limit its effect to this compiler.

Closes #15403

CMakeLists.txt

index 58bd67b08ccd49d1d646d0f2aa0657affb74ca3b..f40801eedabee2552ea9a40d769abfb99cc414f0 100644 (file)
@@ -156,8 +156,8 @@ option(ENABLE_ARES "Enable c-ares support" OFF)
 option(CURL_DISABLE_INSTALL "Disable installation targets" OFF)
 
 if(WIN32)
-  option(CURL_STATIC_CRT "Build libcurl with static CRT on Windows (/MT)" OFF)
-  if(CURL_STATIC_CRT)
+  option(CURL_STATIC_CRT "Build libcurl with static CRT with MSVC (/MT)" OFF)
+  if(CURL_STATIC_CRT AND MSVC)
     set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
     set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /MT")
     set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /MTd")