Commit a863d655 authored by Andy Cedilnik's avatar Andy Cedilnik
Browse files

Improve check size of. Now it checks for some header files before trying to check types

parent 94ff97ce
......@@ -7,10 +7,18 @@
#
MACRO(CHECK_TYPE_SIZE TYPE VARIABLE)
SET(MACRO_CHECK_TYPE_SIZE_FLAGS -DCHECK_SIZE_OF="${TYPE}")
IF(HAVE_SYS_TYPES_H)
SET(MACRO_CHECK_TYPE_SIZE_FLAGS "${MACRO_CHECK_TYPE_SIZE_FLAGS} -DHAVE_SYS_TYPES_H")
ENDIF(HAVE_SYS_TYPES_H)
IF(HAVE_STDINT_H)
SET(MACRO_CHECK_TYPE_SIZE_FLAGS "${MACRO_CHECK_TYPE_SIZE_FLAGS} -DHAVE_STDINT_H")
ENDIF(HAVE_STDINT_H)
TRY_RUN(${VARIABLE} HAVE_${VARIABLE}
${PROJECT_BINARY_DIR}
${CMAKE_ROOT}/Modules/CheckSizeOf.c
COMPILE_DEFINITIONS -DCHECK_SIZE_OF="${TYPE}"
COMPILE_DEFINITIONS ${MACRO_CHECK_TYPE_SIZE_FLAGS}
OUTPUT_VARIABLE OUTPUT)
IF(NOT HAVE_${VARIABLE})
WRITE_FILE(${PROJECT_BINARY_DIR}/CMakeError.log
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment