diff options
author | Brad King <brad.king@kitware.com> | 2008-02-11 22:00:54 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2008-02-11 22:00:54 (GMT) |
commit | a75079d9e08c0325a0165f2dbfc10e5c1fa61eec (patch) | |
tree | d93267be4ab59d4e4881faa25f7ae1094489cfcc /Modules | |
parent | 3fdf141197210532446d345c482303d0ffac13a1 (diff) | |
download | CMake-a75079d9e08c0325a0165f2dbfc10e5c1fa61eec.zip CMake-a75079d9e08c0325a0165f2dbfc10e5c1fa61eec.tar.gz CMake-a75079d9e08c0325a0165f2dbfc10e5c1fa61eec.tar.bz2 |
ENH: When detecting the compiler id try compiling only to an object file.
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/CMakeDetermineCCompiler.cmake | 8 | ||||
-rw-r--r-- | Modules/CMakeDetermineCXXCompiler.cmake | 8 | ||||
-rw-r--r-- | Modules/CMakeDetermineFortranCompiler.cmake | 3 |
3 files changed, 19 insertions, 0 deletions
diff --git a/Modules/CMakeDetermineCCompiler.cmake b/Modules/CMakeDetermineCCompiler.cmake index 610ec6c..3ae9ba2 100644 --- a/Modules/CMakeDetermineCCompiler.cmake +++ b/Modules/CMakeDetermineCCompiler.cmake @@ -112,6 +112,14 @@ ENDIF(${CMAKE_GENERATOR} MATCHES "Visual Studio") IF(NOT CMAKE_C_COMPILER_ID_RUN) SET(CMAKE_C_COMPILER_ID_RUN 1) + # Each entry in this list is a set of extra flags to try + # adding to the compile line to see if it helps produce + # a valid identification file. + SET(CMAKE_C_COMPILER_ID_TEST_FLAGS + # Try compiling to an object file only. + "-c" + ) + # Try to identify the compiler. SET(CMAKE_C_COMPILER_ID) INCLUDE(${CMAKE_ROOT}/Modules/CMakeDetermineCompilerId.cmake) diff --git a/Modules/CMakeDetermineCXXCompiler.cmake b/Modules/CMakeDetermineCXXCompiler.cmake index 2286bfa..d354165 100644 --- a/Modules/CMakeDetermineCXXCompiler.cmake +++ b/Modules/CMakeDetermineCXXCompiler.cmake @@ -122,6 +122,14 @@ ENDIF(${CMAKE_GENERATOR} MATCHES "Visual Studio") IF(NOT CMAKE_CXX_COMPILER_ID_RUN) SET(CMAKE_CXX_COMPILER_ID_RUN 1) + # Each entry in this list is a set of extra flags to try + # adding to the compile line to see if it helps produce + # a valid identification file. + SET(CMAKE_CXX_COMPILER_ID_TEST_FLAGS + # Try compiling to an object file only. + "-c" + ) + # Try to identify the compiler. SET(CMAKE_CXX_COMPILER_ID) INCLUDE(${CMAKE_ROOT}/Modules/CMakeDetermineCompilerId.cmake) diff --git a/Modules/CMakeDetermineFortranCompiler.cmake b/Modules/CMakeDetermineFortranCompiler.cmake index bb80e6f..1f2ce80 100644 --- a/Modules/CMakeDetermineFortranCompiler.cmake +++ b/Modules/CMakeDetermineFortranCompiler.cmake @@ -84,6 +84,9 @@ IF(NOT CMAKE_Fortran_COMPILER_ID_RUN) # adding to the compile line to see if it helps produce # a valid identification executable. SET(CMAKE_Fortran_COMPILER_ID_TEST_FLAGS + # Try compiling to an object file only. + "-c" + # Intel on windows does not preprocess by default. "-fpp" ) |