From e5fee8a7c2873531c8e8e8ee991e8d0697f9bf73 Mon Sep 17 00:00:00 2001 From: Brad King Date: Fri, 24 Aug 2012 15:15:14 -0400 Subject: Store ABI detection results in compiler information files Drop use of cache entry CMAKE_DETERMINE__ABI_COMPILED and replace it with variable CMAKE__ABI_COMPILED. Since the grandparent commit this test result is specific to the version of CMake. Store it in the version-specific compiler information files instead of CMakeCache.txt so testing can be re-done to meet the requirements of the current version of CMake even if another version of CMake was already used to configure the build tree. --- Modules/CMakeCCompiler.cmake.in | 1 + Modules/CMakeCXXCompiler.cmake.in | 1 + Modules/CMakeDetermineCompilerABI.cmake | 10 +++++++--- Modules/CMakeFortranCompiler.cmake.in | 1 + 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/Modules/CMakeCCompiler.cmake.in b/Modules/CMakeCCompiler.cmake.in index 9d63033..17d63eb 100644 --- a/Modules/CMakeCCompiler.cmake.in +++ b/Modules/CMakeCCompiler.cmake.in @@ -10,6 +10,7 @@ set(CMAKE_LINKER "@CMAKE_LINKER@") set(CMAKE_COMPILER_IS_GNUCC @CMAKE_COMPILER_IS_GNUCC@) set(CMAKE_C_COMPILER_LOADED 1) set(CMAKE_C_COMPILER_WORKS @CMAKE_C_COMPILER_WORKS@) +set(CMAKE_C_ABI_COMPILED @CMAKE_C_ABI_COMPILED@) set(CMAKE_COMPILER_IS_MINGW @CMAKE_COMPILER_IS_MINGW@) set(CMAKE_COMPILER_IS_CYGWIN @CMAKE_COMPILER_IS_CYGWIN@) if(CMAKE_COMPILER_IS_CYGWIN) diff --git a/Modules/CMakeCXXCompiler.cmake.in b/Modules/CMakeCXXCompiler.cmake.in index 2e891b3..7f66be5 100644 --- a/Modules/CMakeCXXCompiler.cmake.in +++ b/Modules/CMakeCXXCompiler.cmake.in @@ -10,6 +10,7 @@ set(CMAKE_LINKER "@CMAKE_LINKER@") set(CMAKE_COMPILER_IS_GNUCXX @CMAKE_COMPILER_IS_GNUCXX@) set(CMAKE_CXX_COMPILER_LOADED 1) set(CMAKE_CXX_COMPILER_WORKS @CMAKE_CXX_COMPILER_WORKS@) +set(CMAKE_CXX_ABI_COMPILED @CMAKE_CXX_ABI_COMPILED@) set(CMAKE_COMPILER_IS_MINGW @CMAKE_COMPILER_IS_MINGW@) set(CMAKE_COMPILER_IS_CYGWIN @CMAKE_COMPILER_IS_CYGWIN@) if(CMAKE_COMPILER_IS_CYGWIN) diff --git a/Modules/CMakeDetermineCompilerABI.cmake b/Modules/CMakeDetermineCompilerABI.cmake index ee4b60e..75247d9 100644 --- a/Modules/CMakeDetermineCompilerABI.cmake +++ b/Modules/CMakeDetermineCompilerABI.cmake @@ -19,7 +19,7 @@ include(${CMAKE_ROOT}/Modules/CMakeParseImplicitLinkInfo.cmake) function(CMAKE_DETERMINE_COMPILER_ABI lang src) - if(NOT DEFINED CMAKE_DETERMINE_${lang}_ABI_COMPILED) + if(NOT DEFINED CMAKE_${lang}_ABI_COMPILED) message(STATUS "Detecting ${lang} compiler ABI info") # Compile the ABI identification source. @@ -28,7 +28,7 @@ function(CMAKE_DETERMINE_COMPILER_ABI lang src) if(DEFINED CMAKE_${lang}_VERBOSE_FLAG) set(CMAKE_FLAGS "-DCMAKE_EXE_LINKER_FLAGS=${CMAKE_${lang}_VERBOSE_FLAG}") endif() - try_compile(CMAKE_DETERMINE_${lang}_ABI_COMPILED + try_compile(CMAKE_${lang}_ABI_COMPILED ${CMAKE_BINARY_DIR} ${src} CMAKE_FLAGS "${CMAKE_FLAGS}" "-DCMAKE_${lang}_STANDARD_LIBRARIES=" @@ -39,9 +39,13 @@ function(CMAKE_DETERMINE_COMPILER_ABI lang src) OUTPUT_VARIABLE OUTPUT COPY_FILE "${BIN}" ) + # Move result from cache to normal variable. + set(CMAKE_${lang}_ABI_COMPILED ${CMAKE_${lang}_ABI_COMPILED}) + unset(CMAKE_${lang}_ABI_COMPILED CACHE) + set(CMAKE_${lang}_ABI_COMPILED ${CMAKE_${lang}_ABI_COMPILED} PARENT_SCOPE) # Load the resulting information strings. - if(CMAKE_DETERMINE_${lang}_ABI_COMPILED) + if(CMAKE_${lang}_ABI_COMPILED) message(STATUS "Detecting ${lang} compiler ABI info - done") file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log "Detecting ${lang} compiler ABI info compiled with the following output:\n${OUTPUT}\n\n") diff --git a/Modules/CMakeFortranCompiler.cmake.in b/Modules/CMakeFortranCompiler.cmake.in index 9ed3aac..55f8277 100644 --- a/Modules/CMakeFortranCompiler.cmake.in +++ b/Modules/CMakeFortranCompiler.cmake.in @@ -8,6 +8,7 @@ set(CMAKE_RANLIB "@CMAKE_RANLIB@") set(CMAKE_COMPILER_IS_GNUG77 @CMAKE_COMPILER_IS_GNUG77@) set(CMAKE_Fortran_COMPILER_LOADED 1) set(CMAKE_Fortran_COMPILER_WORKS @CMAKE_Fortran_COMPILER_WORKS@) +set(CMAKE_Fortran_ABI_COMPILED @CMAKE_Fortran_ABI_COMPILED@) set(CMAKE_COMPILER_IS_MINGW @CMAKE_COMPILER_IS_MINGW@) set(CMAKE_COMPILER_IS_CYGWIN @CMAKE_COMPILER_IS_CYGWIN@) if(CMAKE_COMPILER_IS_CYGWIN) -- cgit v0.12