From: Augustin Degomme Date: Mon, 7 Oct 2013 14:59:36 +0000 (+0200) Subject: On windows, try_compile may use another compiler than the one we want. X-Git-Tag: v3_9_90~38^2~29 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/ed1a037a0ad906be8dd0300a38a8e7ec588dc448 On windows, try_compile may use another compiler than the one we want. Replace it by execute_process of the right compiler --- diff --git a/buildtools/Cmake/CompleteInFiles.cmake b/buildtools/Cmake/CompleteInFiles.cmake index c8ce144b92..ab90b6d761 100644 --- a/buildtools/Cmake/CompleteInFiles.cmake +++ b/buildtools/Cmake/CompleteInFiles.cmake @@ -532,7 +532,7 @@ if(HAVE_MAKECONTEXT OR WIN32) else() set(makecontext_CPPFLAGS "-DTEST_makecontext -D_AMD64_") endif() - set(makecontext_CPPFLAGS_2 "-D_XBT_WIN32 -I${CMAKE_HOME_DIRECTORY}/include/xbt -I${CMAKE_HOME_DIRECTORY}/src/xbt") + set(makecontext_CPPFLAGS_2 "-D_XBT_WsystemIN32 -I${CMAKE_HOME_DIRECTORY}/include/xbt -I${CMAKE_HOME_DIRECTORY}/src/xbt") endif() file(REMOVE ${CMAKE_BINARY_DIR}/conftestval) @@ -640,11 +640,16 @@ int main(void) exit(0); }" ) - try_compile(COMPILE_VA_NULL_VAR - ${CMAKE_BINARY_DIR} - ${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/test_prog/prog_va_copy.c - ) - if(COMPILE_VA_NULL_VAR) + + execute_process( + COMMAND ${CMAKE_C_COMPILER} "${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/test_prog/prog_va_copy.c" + WORKING_DIRECTORY ${CMAKE_BINARY_DIR} + RESULT_VARIABLE COMPILE_VA_NULL_VAR + OUTPUT_QUIET + ERROR_QUIET + ) + + if(NOT COMPILE_VA_NULL_VAR) string(REGEX REPLACE "\;" "" fctbis ${fct}) if(${fctbis} STREQUAL "va_copy((d),(s))") set(HAVE_VA_COPY 1)