Skip to content

Commit 6069a09

Browse files
committed
Replace CORE_EXTENSIONS with BUILD_EXTENSIONS
1 parent 11fa60f commit 6069a09

File tree

3 files changed

+34
-39
lines changed

3 files changed

+34
-39
lines changed

cmake/duckdb_loader.cmake

Lines changed: 32 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# debugging but will never allow jemalloc in a release build if not on Linux.
88
#
99
# Usage: include(cmake/duckdb_loader.cmake) # Optionally load extensions
10-
# set(CORE_EXTENSIONS "json;parquet;icu")
10+
# set(BUILD_EXTENSIONS "json;parquet;icu")
1111
#
1212
# # set sensible defaults for a debug build: duckdb_configure_for_debug()
1313
#
@@ -35,7 +35,7 @@ _duckdb_set_default(DUCKDB_SOURCE_PATH
3535
"${CMAKE_CURRENT_SOURCE_DIR}/external/duckdb")
3636

3737
# Extension list - commonly used extensions for Python
38-
_duckdb_set_default(CORE_EXTENSIONS "core_functions;parquet;icu;json")
38+
_duckdb_set_default(BUILD_EXTENSIONS "core_functions;parquet;icu;json")
3939

4040
# Core build options - disable unnecessary components for Python builds
4141
_duckdb_set_default(BUILD_SHELL OFF)
@@ -64,8 +64,8 @@ _duckdb_set_default(DEBUG_STACKTRACE OFF)
6464
set(DUCKDB_SOURCE_PATH
6565
"${DUCKDB_SOURCE_PATH}"
6666
CACHE PATH "Path to DuckDB source directory")
67-
set(CORE_EXTENSIONS
68-
"${CORE_EXTENSIONS}"
67+
set(BUILD_EXTENSIONS
68+
"${BUILD_EXTENSIONS}"
6969
CACHE STRING "Semicolon-separated list of extensions to enable")
7070
set(BUILD_SHELL
7171
"${BUILD_SHELL}"
@@ -110,40 +110,35 @@ set(DEBUG_STACKTRACE
110110

111111
function(_duckdb_validate_jemalloc_config)
112112
# Check if jemalloc is in the extension list
113-
if(NOT CORE_EXTENSIONS MATCHES "jemalloc")
113+
if(NOT BUILD_EXTENSIONS MATCHES "jemalloc")
114114
return()
115115
endif()
116116

117-
# If we're on Linux then using jemalloc is fine, otherwise we only allow it in
118-
# debug builds
119-
if(NOT CMAKE_SYSTEM_NAME STREQUAL "Linux")
120-
set(is_debug_build FALSE)
121-
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
122-
set(is_debug_build TRUE)
123-
endif()
124-
if(is_debug_build)
125-
message(
126-
WARNING
127-
"jemalloc extension enabled on ${CMAKE_SYSTEM_NAME} in Debug build.\n"
128-
"This is only recommended for debugging purposes.\n"
129-
"jemalloc is officially supported only on Linux.")
130-
else()
131-
message(
132-
WARNING
133-
"jemalloc extension is only supported on ${CMAKE_SYSTEM_NAME} in Debug builds.\n"
134-
"Removing jemalloc from extension list.\n"
135-
"In non-debug builds, jemalloc is only supported on Linux.")
136-
# Remove jemalloc from the extension list
137-
string(REPLACE "jemalloc" "" CORE_EXTENSIONS_FILTERED
138-
"${CORE_EXTENSIONS}")
139-
string(REGEX REPLACE ";+" ";" CORE_EXTENSIONS_FILTERED
140-
"${CORE_EXTENSIONS_FILTERED}")
141-
string(REGEX REPLACE "^;|;$" "" CORE_EXTENSIONS_FILTERED
142-
"${CORE_EXTENSIONS_FILTERED}")
143-
set(CORE_EXTENSIONS
144-
"${CORE_EXTENSIONS_FILTERED}"
145-
PARENT_SCOPE)
146-
endif()
117+
# 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)
127+
if(NOT jemalloc_allowed)
128+
message(
129+
WARNING
130+
"jemalloc extension is only supported on Linux and OSX in Debug builds.\n"
131+
"Removing jemalloc from extension list.")
132+
# Remove jemalloc from the extension list
133+
string(REPLACE "jemalloc" "" BUILD_EXTENSIONS_FILTERED
134+
"${BUILD_EXTENSIONS}")
135+
string(REGEX REPLACE ";+" ";" BUILD_EXTENSIONS_FILTERED
136+
"${BUILD_EXTENSIONS_FILTERED}")
137+
string(REGEX REPLACE "^;|;$" "" BUILD_EXTENSIONS_FILTERED
138+
"${BUILD_EXTENSIONS_FILTERED}")
139+
set(BUILD_EXTENSIONS
140+
"${BUILD_EXTENSIONS_FILTERED}"
141+
PARENT_SCOPE)
147142
endif()
148143
endfunction()
149144

@@ -225,8 +220,8 @@ function(_duckdb_print_summary)
225220
message(STATUS " Native Arch: ${NATIVE_ARCH}")
226221
message(STATUS " Unity Build Disabled: ${DISABLE_UNITY}")
227222

228-
if(CORE_EXTENSIONS)
229-
message(STATUS " Extensions: ${CORE_EXTENSIONS}")
223+
if(BUILD_EXTENSIONS)
224+
message(STATUS " Extensions: ${BUILD_EXTENSIONS}")
230225
endif()
231226

232227
set(debug_opts)

external/duckdb

Submodule duckdb updated 675 files

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ packages.adbc_driver_duckdb = "adbc_driver_duckdb"
8282
packages._duckdb-stubs = "_duckdb-stubs"
8383

8484
[tool.scikit-build.cmake.define]
85-
CORE_EXTENSIONS = "core_functions;json;parquet;icu;jemalloc"
85+
BUILD_EXTENSIONS = "core_functions;json;parquet;icu;jemalloc"
8686

8787
[tool.setuptools_scm]
8888
version_scheme = "duckdb_packaging.setuptools_scm_version:version_scheme"

0 commit comments

Comments
 (0)