ENH: use CFLAGS for testing for gnu
This commit is contained in:
parent
16711ab57c
commit
e7295161f7
|
@ -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.*" )
|
||||
|
|
Loading…
Reference in New Issue