Update cmakelists vs check
authorViktor Hofer <viktor.hofer@microsoft.com>
Sat, 5 Jan 2019 17:58:35 +0000 (18:58 +0100)
committerViktor Hofer <viktor.hofer@microsoft.com>
Mon, 7 Jan 2019 19:27:00 +0000 (20:27 +0100)
Commit migrated from https://github.com/dotnet/corefx/commit/bfe0055b8bfdccf4834d7ff576bae4064e90fa3e

src/libraries/Native/Windows/clrcompression/CMakeLists.txt

index 178c5f5..98c292b 100644 (file)
@@ -77,8 +77,9 @@ else()
     )
 endif()
 
-if ($ENV{__VSVersion} STREQUAL vs2017)
-    add_definitions(-DHAVE_VSNPRINTF)
+check_symbol_exists(vsnprintf stdio.h HAVE_VSNPRINTF)
+if (HAVE_VSNPRINTF) # HAVE_VSNPRINTF is CMAKE variable, compiler doesn't know about it yet
+    add_definitions(-DHAVE_VSNPRINTF) # this is for the compiler
 endif ()
 
 #Include Brotli include files