summaryrefslogtreecommitdiffstats
path: root/Modules/CMakeDetermineCCompiler.cmake
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2004-01-23 17:40:03 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2004-01-23 17:40:03 (GMT)
commite7295161f79ab0a72c6db1e04a136572e4d5e4be (patch)
tree8633debf76dca5feb0555279b32ac245d10c59a7 /Modules/CMakeDetermineCCompiler.cmake
parent16711ab57cc22cd7ebd5faa94558a251cc9e7880 (diff)
downloadCMake-e7295161f79ab0a72c6db1e04a136572e4d5e4be.zip
CMake-e7295161f79ab0a72c6db1e04a136572e4d5e4be.tar.gz
CMake-e7295161f79ab0a72c6db1e04a136572e4d5e4be.tar.bz2
ENH: use CFLAGS for testing for gnu
Diffstat (limited to 'Modules/CMakeDetermineCCompiler.cmake')
-rw-r--r--Modules/CMakeDetermineCCompiler.cmake8
1 files changed, 7 insertions, 1 deletions
diff --git a/Modules/CMakeDetermineCCompiler.cmake b/Modules/CMakeDetermineCCompiler.cmake
index 4a209fd..2dc6383 100644
--- a/Modules/CMakeDetermineCCompiler.cmake
+++ b/Modules/CMakeDetermineCCompiler.cmake
@@ -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.*" )