ClickHouse/programs/odbc-bridge/CMakeLists.txt

51 lines
1.7 KiB
CMake
Raw Normal View History

2022-03-10 21:23:28 +00:00
include(${ClickHouse_SOURCE_DIR}/cmake/strip_binary.cmake)
set (CLICKHOUSE_ODBC_BRIDGE_SOURCES
ColumnInfoHandler.cpp
getIdentifierQuote.cpp
HandlerFactory.cpp
IdentifierQuoteHandler.cpp
MainHandler.cpp
ODBCBlockInputStream.cpp
ODBCBlockOutputStream.cpp
ODBCBridge.cpp
PingHandler.cpp
SchemaAllowedHandler.cpp
validateODBCConnectionString.cpp
odbc-bridge.cpp
2019-03-04 17:47:31 +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 ()
add_executable(clickhouse-odbc-bridge ${CLICKHOUSE_ODBC_BRIDGE_SOURCES})
2019-03-04 17:47:31 +00:00
target_link_libraries(clickhouse-odbc-bridge PRIVATE
2021-04-07 07:16:50 +00:00
daemon
2020-11-04 20:44:43 +00:00
dbms
2021-03-12 21:47:07 +00:00
bridge
2021-04-07 17:11:09 +00:00
clickhouse_parsers
2022-01-17 20:59:41 +00:00
ch_contrib::nanodbc
2022-01-17 21:03:55 +00:00
ch_contrib::unixodbc
)
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
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()
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-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
if(ENABLE_TESTS)
add_subdirectory(tests)
endif()