Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions duckdb/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,24 @@ build_extension_lib(${BUILD_STATIC_EXTENSION} "duckdb")
target_link_libraries(lbug_${EXTENSION_LIB_NAME}_extension
PRIVATE
${DuckDB_LIBRARIES})
if (DuckDB_USE_STATIC_LIBS)
# Statically-linked duckdb requires its generated extension loader archive,
# which provides the init hooks for duckdb's bundled extensions, plus the
# archives of those bundled extensions themselves. Order matters: the
# loader references symbols from both duckdb_static and the extension
# archives, so it must be linked in between.
if (TARGET duckdb_generated_extension_loader)
set(DUCKDB_STATIC_EXTRA_LIBS duckdb_generated_extension_loader)
foreach (duckdb_ext IN LISTS DuckDB_EXTENSIONS)
if (TARGET "${duckdb_ext}_extension")
list(APPEND DUCKDB_STATIC_EXTRA_LIBS "${duckdb_ext}_extension")
endif ()
endforeach ()
target_link_libraries(lbug_${EXTENSION_LIB_NAME}_extension
PRIVATE
${DUCKDB_STATIC_EXTRA_LIBS})
else ()
message(WARNING "duckdb static libs are used but the duckdb_generated_extension_loader "
"target was not exported by the DuckDB package - the build may fail to link")
endif ()
endif ()
Loading