From 57bfca17dc2af82a5b6278bb16c0b680fe8fd198 Mon Sep 17 00:00:00 2001 From: David Adam Date: Tue, 7 Nov 2017 11:30:29 +0800 Subject: [PATCH] cmake: make WINSIZE checks work --- cmake/ConfigureChecks.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/ConfigureChecks.cmake b/cmake/ConfigureChecks.cmake index 72d3e375f..de6788be7 100644 --- a/cmake/ConfigureChecks.cmake +++ b/cmake/ConfigureChecks.cmake @@ -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)