Use Fortran ABI detection results conservatively

We set CMAKE_Fortran_SIZEOF_DATA_PTR in the Fortran compiler information
file after detecting the compiler ABI.  However, since Fortran does not
really have pointers, the preprocessor-based detection is unreliable.
The result is needed to set CMAKE_SIZEOF_VOID_P only for Fortran-only
projects because the value can come from C or C++ compilers otherwise.
Therefore when CMAKE_SIZEOF_VOID_P is available from another language we
should defer to it.
This commit is contained in:
Brad King 2010-05-05 17:42:11 -04:00
parent 7883f952b0
commit 0457d53151
1 changed files with 2 additions and 2 deletions

View File

@ -34,9 +34,9 @@ ENDIF(UNIX)
SET(CMAKE_Fortran_SIZEOF_DATA_PTR "@CMAKE_Fortran_SIZEOF_DATA_PTR@") SET(CMAKE_Fortran_SIZEOF_DATA_PTR "@CMAKE_Fortran_SIZEOF_DATA_PTR@")
SET(CMAKE_Fortran_COMPILER_ABI "@CMAKE_Fortran_COMPILER_ABI@") SET(CMAKE_Fortran_COMPILER_ABI "@CMAKE_Fortran_COMPILER_ABI@")
IF(CMAKE_Fortran_SIZEOF_DATA_PTR) IF(CMAKE_Fortran_SIZEOF_DATA_PTR AND NOT CMAKE_SIZEOF_VOID_P)
SET(CMAKE_SIZEOF_VOID_P "${CMAKE_Fortran_SIZEOF_DATA_PTR}") SET(CMAKE_SIZEOF_VOID_P "${CMAKE_Fortran_SIZEOF_DATA_PTR}")
ENDIF(CMAKE_Fortran_SIZEOF_DATA_PTR) ENDIF()
IF(CMAKE_Fortran_COMPILER_ABI) IF(CMAKE_Fortran_COMPILER_ABI)
SET(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_Fortran_COMPILER_ABI}") SET(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_Fortran_COMPILER_ABI}")