Skip to content

Commit abc5c66

Browse files
committed
Fix clickhouse-keeper-dbg for non-standalone keeper build
1 parent d77fe2e commit abc5c66

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

cmake/split_debug_symbols.cmake

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,23 +38,25 @@ endmacro()
3838

3939

4040
macro(clickhouse_make_empty_debug_info_for_nfpm)
41-
set(oneValueArgs TARGET DESTINATION_DIR)
41+
set(oneValueArgs TARGET BINARY DESTINATION_DIR)
4242
cmake_parse_arguments(EMPTY_DEBUG "" "${oneValueArgs}" "" ${ARGN})
4343

4444
if (NOT DEFINED EMPTY_DEBUG_TARGET)
4545
message(FATAL_ERROR "A target name must be provided for stripping binary")
4646
endif()
47-
47+
if (NOT DEFINED EMPTY_DEBUG_BINARY)
48+
message(FATAL_ERROR "A binary name must be provided for stripping binary")
49+
endif()
4850
if (NOT DEFINED EMPTY_DEBUG_DESTINATION_DIR)
4951
message(FATAL_ERROR "Destination directory for empty debug must be provided")
5052
endif()
5153

5254
add_custom_command(TARGET ${EMPTY_DEBUG_TARGET} POST_BUILD
5355
COMMAND mkdir -p "${EMPTY_DEBUG_DESTINATION_DIR}/lib/debug"
54-
COMMAND touch "${EMPTY_DEBUG_DESTINATION_DIR}/lib/debug/${EMPTY_DEBUG_TARGET}.debug"
56+
COMMAND touch "${EMPTY_DEBUG_DESTINATION_DIR}/lib/debug/${EMPTY_DEBUG_BINARY}.debug"
5557
COMMENT "Adding empty debug info for NFPM" VERBATIM
5658
)
5759

5860
cmake_path(SET DEBUG_PATH NORMALIZE "${CMAKE_INSTALL_LIBDIR}/debug/${CMAKE_INSTALL_FULL_BINDIR}")
59-
install(FILES "${EMPTY_DEBUG_DESTINATION_DIR}/lib/debug/${EMPTY_DEBUG_TARGET}.debug" DESTINATION ${DEBUG_PATH} COMPONENT clickhouse)
61+
install(FILES "${EMPTY_DEBUG_DESTINATION_DIR}/lib/debug/${EMPTY_DEBUG_BINARY}.debug" DESTINATION ${DEBUG_PATH} COMPONENT clickhouse)
6062
endmacro()

programs/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ if (ENABLE_CLICKHOUSE_KEEPER)
198198
if (NOT BUILD_STANDALONE_KEEPER)
199199
add_custom_command (TARGET clickhouse POST_BUILD COMMAND ${CMAKE_COMMAND} -E create_symlink clickhouse clickhouse-keeper)
200200
install (FILES "${CMAKE_CURRENT_BINARY_DIR}/clickhouse-keeper" DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT clickhouse)
201+
clickhouse_make_empty_debug_info_for_nfpm(TARGET clickhouse BINARY clickhouse-keeper DESTINATION_DIR ${CMAKE_CURRENT_BINARY_DIR}/../${SPLIT_DEBUG_SYMBOLS_DIR})
201202
endif()
202203

203204
# otherwise we don't build keeper
@@ -230,7 +231,7 @@ endif ()
230231
if (SPLIT_DEBUG_SYMBOLS)
231232
clickhouse_split_debug_symbols(TARGET clickhouse DESTINATION_DIR ${CMAKE_CURRENT_BINARY_DIR}/${SPLIT_DEBUG_SYMBOLS_DIR} BINARY_PATH clickhouse)
232233
else()
233-
clickhouse_make_empty_debug_info_for_nfpm(TARGET clickhouse DESTINATION_DIR ${CMAKE_CURRENT_BINARY_DIR}/${SPLIT_DEBUG_SYMBOLS_DIR})
234+
clickhouse_make_empty_debug_info_for_nfpm(TARGET clickhouse BINARY clickhouse DESTINATION_DIR ${CMAKE_CURRENT_BINARY_DIR}/${SPLIT_DEBUG_SYMBOLS_DIR})
234235
install (TARGETS clickhouse RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT clickhouse)
235236
endif()
236237

0 commit comments

Comments
 (0)