Skip to content

Commit

Permalink
More fixes for clang-16 compiler (#106)
Browse files Browse the repository at this point in the history
Signed-off-by: Alexandr Guzhva <[email protected]>
  • Loading branch information
alexanderguzhva authored Nov 7, 2023
1 parent 9f05d18 commit 25bf8a3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
7 changes: 7 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@ knowhere_option(WITH_COVERAGE "Build with coverage" OFF)
knowhere_option(WITH_CCACHE "Build with ccache" ON)
knowhere_option(WITH_PROFILER "Build with profiler" OFF)

# this is needed for clang on ubuntu:20.04, otherwise
# the linked fails with 'undefined reference' error.
# fmt v9 was used by the time the error was encountered.
# clang on ubuntu:22.04 seems to be unaffected.
# gcc seems to be unaffected.
add_definitions(-DFMT_HEADER_ONLY)

if(KNOWHERE_VERSION)
message(STATUS "Building KNOWHERE version: ${KNOWHERE_VERSION}")
add_definitions(-DKNOWHERE_VERSION=${KNOWHERE_VERSION})
Expand Down
4 changes: 4 additions & 0 deletions benchmark/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ macro(benchmark_test target file)
set(FILE_SRCS ${file})
add_executable(${target} ${FILE_SRCS})
target_link_libraries(${target} ${depend_libs} ${unittest_libs})

# this is needed for clang in Debug compilation mode
target_link_libraries(${target} atomic)

install(TARGETS ${target} DESTINATION unittest)
endmacro()

Expand Down

0 comments on commit 25bf8a3

Please sign in to comment.