@@ -282,6 +282,55 @@ function(resolve_nlohmann_json_dependency)
282282 LIBRARY DESTINATION "${ICEBERG_INSTALL_LIBDIR} " )
283283endfunction ()
284284
285+ # ----------------------------------------------------------------------
286+ # spdlog
287+
288+ function (resolve_spdlog_dependency)
289+ prepare_fetchcontent()
290+
291+ find_package (Threads REQUIRED)
292+
293+ set (SPDLOG_USE_STD_FORMAT
294+ ON
295+ CACHE BOOL "" FORCE)
296+ set (SPDLOG_BUILD_PIC
297+ ON
298+ CACHE BOOL "" FORCE)
299+
300+ fetchcontent_declare(spdlog
301+ ${FC_DECLARE_COMMON_OPTIONS}
302+ URL "https://github.com/gabime/spdlog/archive/refs/tags/v1.15.3.tar.gz"
303+ FIND_PACKAGE_ARGS
304+ NAMES
305+ spdlog
306+ CONFIG)
307+ fetchcontent_makeavailable(spdlog)
308+
309+ if (spdlog_SOURCE_DIR)
310+ set_target_properties (spdlog PROPERTIES OUTPUT_NAME "iceberg_vendored_spdlog"
311+ POSITION_INDEPENDENT_CODE ON )
312+ target_link_libraries (spdlog INTERFACE Threads::Threads)
313+ install (TARGETS spdlog
314+ EXPORT iceberg_targets
315+ RUNTIME DESTINATION "${ICEBERG_INSTALL_BINDIR} "
316+ ARCHIVE DESTINATION "${ICEBERG_INSTALL_LIBDIR} "
317+ LIBRARY DESTINATION "${ICEBERG_INSTALL_LIBDIR} " )
318+ set (SPDLOG_VENDORED TRUE )
319+ else ()
320+ set (SPDLOG_VENDORED FALSE )
321+ list (APPEND ICEBERG_SYSTEM_DEPENDENCIES spdlog)
322+ endif ()
323+
324+ list (APPEND ICEBERG_SYSTEM_DEPENDENCIES Threads)
325+
326+ set (ICEBERG_SYSTEM_DEPENDENCIES
327+ ${ICEBERG_SYSTEM_DEPENDENCIES}
328+ PARENT_SCOPE)
329+ set (SPDLOG_VENDORED
330+ ${SPDLOG_VENDORED}
331+ PARENT_SCOPE)
332+ endfunction ()
333+
285334# ----------------------------------------------------------------------
286335# zlib
287336
@@ -302,6 +351,7 @@ endfunction()
302351resolve_zlib_dependency()
303352resolve_nanoarrow_dependency()
304353resolve_nlohmann_json_dependency()
354+ resolve_spdlog_dependency()
305355
306356if (ICEBERG_BUILD_BUNDLE)
307357 resolve_arrow_dependency()
0 commit comments