Skip to content

Commit 625e2f8

Browse files
Fix jemalloc cmake filter (#249)
This fixes a bug in the cmake function that checks whether we should include jemalloc in our extension list. Should make sure that jemalloc not included on Windows.
2 parents 0dd3514 + 46286c1 commit 625e2f8

1 file changed

Lines changed: 18 additions & 9 deletions

File tree

cmake/duckdb_loader.cmake

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -115,15 +115,19 @@ function(_duckdb_validate_jemalloc_config)
115115
endif()
116116

117117
# jemalloc is only allowed in linux and osx debug builds
118-
set(supported_os
119-
CMAKE_SYSTEM_NAME
120-
STREQUAL
121-
"Darwin"
122-
OR
123-
CMAKE_SYSTEM_NAME
124-
STREQUAL
125-
"Linux")
126-
set(jemalloc_allowed CMAKE_BUILD_TYPE STREQUAL "Debug" AND supported_os)
118+
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin" OR CMAKE_SYSTEM_NAME STREQUAL "Linux")
119+
set(supported_os TRUE)
120+
else()
121+
set(supported_os FALSE)
122+
endif()
123+
124+
# jemalloc is only allowed in debug builds
125+
if(CMAKE_BUILD_TYPE STREQUAL "Debug" AND supported_os)
126+
set(jemalloc_allowed TRUE)
127+
else()
128+
set(jemalloc_allowed FALSE)
129+
endif()
130+
127131
if(NOT jemalloc_allowed)
128132
message(
129133
WARNING
@@ -247,6 +251,11 @@ function(duckdb_add_library target_name)
247251

248252
# Create clean interface target
249253
_duckdb_create_interface_target(${target_name})
254+
255+
# Propagate BUILD_EXTENSIONS back to caller scope in case it was modified
256+
set(BUILD_EXTENSIONS
257+
"${BUILD_EXTENSIONS}"
258+
PARENT_SCOPE)
250259
endfunction()
251260

252261
function(duckdb_link_extensions target_name)

0 commit comments

Comments
 (0)