Load platform files that need to know the ABI when possible

Load platform files named in CMAKE_<lang>_ABI_FILES for each language
once the ABI sizeof(void*) is known.  During the first configuration
this is after the test for working compiler and ABI detection checks.
During later configurations the ABI information is immediately available
because it has been saved in CMake<lang>Compiler.cmake.
This commit is contained in:
Brad King 2011-11-29 15:17:06 -05:00
parent ecd8414757
commit a603250a13
7 changed files with 38 additions and 0 deletions

View File

@ -68,6 +68,12 @@ IF (NOT _INCLUDED_FILE)
INCLUDE(Platform/${CMAKE_SYSTEM_NAME} OPTIONAL)
ENDIF (NOT _INCLUDED_FILE)
IF(CMAKE_C_SIZEOF_DATA_PTR)
FOREACH(f ${CMAKE_C_ABI_FILES})
INCLUDE(${f})
ENDFOREACH()
UNSET(CMAKE_C_ABI_FILES)
ENDIF()
# This should be included before the _INIT variables are
# used to initialize the cache. Since the rule variables

View File

@ -67,6 +67,12 @@ IF (NOT _INCLUDED_FILE)
INCLUDE(Platform/${CMAKE_SYSTEM_NAME} OPTIONAL)
ENDIF (NOT _INCLUDED_FILE)
IF(CMAKE_CXX_SIZEOF_DATA_PTR)
FOREACH(f ${CMAKE_CXX_ABI_FILES})
INCLUDE(${f})
ENDFOREACH()
UNSET(CMAKE_CXX_ABI_FILES)
ENDIF()
# This should be included before the _INIT variables are
# used to initialize the cache. Since the rule variables

View File

@ -44,6 +44,12 @@ IF (NOT _INCLUDED_FILE)
INCLUDE(Platform/${CMAKE_SYSTEM_NAME} OPTIONAL)
ENDIF (NOT _INCLUDED_FILE)
IF(CMAKE_Fortran_SIZEOF_DATA_PTR)
FOREACH(f ${CMAKE_Fortran_ABI_FILES})
INCLUDE(${f})
ENDFOREACH()
UNSET(CMAKE_Fortran_ABI_FILES)
ENDIF()
# This should be included before the _INIT variables are
# used to initialize the cache. Since the rule variables

View File

@ -76,5 +76,11 @@ ELSE(NOT CMAKE_C_COMPILER_WORKS)
)
INCLUDE(${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeCCompiler.cmake)
ENDIF(CMAKE_C_COMPILER_FORCED)
IF(CMAKE_C_SIZEOF_DATA_PTR)
FOREACH(f ${CMAKE_C_ABI_FILES})
INCLUDE(${f})
ENDFOREACH()
UNSET(CMAKE_C_ABI_FILES)
ENDIF()
ENDIF(NOT CMAKE_C_COMPILER_WORKS)

View File

@ -69,4 +69,10 @@ ELSE(NOT CMAKE_CXX_COMPILER_WORKS)
)
INCLUDE(${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeCXXCompiler.cmake)
ENDIF(CMAKE_CXX_COMPILER_FORCED)
IF(CMAKE_CXX_SIZEOF_DATA_PTR)
FOREACH(f ${CMAKE_CXX_ABI_FILES})
INCLUDE(${f})
ENDFOREACH()
UNSET(CMAKE_CXX_ABI_FILES)
ENDIF()
ENDIF(NOT CMAKE_CXX_COMPILER_WORKS)

View File

@ -92,4 +92,10 @@ ELSE(NOT CMAKE_Fortran_COMPILER_WORKS)
)
INCLUDE(${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeFortranCompiler.cmake)
ENDIF(CMAKE_Fortran_COMPILER_FORCED)
IF(CMAKE_Fortran_SIZEOF_DATA_PTR)
FOREACH(f ${CMAKE_Fortran_ABI_FILES})
INCLUDE(${f})
ENDFOREACH()
UNSET(CMAKE_Fortran_ABI_FILES)
ENDIF()
ENDIF(NOT CMAKE_Fortran_COMPILER_WORKS)

View File

@ -1515,6 +1515,8 @@ void cmDocumentVariables::DefineVariables(cmake* cm)
cmProperty::VARIABLE,0,0);
cm->DefineProperty("CMAKE_<LANG>_COMPILER_ID_RUN",
cmProperty::VARIABLE,0,0);
cm->DefineProperty("CMAKE_<LANG>_ABI_FILES",
cmProperty::VARIABLE,0,0);
cm->DefineProperty("CMAKE_<LANG>_CREATE_ASSEMBLY_SOURCE",
cmProperty::VARIABLE,0,0);
cm->DefineProperty("CMAKE_<LANG>_CREATE_PREPROCESSED_SOURCE",