forked from Mirrors/openclonk
CMake: Re-enable readline support for openclonk-server
parent
b7b6fcfa3f
commit
30e0cdb418
|
@ -491,8 +491,6 @@ set(OC_CLONK_SOURCES
|
|||
src/platform/C4SoundSystem.h
|
||||
src/platform/C4TimeMilliseconds.cpp
|
||||
src/platform/C4TimeMilliseconds.h
|
||||
src/platform/C4StdInProc.cpp
|
||||
src/platform/C4StdInProc.h
|
||||
src/platform/C4Window.h
|
||||
src/platform/C4windowswrapper.h
|
||||
src/platform/PlatformAbstraction.cpp
|
||||
|
@ -801,10 +799,6 @@ CHECK_INCLUDE_FILE_CXX(sys/timerfd.h HAVE_SYS_TIMERFD_H)
|
|||
CHECK_INCLUDE_FILE_CXX(sys/socket.h HAVE_SYS_SOCKET_H)
|
||||
CHECK_INCLUDE_FILE_CXX(sys/eventfd.h HAVE_SYS_EVENTFD_H)
|
||||
CHECK_INCLUDE_FILE_CXX(sys/file.h HAVE_SYS_FILE_H)
|
||||
if(USE_CONSOLE)
|
||||
CHECK_INCLUDE_FILE_CXX(readline.h HAVE_READLINE_H)
|
||||
CHECK_INCLUDE_FILE_CXX(readline/readline.h HAVE_READLINE_READLINE_H)
|
||||
endif()
|
||||
CHECK_INCLUDE_FILES_CXX("X11/Xlib.h;X11/extensions/Xrandr.h" HAVE_X11_EXTENSIONS_XRANDR_H)
|
||||
CHECK_INCLUDE_FILES_CXX("X11/Xlib.h;X11/keysym.h" HAVE_X11_KEYSYM_H)
|
||||
|
||||
|
@ -874,11 +868,11 @@ elseif(UPNP_STYLE STREQUAL "libupnp")
|
|||
)
|
||||
endif()
|
||||
|
||||
if(USE_CONSOLE)
|
||||
find_package(Readline)
|
||||
include_directories(${READLINE_INCLUDE_DIRS})
|
||||
SET(HAVE_LIBREADLINE ${READLINE_FOUND} CACHE INTERNAL "libreadline available")
|
||||
if(READLINE_FOUND)
|
||||
include_directories(SYSTEM ${READLINE_INCLUDE_DIR})
|
||||
endif()
|
||||
SET(HAVE_LIBREADLINE ${READLINE_FOUND} CACHE INTERNAL "libreadline available")
|
||||
|
||||
# Set GTK link directory. This needs to be done before add_executable,
|
||||
# otherwise the path is not used for linking clonk
|
||||
|
@ -974,6 +968,8 @@ add_executable(openclonk-server
|
|||
${OC_SYSTEM_SOURCES}
|
||||
${OC_CLONK_SOURCES}
|
||||
src/platform/C4AppT.cpp
|
||||
src/platform/C4StdInProc.cpp
|
||||
src/platform/C4StdInProc.h
|
||||
)
|
||||
set_property(TARGET openclonk-server APPEND PROPERTY COMPILE_DEFINITIONS "USE_CONSOLE")
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@ IF (READLINE_INCLUDE_DIR)
|
|||
SET(READLINE_FIND_QUIETLY TRUE)
|
||||
ENDIF (READLINE_INCLUDE_DIR)
|
||||
|
||||
FIND_PATH(READLINE_INCLUDE_DIR readline.h)
|
||||
FIND_PATH(READLINE_INCLUDE_DIR readline.h PATH_SUFFIXES readline)
|
||||
|
||||
SET(READLINE_NAMES readline libreadline)
|
||||
FIND_LIBRARY(READLINE_LIBRARY NAMES ${READLINE_NAMES} )
|
||||
|
|
|
@ -34,18 +34,6 @@
|
|||
/* Define if you have POSIX threads libraries and header files. */
|
||||
#cmakedefine HAVE_PTHREAD 1
|
||||
|
||||
/* Define to 1 if you have the <readline.h> header file. */
|
||||
#cmakedefine HAVE_READLINE_H 1
|
||||
|
||||
/* Define if your readline library has \`add_history' */
|
||||
#cmakedefine HAVE_READLINE_HISTORY 1
|
||||
|
||||
/* Define to 1 if you have the <readline/history.h> header file. */
|
||||
#cmakedefine HAVE_READLINE_HISTORY_H 1
|
||||
|
||||
/* Define to 1 if you have the <readline/readline.h> header file. */
|
||||
#cmakedefine HAVE_READLINE_READLINE_H 1
|
||||
|
||||
/* Define to 1 if you have SDL. */
|
||||
#cmakedefine HAVE_SDL 1
|
||||
|
||||
|
|
|
@ -112,9 +112,6 @@ gtk_clipboard_store_all (void)
|
|||
void C4AbstractApp::Clear()
|
||||
{
|
||||
gtk_clipboard_store_all();
|
||||
#if USE_CONSOLE && HAVE_LIBREADLINE
|
||||
rl_callback_handler_remove();
|
||||
#endif
|
||||
}
|
||||
|
||||
void C4AbstractApp::Quit()
|
||||
|
|
|
@ -21,19 +21,8 @@
|
|||
#include <C4Application.h>
|
||||
|
||||
#ifdef HAVE_LIBREADLINE
|
||||
# if defined(HAVE_READLINE_READLINE_H)
|
||||
# include <readline/readline.h>
|
||||
# elif defined(HAVE_READLINE_H)
|
||||
#include <readline.h>
|
||||
# endif
|
||||
|
||||
# ifdef HAVE_READLINE_HISTORY
|
||||
# if defined(HAVE_READLINE_HISTORY_H)
|
||||
# include <readline/history.h>
|
||||
# elif defined(HAVE_HISTORY_H)
|
||||
#include <history.h>
|
||||
# endif
|
||||
# endif /* HAVE_READLINE_HISTORY */
|
||||
|
||||
static void readline_callback (char * line)
|
||||
{
|
||||
|
@ -45,12 +34,10 @@ static void readline_callback (char * line)
|
|||
{
|
||||
Application.OnCommand(line);
|
||||
}
|
||||
#if HAVE_READLINE_HISTORY
|
||||
if (line && *line)
|
||||
{
|
||||
add_history (line);
|
||||
}
|
||||
#endif
|
||||
free(line);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue