summaryrefslogtreecommitdiffstats
path: root/Modules/CMakeDetermineCCompiler.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/CMakeDetermineCCompiler.cmake')
-rw-r--r--Modules/CMakeDetermineCCompiler.cmake3
1 files changed, 3 insertions, 0 deletions
diff --git a/Modules/CMakeDetermineCCompiler.cmake b/Modules/CMakeDetermineCCompiler.cmake
index 4317ecf..c4dfa11 100644
--- a/Modules/CMakeDetermineCCompiler.cmake
+++ b/Modules/CMakeDetermineCCompiler.cmake
@@ -11,6 +11,9 @@ IF(NOT CMAKE_C_COMPILER)
# prefer the environment variable CC
IF($ENV{CC} MATCHES ".+")
GET_FILENAME_COMPONENT(CMAKE_C_COMPILER_INIT $ENV{CC} PROGRAM PROGRAM_ARGS CMAKE_C_FLAGS_ENV_INIT)
+ IF(CMAKE_C_FLAGS_ENV_INIT)
+ SET(CMAKE_C_COMPILER_ARG1 ${CMAKE_C_FLAGS_ENV_INIT} CACHE STRING "First argument to C compiler")
+ ENDIF(CMAKE_C_FLAGS_ENV_INIT)
IF(EXISTS ${CMAKE_C_COMPILER_INIT})
ELSE(EXISTS ${CMAKE_C_COMPILER_INIT})
MESSAGE(FATAL_ERROR "Could not find compiler set in environment variable CC:\n$ENV{CC}.")