cmake: make WINSIZE checks work

This commit is contained in:
David Adam 2017-11-07 11:30:29 +08:00
parent a8938bcb4d
commit 57bfca17dc

View file

@ -88,8 +88,8 @@ CHECK_CXX_SYMBOL_EXISTS(_sys_errs stdlib.h HAVE__SYS__ERRS)
SET(CMAKE_EXTRA_INCLUDE_FILES termios.h sys/ioctl.h)
CHECK_TYPE_SIZE("struct winsize" STRUCT_WINSIZE LANGUAGE CXX)
CHECK_CXX_SYMBOL_EXISTS("TIOCGWINSZ" "termios.h sys/ioctl.h" HAVE_TIOCGWINSZ)
IF(${STRUCT_WINSIZE} AND (DEFINED HAVE_TIOCGWINSZ))
CHECK_CXX_SYMBOL_EXISTS("TIOCGWINSZ" "termios.h;sys/ioctl.h" HAVE_TIOCGWINSZ)
IF(STRUCT_WINSIZE GREATER -1 AND HAVE_TIOCGWINSZ EQUAL 1)
SET(HAVE_WINSIZE 1)
ENDIF()
SET(CMAKE_EXTRA_INCLUDE_FILES)