2019-03-04 17:47:31 +00:00
|
|
|
set(CLICKHOUSE_ODBC_BRIDGE_SOURCES
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/ColumnInfoHandler.cpp
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/getIdentifierQuote.cpp
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/HandlerFactory.cpp
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/IdentifierQuoteHandler.cpp
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/MainHandler.cpp
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/ODBCBlockInputStream.cpp
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/odbc-bridge.cpp
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/ODBCBridge.cpp
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/PingHandler.cpp
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/validateODBCConnectionString.cpp
|
|
|
|
)
|
|
|
|
|
2019-03-11 18:03:32 +00:00
|
|
|
set(CLICKHOUSE_ODBC_BRIDGE_LINK PRIVATE dbms clickhouse_common_io PUBLIC daemon)
|
2019-03-04 17:47:31 +00:00
|
|
|
set(CLICKHOUSE_ODBC_BRIDGE_INCLUDE PUBLIC ${ClickHouse_SOURCE_DIR}/libs/libdaemon/include)
|
2018-08-07 17:57:44 +00:00
|
|
|
|
2018-08-19 17:09:54 +00:00
|
|
|
if (USE_POCO_SQLODBC)
|
2019-03-04 17:47:31 +00:00
|
|
|
set(CLICKHOUSE_ODBC_BRIDGE_LINK ${CLICKHOUSE_ODBC_BRIDGE_LINK} PRIVATE ${Poco_SQLODBC_LIBRARY})
|
|
|
|
set(CLICKHOUSE_ODBC_BRIDGE_INCLUDE ${CLICKHOUSE_ODBC_BRIDGE_INCLUDE} SYSTEM PRIVATE ${ODBC_INCLUDE_DIRECTORIES} ${Poco_SQLODBC_INCLUDE_DIR})
|
2018-09-14 19:48:51 +00:00
|
|
|
endif ()
|
|
|
|
if (Poco_SQL_FOUND)
|
2019-03-04 17:47:31 +00:00
|
|
|
set(CLICKHOUSE_ODBC_BRIDGE_LINK ${CLICKHOUSE_ODBC_BRIDGE_LINK} PRIVATE ${Poco_SQL_LIBRARY})
|
2018-08-19 17:09:54 +00:00
|
|
|
endif ()
|
|
|
|
|
|
|
|
if (USE_POCO_DATAODBC)
|
2019-03-04 17:47:31 +00:00
|
|
|
set(CLICKHOUSE_ODBC_BRIDGE_LINK ${CLICKHOUSE_ODBC_BRIDGE_LINK} PRIVATE ${Poco_DataODBC_LIBRARY})
|
|
|
|
set(CLICKHOUSE_ODBC_BRIDGE_INCLUDE ${CLICKHOUSE_ODBC_BRIDGE_INCLUDE} SYSTEM PRIVATE ${ODBC_INCLUDE_DIRECTORIES} ${Poco_DataODBC_INCLUDE_DIR})
|
2018-08-19 17:09:54 +00:00
|
|
|
endif()
|
2018-09-14 19:48:51 +00:00
|
|
|
if (Poco_Data_FOUND)
|
2019-03-04 17:47:31 +00:00
|
|
|
set(CLICKHOUSE_ODBC_BRIDGE_LINK ${CLICKHOUSE_ODBC_BRIDGE_LINK} PRIVATE ${Poco_Data_LIBRARY})
|
2018-09-14 19:48:51 +00:00
|
|
|
endif ()
|
2018-08-19 17:09:54 +00:00
|
|
|
|
2019-03-04 17:47:31 +00:00
|
|
|
clickhouse_program_add_library(odbc-bridge)
|
2018-08-19 17:09:54 +00:00
|
|
|
|
2018-12-14 19:28:37 +00:00
|
|
|
# clickhouse-odbc-bridge is always a separate binary.
|
|
|
|
# Reason: it must not export symbols from SSL, mariadb-client, etc. to not break ABI compatibility with ODBC drivers.
|
2019-01-30 18:48:20 +00:00
|
|
|
# For this reason, we disabling -rdynamic linker flag. But we do it in strange way:
|
|
|
|
SET(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "")
|
2018-12-14 19:28:37 +00:00
|
|
|
|
|
|
|
add_executable (clickhouse-odbc-bridge odbc-bridge.cpp)
|
2019-03-04 17:47:31 +00:00
|
|
|
|
|
|
|
clickhouse_program_link_split_binary(odbc-bridge)
|
|
|
|
|
2018-12-14 19:28:37 +00:00
|
|
|
install (TARGETS clickhouse-odbc-bridge RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT clickhouse)
|
2019-03-04 17:47:31 +00:00
|
|
|
|
|
|
|
if (ENABLE_TESTS)
|
|
|
|
add_subdirectory (tests)
|
|
|
|
endif ()
|