ENH: use CFLAGS for testing for gnu

This commit is contained in:
Bill Hoffman 2004-01-23 12:40:03 -05:00
parent 16711ab57c
commit e7295161f7
1 changed files with 7 additions and 1 deletions

View File

@ -48,7 +48,13 @@ MARK_AS_ADVANCED(CMAKE_RANLIB)
IF(NOT CMAKE_COMPILER_IS_GNUCC_RUN)
# test to see if the c compiler is gnu
EXEC_PROGRAM(${CMAKE_C_COMPILER} ARGS ${CMAKE_C_FLAGS} -E "\"${CMAKE_ROOT}/Modules/CMakeTestGNU.c\"" OUTPUT_VARIABLE CMAKE_COMPILER_OUTPUT RETURN_VALUE CMAKE_COMPILER_RETURN)
IF(CMAKE_C_FLAGS)
SET(CMAKE_BOOT_C_FLAGS ${CMAKE_C_FLAGS})
ELSE(CMAKE_C_FLAGS)
SET(CMAKE_BOOT_C_FLAGS $ENV{CFLAGS})
ENDIF(CMAKE_C_FLAGS)
EXEC_PROGRAM(${CMAKE_C_COMPILER} ARGS ${CMAKE_BOOT_C_FLAGS} -E "\"${CMAKE_ROOT}/Modules/CMakeTestGNU.c\"" OUTPUT_VARIABLE CMAKE_COMPILER_OUTPUT RETURN_VALUE CMAKE_COMPILER_RETURN)
SET(CMAKE_COMPILER_IS_GNUCC_RUN 1)
IF(NOT CMAKE_COMPILER_RETURN)
IF("${CMAKE_COMPILER_OUTPUT}" MATCHES ".*THIS_IS_GNU.*" )