BUG: When forcing the C and CXX compilers do not try to detect the ABI information. Cleanup configured language compiler info files by always using @ONLY. This addresses bug#6297.

This commit is contained in:
Brad King 2008-02-03 17:24:50 -05:00
parent dc06ac5881
commit bbbb2be765
6 changed files with 38 additions and 24 deletions

View File

@ -132,6 +132,7 @@ INCLUDE(CMakeFindBinUtils)
# configure variables set in this file for fast reload later on # configure variables set in this file for fast reload later on
CONFIGURE_FILE(${CMAKE_ROOT}/Modules/CMakeCCompiler.cmake.in CONFIGURE_FILE(${CMAKE_ROOT}/Modules/CMakeCCompiler.cmake.in
"${CMAKE_PLATFORM_ROOT_BIN}/CMakeCCompiler.cmake" IMMEDIATE) "${CMAKE_PLATFORM_ROOT_BIN}/CMakeCCompiler.cmake"
@ONLY)
SET(CMAKE_C_COMPILER_ENV_VAR "CC") SET(CMAKE_C_COMPILER_ENV_VAR "CC")

View File

@ -142,6 +142,7 @@ INCLUDE(CMakeFindBinUtils)
# configure all variables set in this file # configure all variables set in this file
CONFIGURE_FILE(${CMAKE_ROOT}/Modules/CMakeCXXCompiler.cmake.in CONFIGURE_FILE(${CMAKE_ROOT}/Modules/CMakeCXXCompiler.cmake.in
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeCXXCompiler.cmake IMMEDIATE) ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeCXXCompiler.cmake
@ONLY)
SET(CMAKE_CXX_COMPILER_ENV_VAR "CXX") SET(CMAKE_CXX_COMPILER_ENV_VAR "CXX")

View File

@ -135,5 +135,6 @@ INCLUDE(CMakeFindBinUtils)
# configure variables set in this file for fast reload later on # configure variables set in this file for fast reload later on
CONFIGURE_FILE(${CMAKE_ROOT}/Modules/CMakeFortranCompiler.cmake.in CONFIGURE_FILE(${CMAKE_ROOT}/Modules/CMakeFortranCompiler.cmake.in
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeFortranCompiler.cmake IMMEDIATE) ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeFortranCompiler.cmake
@ONLY)
SET(CMAKE_Fortran_COMPILER_ENV_VAR "FC") SET(CMAKE_Fortran_COMPILER_ENV_VAR "FC")

View File

@ -38,14 +38,14 @@ MACRO(CMAKE_FORCE_C_COMPILER compiler id sizeof_void)
SET(CMAKE_C_COMPILER_ID_RUN TRUE) SET(CMAKE_C_COMPILER_ID_RUN TRUE)
SET(CMAKE_C_COMPILER_ID ${id}) SET(CMAKE_C_COMPILER_ID ${id})
SET(CMAKE_C_COMPILER_WORKS TRUE) SET(CMAKE_C_COMPILER_WORKS TRUE)
SET(CMAKE_C_COMPILER_FORCED TRUE)
# Set old compiler and platform id variables. # Set old compiler and platform id variables.
IF("${CMAKE_C_COMPILER_ID}" MATCHES "GNU") IF("${CMAKE_C_COMPILER_ID}" MATCHES "GNU")
SET(CMAKE_COMPILER_IS_GNUCC 1) SET(CMAKE_COMPILER_IS_GNUCC 1)
ENDIF("${CMAKE_C_COMPILER_ID}" MATCHES "GNU") ENDIF("${CMAKE_C_COMPILER_ID}" MATCHES "GNU")
SET(CMAKE_SIZEOF_VOID_P ${sizeof_void} CACHE STRING "sizeof void") SET(CMAKE_C_SIZEOF_DATA_PTR ${sizeof_void})
SET(HAVE_CMAKE_SIZEOF_VOID_P TRUE CACHE INTERNAL "have sizeof void")
ENDMACRO(CMAKE_FORCE_C_COMPILER) ENDMACRO(CMAKE_FORCE_C_COMPILER)
MACRO(CMAKE_FORCE_CXX_COMPILER compiler id) MACRO(CMAKE_FORCE_CXX_COMPILER compiler id)
@ -53,6 +53,7 @@ MACRO(CMAKE_FORCE_CXX_COMPILER compiler id)
SET(CMAKE_CXX_COMPILER_ID_RUN TRUE) SET(CMAKE_CXX_COMPILER_ID_RUN TRUE)
SET(CMAKE_CXX_COMPILER_ID ${id}) SET(CMAKE_CXX_COMPILER_ID ${id})
SET(CMAKE_CXX_COMPILER_WORKS TRUE) SET(CMAKE_CXX_COMPILER_WORKS TRUE)
SET(CMAKE_CXX_COMPILER_FORCED TRUE)
IF("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") IF("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU")
SET(CMAKE_COMPILER_IS_GNUCXX 1) SET(CMAKE_COMPILER_IS_GNUCXX 1)

