Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Freebsd clang3.8 compile fixes #352

Merged
merged 2 commits into from
Jan 17, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
43 changes: 43 additions & 0 deletions cmake/find_readline_edit.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
if (NOT READLINE_PATHS)
set (READLINE_PATHS "/usr/local/opt/readline/lib")
if (USE_STATIC_LIBRARIES)
find_library (READLINE_LIB NAMES libreadline.a PATHS ${READLINE_PATHS})
else ()
find_library (READLINE_LIB NAMES readline PATHS ${READLINE_PATHS})
endif ()

if (USE_STATIC_LIBRARIES)
find_library (TERMCAP_LIB NAMES libtermcap.a termcap)
else ()
find_library (TERMCAP_LIB NAMES termcap)
endif ()

if (USE_STATIC_LIBRARIES)
find_library (EDIT_LIB NAMES libedit.a)
else ()
find_library (EDIT_LIB NAMES edit)
endif ()
if (USE_STATIC_LIBRARIES)
find_library (CURSES_LIB NAMES libcurses.a)
else ()
find_library (CURSES_LIB NAMES curses)
endif ()

if (READLINE_LIB)
set(READLINE_INCLUDE_PATHS "/usr/local/opt/readline/include")
find_path (READLINE_INCLUDE_DIR NAMES readline.h PATH_SUFFIXES readline PATHS ${READLINE_INCLUDE_PATHS})
if (INE_INCLUDE_DIR)
include_directories (${READLINE_INCLUDE_DIR})
endif ()
add_definitions (-D USE_READLINE)
set (LINE_EDITING_LIBS ${READLINE_LIB} ${TERMCAP_LIB})
message (STATUS "Using line editing libraries: ${LINE_EDITING_LIBS}")
elseif (EDIT_LIB)
add_definitions (-D USE_LIBEDIT)
set (LINE_EDITING_LIBS ${EDIT_LIB} ${CURSES_LIB} ${TERMCAP_LIB})
message (STATUS "Using line editing libraries: ${LINE_EDITING_LIBS}")
else ()
message (STATUS "Not using any library for line editing.")
endif ()

endif ()
35 changes: 1 addition & 34 deletions dbms/src/Client/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,37 +1,4 @@
set (READLINE_HINTS "/usr/local/opt/readline/lib")
if (USE_STATIC_LIBRARIES)
find_library (READLINE_LIB NAMES libreadline.a HINTS ${READLINE_HINTS})
else ()
find_library (READLINE_LIB NAMES readline HINTS ${READLINE_HINTS})
endif ()
if (USE_STATIC_LIBRARIES)
find_library (EDIT_LIB NAMES libedit.a)
else ()
find_library (EDIT_LIB NAMES edit)
endif ()
if (USE_STATIC_LIBRARIES)
find_library (CURSES_LIB NAMES libcurses.a)
else ()
find_library (CURSES_LIB NAMES curses)
endif ()
if (USE_STATIC_LIBRARIES)
find_library (TERMCAP_LIB NAMES libtermcap.a termcap)
else ()
find_library (TERMCAP_LIB NAMES termcap)
endif ()

if (READLINE_LIB)
include_directories ("/usr/local/opt/readline/include")
add_definitions (-D USE_READLINE)
set (LINE_EDITING_LIBS ${READLINE_LIB} ${TERMCAP_LIB})
message (STATUS "Using line editing libraries: ${LINE_EDITING_LIBS}")
elseif (EDIT_LIB)
add_definitions (-D USE_LIBEDIT)
set (LINE_EDITING_LIBS ${EDIT_LIB} ${CURSES_LIB} ${TERMCAP_LIB})
message (STATUS "Using line editing libraries: ${LINE_EDITING_LIBS}")
else ()
message (STATUS "Not using any library for line editing.")
endif ()
include (${CMAKE_SOURCE_DIR}/cmake/find_readline_edit.cmake)

add_library (clickhouse-client Client.cpp)
target_link_libraries (clickhouse-client dbms ${LINE_EDITING_LIBS} ${Boost_PROGRAM_OPTIONS_LIBRARY})
Expand Down
2 changes: 1 addition & 1 deletion dbms/src/Functions/tests/logical_functions_performance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ class FunctionAnyArityLogical : public IFunction

public:
/// Получить имя функции.
String getName() const
String getName() const override
{
return Name::get();
}
Expand Down
4 changes: 3 additions & 1 deletion libs/libzkutil/src/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
include (${CMAKE_SOURCE_DIR}/cmake/find_readline_edit.cmake)

add_executable(zkutil_test zkutil_test.cpp)
target_link_libraries(zkutil_test zkutil dbms readline)
target_link_libraries(zkutil_test zkutil dbms ${READLINE_LIB} ${TERMCAP_LIB})

add_executable(zkutil_test_commands zkutil_test_commands.cpp)
target_link_libraries(zkutil_test_commands zkutil dbms)
Expand Down