auto-select readline library by default.

This commit is contained in:
Kelvin Sherlock 2019-02-10 22:39:23 -05:00
parent 817792f94d
commit f9a86eed8a

View File

@ -48,7 +48,7 @@ option(WITH_HOST_FST "Enable host fst support" ON)
option(TOGGLE_STATUS "Enable F10 Toggle Status support (win32/x11)" OFF)
option(WITH_RAWNET "Enable Uthernet emulation" OFF)
option(WITH_ATBRIDGE "Enable AT Bridge" OFF)
set(READLINE "NONE" CACHE STRING "Readline library (NONE, READLINE, LIBEDIT")
set(READLINE "AUTO" CACHE STRING "Readline library (AUTO, NONE, READLINE, LIBEDIT)")
set(generated_headers 8inst_c.h 16inst_c.h 8inst_s.h 16inst_s.h size_c.h size_s.h 8size_s.h 16size_s.h)
add_custom_command(
@ -155,6 +155,14 @@ endif()
# SET_SOURCE_FILES_PROPERTIES(vmnet_helper PROPERTIES MACOSX_PACKAGE_LOCATION MacOS)
add_library(x_readline readline.c)
if (READLINE MATCHES "AUTO")
if (CMAKE_SYSTEM_NAME MATCHES "(Darwin|FreeBSD|OpenBSD|NetBSD)")
set(READLINE "LIBEDIT")
endif()
if (CMAKE_SYSTEM_NAME MATCHES "Linux")
set(READLINE "READLINE")
endif()
endif()
if(READLINE MATCHES "READLINE")
target_compile_definitions(x_readline PRIVATE USE_READLINE)
target_link_libraries(x_readline PUBLIC history readline)