Skip to content

Commit 2ba03ef

Browse files
committed
Explicitly linking extensions
1 parent 6069a09 commit 2ba03ef

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ pybind11_add_module(
7878
$<TARGET_OBJECTS:python_type>)
7979
# add _duckdb_dependencies
8080
target_link_libraries(_duckdb PRIVATE _duckdb_dependencies)
81+
duckdb_link_extensions(_duckdb)
8182

8283
# ────────────────────────────────────────────
8384
# Controlling symbol export

cmake/duckdb_loader.cmake

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -220,10 +220,6 @@ function(_duckdb_print_summary)
220220
message(STATUS " Native Arch: ${NATIVE_ARCH}")
221221
message(STATUS " Unity Build Disabled: ${DISABLE_UNITY}")
222222

223-
if(BUILD_EXTENSIONS)
224-
message(STATUS " Extensions: ${BUILD_EXTENSIONS}")
225-
endif()
226-
227223
set(debug_opts)
228224
if(FORCE_ASSERT)
229225
list(APPEND debug_opts "FORCE_ASSERT")
@@ -253,6 +249,21 @@ function(duckdb_add_library target_name)
253249
_duckdb_create_interface_target(${target_name})
254250
endfunction()
255251

252+
function(duckdb_link_extensions target_name)
253+
# Link to the DuckDB static library and extensions
254+
target_link_libraries(${target_name}
255+
PRIVATE duckdb_generated_extension_loader)
256+
if(BUILD_EXTENSIONS)
257+
message(STATUS "Linking DuckDB extensions:")
258+
foreach(ext IN LISTS BUILD_EXTENSIONS)
259+
message(STATUS "- ${ext}")
260+
target_link_libraries(${target_name} PRIVATE ${ext}_extension)
261+
endforeach()
262+
else()
263+
message(STATUS "No DuckDB extensions linked in")
264+
endif()
265+
endfunction()
266+
256267
# ════════════════════════════════════════════════════════════════════════════════
257268
# Convenience Functions
258269
# ════════════════════════════════════════════════════════════════════════════════

0 commit comments

Comments
 (0)