From: Joseph Ates Date: Sat, 23 Jan 2016 10:14:04 +0000 (-0500) Subject: cmocka: Add VS2015 support X-Git-Tag: cmocka-1.1.1~22 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c35d3edecac0b5e5884f9e26ba9cf73753279ea3;p=platform%2Fupstream%2Fcmocka.git cmocka: Add VS2015 support Visual Studio now includes support for vsnprintf and snprintf but does so as an inline functions. check_symbol_exists is used to check for its existence within stdio. [3] All tests are passing when run from within the IDE or via NMake. Command line builds via msbuild seem to error for the first few example tests. Reviewed-by: Andreas Schneider --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 70a8ad1..4507444 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -34,6 +34,7 @@ include(DefineCompilerFlags) include(DefineInstallationPaths) include(DefineOptions.cmake) include(CPackConfig.cmake) +include(CheckSymbolExists) # disallow in-source build include(MacroEnsureOutOfSourceBuild) diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake index c82f099..c2064dd 100644 --- a/ConfigureChecks.cmake +++ b/ConfigureChecks.cmake @@ -84,9 +84,7 @@ check_function_exists(printf HAVE_PRINTF) check_function_exists(setjmp HAVE_SETJMP) check_function_exists(signal HAVE_SIGNAL) check_function_exists(strsignal HAVE_STRSIGNAL) -check_function_exists(sprintf HAVE_SNPRINTF) check_function_exists(strcmp HAVE_STRCMP) -check_function_exists(vsnprintf HAVE_VSNPRINTF) check_function_exists(clock_gettime HAVE_CLOCK_GETTIME) if (WIN32) @@ -94,6 +92,11 @@ if (WIN32) check_function_exists(_vsnprintf HAVE__VSNPRINTF) check_function_exists(_snprintf HAVE__SNPRINTF) check_function_exists(_snprintf_s HAVE__SNPRINTF_S) + check_symbol_exists(snprintf stdio.h HAVE_SNPRINTF) + check_symbol_exists(vsnprintf stdio.h HAVE_VSNPRINTF) +else (WIN32) + check_function_exists(sprintf HAVE_SNPRINTF) + check_function_exists(vsnprintf HAVE_VSNPRINTF) endif (WIN32) find_library(RT_LIBRARY rt)