ENH: Use IF(NOT DEFINED) check to short-circuit size test.
This commit is contained in:
parent
b8928b0c8e
commit
58debfd6bd
|
@ -13,8 +13,8 @@
|
|||
# CMAKE_REQUIRED_LIBRARIES = list of libraries to link
|
||||
|
||||
MACRO(CHECK_TYPE_SIZE TYPE VARIABLE)
|
||||
IF(NOT DEFINED ${VARIABLE})
|
||||
SET(CMAKE_ALLOW_UNKNOWN_VARIABLE_READ_ACCESS 1)
|
||||
IF(NOT DEFINED ${VARIABLE})
|
||||
IF("HAVE_${VARIABLE}" MATCHES "^HAVE_${VARIABLE}$")
|
||||
SET(CHECK_TYPE_SIZE_TYPE "${TYPE}")
|
||||
SET(MACRO_CHECK_TYPE_SIZE_FLAGS
|
||||
|
@ -65,6 +65,6 @@ MACRO(CHECK_TYPE_SIZE TYPE VARIABLE)
|
|||
"Determining size of ${TYPE} failed with the following output:\n${OUTPUT}\nCheckTypeSize.c:\n${CHECK_TYPE_SIZE_FILE_CONTENT}\n\n")
|
||||
ENDIF(HAVE_${VARIABLE})
|
||||
ENDIF("HAVE_${VARIABLE}" MATCHES "^HAVE_${VARIABLE}$")
|
||||
SET(CMAKE_ALLOW_UNKNOWN_VARIABLE_READ_ACCESS )
|
||||
ENDIF(NOT DEFINED ${VARIABLE})
|
||||
SET(CMAKE_ALLOW_UNKNOWN_VARIABLE_READ_ACCESS )
|
||||
ENDMACRO(CHECK_TYPE_SIZE)
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
|
||||
MACRO(CHECK_TYPE_SIZE TYPE VARIABLE)
|
||||
SET(CMAKE_ALLOW_UNKNOWN_VARIABLE_READ_ACCESS 1)
|
||||
IF(NOT DEFINED ${VARIABLE})
|
||||
IF("HAVE_${VARIABLE}" MATCHES "^HAVE_${VARIABLE}$")
|
||||
SET(MACRO_CHECK_TYPE_SIZE_FLAGS
|
||||
"-DCHECK_TYPE_SIZE_TYPE=\"${TYPE}\" ${CMAKE_REQUIRED_FLAGS}")
|
||||
|
@ -47,5 +48,6 @@ MACRO(CHECK_TYPE_SIZE TYPE VARIABLE)
|
|||
"Determining size of ${TYPE} failed with the following output:\n${OUTPUT}\nCheckTypeSize.c:\n${CHECK_TYPE_SIZE_FILE_CONTENT}\n\n")
|
||||
ENDIF(HAVE_${VARIABLE})
|
||||
ENDIF("HAVE_${VARIABLE}" MATCHES "^HAVE_${VARIABLE}$")
|
||||
ENDIF(NOT DEFINED ${VARIABLE})
|
||||
SET(CMAKE_ALLOW_UNKNOWN_VARIABLE_READ_ACCESS )
|
||||
ENDMACRO(CHECK_TYPE_SIZE)
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
|
||||
MACRO(CHECK_TYPE_SIZE TYPE VARIABLE)
|
||||
SET(CMAKE_ALLOW_UNKNOWN_VARIABLE_READ_ACCESS 1)
|
||||
IF(NOT DEFINED ${VARIABLE})
|
||||
IF("HAVE_${VARIABLE}" MATCHES "^HAVE_${VARIABLE}$")
|
||||
SET(CHECK_TYPE_SIZE_TYPE "${TYPE}")
|
||||
SET(MACRO_CHECK_TYPE_SIZE_FLAGS
|
||||
|
@ -50,5 +51,6 @@ MACRO(CHECK_TYPE_SIZE TYPE VARIABLE)
|
|||
"Determining size of ${TYPE} failed with the following output:\n${OUTPUT}\nCheckTypeSize.c:\n${CHECK_TYPE_SIZE_FILE_CONTENT}\n\n")
|
||||
ENDIF(HAVE_${VARIABLE})
|
||||
ENDIF("HAVE_${VARIABLE}" MATCHES "^HAVE_${VARIABLE}$")
|
||||
ENDIF(NOT DEFINED ${VARIABLE})
|
||||
SET(CMAKE_ALLOW_UNKNOWN_VARIABLE_READ_ACCESS )
|
||||
ENDMACRO(CHECK_TYPE_SIZE)
|
||||
|
|
Loading…
Reference in New Issue