mirror of
https://github.com/Dushistov/sdcv.git
synced 2025-12-15 09:21:55 +00:00
fix build without readline
This commit is contained in:
@@ -27,11 +27,15 @@ if (NOT GLIB2_FOUND)
|
||||
"make sure that you install it")
|
||||
endif()
|
||||
|
||||
find_path(READLINE_INCLUDE_DIR readline/readline.h)
|
||||
find_library(READLINE_LIBRARY NAMES readline)
|
||||
if (READLINE_INCLUDE_DIR AND READLINE_LIBRARY)
|
||||
set(WITH_READLINE True)
|
||||
endif ()
|
||||
set(WITH_READLINE True CACHE BOOL "Use readline library")
|
||||
|
||||
if (WITH_READLINE)
|
||||
find_path(READLINE_INCLUDE_DIR readline/readline.h)
|
||||
find_library(READLINE_LIBRARY NAMES readline)
|
||||
if (NOT (READLINE_INCLUDE_DIR AND READLINE_LIBRARY))
|
||||
set(WITH_READLINE False CACHE FORCE)
|
||||
endif ()
|
||||
endif (WITH_READLINE)
|
||||
|
||||
option(ENABLE_NLS "Enable NLS support" True)
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ namespace {
|
||||
|
||||
class dummy_readline : public IReadLine {
|
||||
public:
|
||||
bool read(const string& banner, string& line) override {
|
||||
bool read(const std::string &banner, std::string &line) override {
|
||||
printf("%s", banner.c_str());
|
||||
return stdio_getline(stdin, line);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user