2022-03-10 21:23:28 +00:00
include ( ${ ClickHouse_SOURCE_DIR } /cmake/strip_binary.cmake )
2020-05-08 14:11:19 +00:00
set ( CLICKHOUSE_ODBC_BRIDGE_SOURCES
C o l u m n I n f o H a n d l e r . c p p
g e t I d e n t i f i e r Q u o t e . c p p
H a n d l e r F a c t o r y . c p p
I d e n t i f i e r Q u o t e H a n d l e r . c p p
M a i n H a n d l e r . c p p
O D B C B l o c k I n p u t S t r e a m . c p p
2020-05-13 18:30:26 +00:00
O D B C B l o c k O u t p u t S t r e a m . c p p
2020-05-08 14:11:19 +00:00
O D B C B r i d g e . c p p
P i n g H a n d l e r . c p p
2020-07-06 12:23:36 +00:00
S c h e m a A l l o w e d H a n d l e r . c p p
2020-05-08 14:11:19 +00:00
v a l i d a t e O D B C C o n n e c t i o n S t r i n g . c p p
2020-10-29 05:27:55 +00:00
o d b c - b r i d g e . c p p
2019-03-04 17:47:31 +00:00
)
2018-08-19 17:09:54 +00:00
2019-09-20 17:34:59 +00:00
if ( OS_LINUX )
# 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.
set ( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--no-export-dynamic" )
endif ( )
2018-12-14 19:28:37 +00:00
2020-10-29 05:27:55 +00:00
add_executable ( clickhouse-odbc-bridge ${ CLICKHOUSE_ODBC_BRIDGE_SOURCES } )
2019-03-04 17:47:31 +00:00
2020-10-29 05:27:55 +00:00
target_link_libraries ( clickhouse-odbc-bridge PRIVATE
2021-04-07 07:16:50 +00:00
d a e m o n
2020-11-04 20:44:43 +00:00
d b m s
2021-03-12 21:47:07 +00:00
b r i d g e
2021-04-07 17:11:09 +00:00
c l i c k h o u s e _ p a r s e r s
2022-01-17 20:59:41 +00:00
c h _ c o n t r i b : : n a n o d b c
2022-01-17 21:03:55 +00:00
c h _ c o n t r i b : : u n i x o d b c
2020-10-29 05:27:55 +00:00
)
set_target_properties ( clickhouse-odbc-bridge PROPERTIES RUNTIME_OUTPUT_DIRECTORY .. )
2021-03-22 11:40:29 +00:00
target_compile_options ( clickhouse-odbc-bridge PRIVATE -Wno-reserved-id-macro -Wno-keyword-macro )
2019-03-04 17:47:31 +00:00
2019-09-17 09:49:27 +00:00
if ( USE_GDB_ADD_INDEX )
add_custom_command ( TARGET clickhouse-odbc-bridge POST_BUILD COMMAND ${ GDB_ADD_INDEX_EXE } ../clickhouse-odbc-bridge COMMENT "Adding .gdb-index to clickhouse-odbc-bridge" VERBATIM )
endif ( )
2022-03-14 23:33:45 +00:00
if ( INSTALL_STRIPPED_BINARIES )
clickhouse_strip_binary ( TARGET clickhouse-odbc-bridge DESTINATION_DIR ${ CMAKE_CURRENT_BINARY_DIR } /../ ${ STRIPPED_BINARIES_OUTPUT } BINARY_PATH ../clickhouse-odbc-bridge )
2022-03-16 11:53:15 +00:00
else ( )
2022-03-23 14:14:30 +00:00
clickhouse_make_empty_debug_info_for_nfpm ( TARGET clickhouse-odbc-bridge DESTINATION_DIR ${ CMAKE_CURRENT_BINARY_DIR } /../ ${ STRIPPED_BINARIES_OUTPUT } )
2022-03-10 21:23:28 +00:00
install ( TARGETS clickhouse-odbc-bridge RUNTIME DESTINATION ${ CMAKE_INSTALL_BINDIR } COMPONENT clickhouse )
endif ( )
2019-03-04 17:47:31 +00:00
2019-04-25 23:21:59 +00:00
if ( ENABLE_TESTS )
add_subdirectory ( tests )
endif ( )