View File

@ -42,6 +42,10 @@ ELSE(NOT CMAKE_C_COMPILER_WORKS)
ENDIF(C_TEST_WAS_RUN) ENDIF(C_TEST_WAS_RUN)
SET(CMAKE_C_COMPILER_WORKS 1 CACHE INTERNAL "") SET(CMAKE_C_COMPILER_WORKS 1 CACHE INTERNAL "")
IF(CMAKE_C_COMPILER_FORCED)
# The compiler was forced by the CMAKE_FORCE_C_COMPILER macro.
# Assume the user has configured all compiler information.
ELSE(CMAKE_C_COMPILER_FORCED)
# Try to identify the ABI and configure it into CMakeCCompiler.cmake # Try to identify the ABI and configure it into CMakeCCompiler.cmake
INCLUDE(${CMAKE_ROOT}/Modules/CMakeDetermineCompilerABI.cmake) INCLUDE(${CMAKE_ROOT}/Modules/CMakeDetermineCompilerABI.cmake)
CMAKE_DETERMINE_COMPILER_ABI(C ${CMAKE_ROOT}/Modules/CMakeCCompilerABI.c) CMAKE_DETERMINE_COMPILER_ABI(C ${CMAKE_ROOT}/Modules/CMakeCCompilerABI.c)
@ -50,5 +54,6 @@ ELSE(NOT CMAKE_C_COMPILER_WORKS)
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeCCompiler.cmake ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeCCompiler.cmake
@ONLY @ONLY
) )
ENDIF(CMAKE_C_COMPILER_FORCED)
ENDIF(NOT CMAKE_C_COMPILER_WORKS) ENDIF(NOT CMAKE_C_COMPILER_WORKS)

View File

@ -35,6 +35,10 @@ ELSE(NOT CMAKE_CXX_COMPILER_WORKS)
ENDIF(CXX_TEST_WAS_RUN) ENDIF(CXX_TEST_WAS_RUN)
SET(CMAKE_CXX_COMPILER_WORKS 1 CACHE INTERNAL "") SET(CMAKE_CXX_COMPILER_WORKS 1 CACHE INTERNAL "")
IF(CMAKE_CXX_COMPILER_FORCED)
# The compiler was forced by the CMAKE_FORCE_CXX_COMPILER macro.
# Assume the user has configured all compiler information.
ELSE(CMAKE_CXX_COMPILER_FORCED)
# Try to identify the ABI and configure it into CMakeCXXCompiler.cmake # Try to identify the ABI and configure it into CMakeCXXCompiler.cmake
INCLUDE(${CMAKE_ROOT}/Modules/CMakeDetermineCompilerABI.cmake) INCLUDE(${CMAKE_ROOT}/Modules/CMakeDetermineCompilerABI.cmake)
CMAKE_DETERMINE_COMPILER_ABI(CXX ${CMAKE_ROOT}/Modules/CMakeCXXCompilerABI.cpp) CMAKE_DETERMINE_COMPILER_ABI(CXX ${CMAKE_ROOT}/Modules/CMakeCXXCompilerABI.cpp)
@ -43,4 +47,5 @@ ELSE(NOT CMAKE_CXX_COMPILER_WORKS)
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeCXXCompiler.cmake ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeCXXCompiler.cmake
@ONLY @ONLY
) )
ENDIF(CMAKE_CXX_COMPILER_FORCED)
ENDIF(NOT CMAKE_CXX_COMPILER_WORKS) ENDIF(NOT CMAKE_CXX_COMPILER_WORKS)