mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-26 10:43:47 +08:00
Prevent CMake configure checks for affecting future checks
Using CMAKE_PUSH_CHECK_STATE/CMAKE_POP_CHECK_STATE to prevent CMake checks from permanently altering the environment used by future checks.
This commit is contained in:
parent
490432c177
commit
5196a42165
|
@ -106,13 +106,14 @@ CHECK_CXX_SYMBOL_EXISTS(wcstod_l "${WCSTOD_L_INCLUDES}" HAVE_WCSTOD_L)
|
|||
|
||||
CHECK_CXX_SYMBOL_EXISTS(_sys_errs stdlib.h HAVE__SYS__ERRS)
|
||||
|
||||
CMAKE_PUSH_CHECK_STATE()
|
||||
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 GREATER -1 AND HAVE_TIOCGWINSZ EQUAL 1)
|
||||
SET(HAVE_WINSIZE 1)
|
||||
ENDIF()
|
||||
SET(CMAKE_EXTRA_INCLUDE_FILES)
|
||||
CMAKE_POP_CHECK_STATE()
|
||||
|
||||
IF(EXISTS "/proc/self/stat")
|
||||
SET(HAVE__PROC_SELF_STAT 1)
|
||||
|
@ -135,7 +136,8 @@ ELSEIF(HAVE_NCURSES_TERM_H)
|
|||
SET(TPARM_INCLUDES "${TPARM_INCLUDES}#include <ncurses/term.h>\n")
|
||||
ENDIF()
|
||||
|
||||
SET(CMAKE_REQUIRED_LIBRARIES ${CURSES_LIBRARY})
|
||||
CMAKE_PUSH_CHECK_STATE()
|
||||
LIST(APPEND CMAKE_REQUIRED_LIBRARIES ${CURSES_LIBRARY})
|
||||
CHECK_CXX_SOURCE_COMPILES("
|
||||
${TPARM_INCLUDES}
|
||||
|
||||
|
@ -162,7 +164,7 @@ int main () {
|
|||
SET(TPARM_VARARGS 1)
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
SET(CMAKE_REQUIRED_LIBRARIES)
|
||||
CMAKE_POP_CHECK_STATE()
|
||||
|
||||
CHECK_CXX_SOURCE_COMPILES("
|
||||
#include <memory>
|
||||
|
|
Loading…
Reference in New Issue
Block a user