From: Gabriel Corona Date: Thu, 10 Sep 2015 08:28:47 +0000 (+0200) Subject: [mingw] Use __USE_MINGW_ANSI_STDIO when checking for functions X-Git-Tag: v3_12~264^2 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/705a594f8781bc7eccadb7adecd884476351f4b8 [mingw] Use __USE_MINGW_ANSI_STDIO when checking for functions Otherwise, SimGrid will think it need to defined its own aprintf() event if it is defined by MinGW. --- diff --git a/tools/cmake/CompleteInFiles.cmake b/tools/cmake/CompleteInFiles.cmake index 1b37d52ce3..30b005a263 100644 --- a/tools/cmake/CompleteInFiles.cmake +++ b/tools/cmake/CompleteInFiles.cmake @@ -150,6 +150,11 @@ if(CMAKE_SYSTEM_NAME MATCHES "Darwin") set(CMAKE_REQUIRED_DEFINITIONS "-D_XOPEN_SOURCE=700 -D_DARWIN_C_SOURCE") endif() +if(MINGW) + add_definitions(-D__USE_MINGW_ANSI_STDIO=1) + set(CMAKE_REQUIRED_DEFINITIONS "-D__USE_MINGW_ANSI_STDIO=1") +endif() + CHECK_INCLUDE_FILES("time.h;sys/time.h" TIME_WITH_SYS_TIME) CHECK_INCLUDE_FILES("stdlib.h;stdarg.h;string.h;float.h" STDC_HEADERS) CHECK_INCLUDE_FILE("pthread.h" HAVE_PTHREAD_H) diff --git a/tools/cmake/Flags.cmake b/tools/cmake/Flags.cmake index e0033bcc23..872fe659fe 100644 --- a/tools/cmake/Flags.cmake +++ b/tools/cmake/Flags.cmake @@ -149,7 +149,3 @@ if(NOT $ENV{LDFLAGS} STREQUAL "") message(STATUS "Add LDFLAGS: \"$ENV{LDFLAGS}\" to CMAKE_C_LINK_FLAGS") set(CMAKE_C_LINK_FLAGS "${CMAKE_C_LINK_FLAGS} $ENV{LDFLAGS}") endif() - -if(MINGW) - add_definitions(-D__USE_MINGW_ANSI_STDIO=1) -endif()