diff --git a/cmake.patch b/cmake.patch index 12a7e45..1cb39b2 100644 --- a/cmake.patch +++ b/cmake.patch @@ -1,5 +1,5 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 5f199d3518..058197542d 100644 +index 5f199d3518..5717225434 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -83,6 +83,13 @@ if (EXTENSION_STATIC_BUILD AND "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") @@ -16,20 +16,22 @@ index 5f199d3518..058197542d 100644 option(FORCE_COLORED_OUTPUT "Always produce ANSI-colored output (GNU/Clang only)." FALSE) -@@ -810,10 +817,11 @@ function(build_loadable_extension_directory NAME OUTPUT_DIRECTORY EXTENSION_VERS +@@ -810,10 +817,13 @@ function(build_loadable_extension_directory NAME OUTPUT_DIRECTORY EXTENSION_VERS COMMAND ${CMAKE_COMMAND} -E copy $ $.lib ) # Compile the library into the actual wasm file + string(TOUPPER ${NAME} EXTENSION_NAME_UPPERCASE) ++ string (REPLACE ";" " " LINKED_LIBS_STR "${DUCKDB_EXTENSION_${EXTENSION_NAME_UPPERCASE}_LINKED_LIBS}") ++ add_custom_command( TARGET ${TARGET_NAME} POST_BUILD - COMMAND emcc $.lib -o $ -sSIDE_MODULE=1 -O3 -+ COMMAND emcc $.lib -o $ -O3 -sSIDE_MODULE=2 -sEXPORTED_FUNCTIONS="_${NAME}_init" ${WASM_THREAD_FLAGS} ${DUCKDB_EXTENSION_${EXTENSION_NAME_UPPERCASE}_LINKED_LIBS} ++ COMMAND emcc $.lib -o $ -O3 -sSIDE_MODULE=2 -sEXPORTED_FUNCTIONS="_${NAME}_init" ${WASM_THREAD_FLAGS} ${LINKED_LIBS_STR}} ) endif() add_custom_command( -@@ -846,7 +854,7 @@ function(build_static_extension NAME PARAMETERS) +@@ -846,7 +856,7 @@ function(build_static_extension NAME PARAMETERS) endfunction() # Internal extension register function @@ -38,7 +40,7 @@ index 5f199d3518..058197542d 100644 string(TOLOWER ${NAME} EXTENSION_NAME_LOWERCASE) string(TOUPPER ${NAME} EXTENSION_NAME_UPPERCASE) -@@ -868,6 +876,8 @@ function(register_extension NAME DONT_LINK DONT_BUILD LOAD_TESTS PATH INCLUDE_PA +@@ -868,6 +878,8 @@ function(register_extension NAME DONT_LINK DONT_BUILD LOAD_TESTS PATH INCLUDE_PA endif() endif() @@ -47,7 +49,7 @@ index 5f199d3518..058197542d 100644 # Allows explicitly disabling extensions that may be specified in other configurations if (NOT ${DONT_BUILD} AND NOT ${EXTENSION_TESTS_ONLY}) set(DUCKDB_EXTENSION_${EXTENSION_NAME_UPPERCASE}_SHOULD_BUILD TRUE PARENT_SCOPE) -@@ -893,7 +903,7 @@ function(register_extension NAME DONT_LINK DONT_BUILD LOAD_TESTS PATH INCLUDE_PA +@@ -893,7 +905,7 @@ function(register_extension NAME DONT_LINK DONT_BUILD LOAD_TESTS PATH INCLUDE_PA endfunction() # Downloads the external extension repo at the specified commit and calls register_extension @@ -56,7 +58,7 @@ index 5f199d3518..058197542d 100644 include(FetchContent) if (${APPLY_PATCHES}) set(PATCH_COMMAND python3 ${CMAKE_SOURCE_DIR}/scripts/apply_extension_patches.py ${CMAKE_SOURCE_DIR}/.github/patches/extensions/${NAME}/) -@@ -921,6 +931,8 @@ macro(register_external_extension NAME URL COMMIT DONT_LINK DONT_BUILD LOAD_TEST +@@ -921,6 +933,8 @@ macro(register_external_extension NAME URL COMMIT DONT_LINK DONT_BUILD LOAD_TEST endif() message(STATUS "Load extension '${NAME}' from ${URL} @ ${GIT_SHORT_COMMIT}") @@ -65,7 +67,7 @@ index 5f199d3518..058197542d 100644 set(DUCKDB_EXTENSION_${EXTENSION_NAME_UPPERCASE}_EXT_VERSION "${GIT_SHORT_COMMIT}" PARENT_SCOPE) if ("${INCLUDE_PATH}" STREQUAL "") -@@ -935,13 +947,13 @@ macro(register_external_extension NAME URL COMMIT DONT_LINK DONT_BUILD LOAD_TEST +@@ -935,13 +949,13 @@ macro(register_external_extension NAME URL COMMIT DONT_LINK DONT_BUILD LOAD_TEST set(TEST_FULL_PATH "${${NAME}_extension_fc_SOURCE_DIR}/${TEST_PATH}") endif() @@ -81,7 +83,7 @@ index 5f199d3518..058197542d 100644 cmake_parse_arguments(duckdb_extension_load "${options}" "${oneValueArgs}" "" ${ARGN}) string(TOLOWER ${NAME} EXTENSION_NAME_LOWERCASE) -@@ -960,12 +972,12 @@ function(duckdb_extension_load NAME) +@@ -960,12 +974,12 @@ function(duckdb_extension_load NAME) # Remote Git extension if (${duckdb_extension_load_DONT_BUILD}) @@ -96,7 +98,7 @@ index 5f199d3518..058197542d 100644 if (NOT "${duckdb_extension_load_EXTENSION_VERSION}" STREQUAL "") set(DUCKDB_EXTENSION_${EXTENSION_NAME_UPPERCASE}_EXT_VERSION "${duckdb_extension_load_EXTENSION_VERSION}" PARENT_SCOPE) endif() -@@ -1003,7 +1015,7 @@ function(duckdb_extension_load NAME) +@@ -1003,7 +1017,7 @@ function(duckdb_extension_load NAME) set(DUCKDB_EXTENSION_${EXTENSION_NAME_UPPERCASE}_EXT_VERSION "" PARENT_SCOPE) endif() endif() @@ -105,7 +107,7 @@ index 5f199d3518..058197542d 100644 elseif(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/extension_external/${NAME}) # Local extension, default path message(STATUS "Load extension '${NAME}' from '${CMAKE_CURRENT_SOURCE_DIR}/extension_external'") -@@ -1012,7 +1024,7 @@ function(duckdb_extension_load NAME) +@@ -1012,7 +1026,7 @@ function(duckdb_extension_load NAME) else() # Local extension, default path message(STATUS "Load extension '${NAME}' from '${CMAKE_CURRENT_SOURCE_DIR}/extensions'") @@ -114,7 +116,7 @@ index 5f199d3518..058197542d 100644 set(DUCKDB_EXTENSION_${EXTENSION_NAME_UPPERCASE}_EXT_VERSION "${DUCKDB_EXTENSION_${EXTENSION_NAME_UPPERCASE}_EXT_VERSION}" PARENT_SCOPE) endif() -@@ -1024,6 +1036,7 @@ function(duckdb_extension_load NAME) +@@ -1024,6 +1038,7 @@ function(duckdb_extension_load NAME) set(DUCKDB_EXTENSION_${EXTENSION_NAME_UPPERCASE}_PATH ${DUCKDB_EXTENSION_${EXTENSION_NAME_UPPERCASE}_PATH} PARENT_SCOPE) set(DUCKDB_EXTENSION_${EXTENSION_NAME_UPPERCASE}_INCLUDE_PATH ${DUCKDB_EXTENSION_${EXTENSION_NAME_UPPERCASE}_INCLUDE_PATH} PARENT_SCOPE) set(DUCKDB_EXTENSION_${EXTENSION_NAME_UPPERCASE}_TEST_PATH ${DUCKDB_EXTENSION_${EXTENSION_NAME_UPPERCASE}_TEST_PATH} PARENT_SCOPE)