Skip to content

Commit

Permalink
Merge pull request #206 from carlopi/enableduckdbwasm
Browse files Browse the repository at this point in the history
Enable CI to compile for duckdb-wasm
  • Loading branch information
Maxxen authored Dec 10, 2023
2 parents df4cbbd + 88011e4 commit d4c9032
Show file tree
Hide file tree
Showing 17 changed files with 458 additions and 53 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/MainDistributionPipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,11 @@ concurrency:
jobs:
duckdb-stable-build:
name: Build extension binaries
uses: duckdb/duckdb/.github/workflows/_extension_distribution.yml@60ddc316ca0c1585f14d55aa73f9db59d8fc05d1
uses: duckdb/duckdb/.github/workflows/_extension_distribution.yml@6812703823d1d66566bc7eaac2b6e4b273c85333
with:
vcpkg_commit: a42af01b72c28a8e1d7b48107b33e4f286a55ef6
duckdb_version: v0.9.2
extension_name: spatial
vcpkg_commit: 9edb1b8e590cc086563301d735cae4b6e732d2d2 # TODO: remove pinned vcpkg commit when updating duckdb version
build_duckdb_shell: false

duckdb-stable-deploy:
name: Deploy extension binaries
Expand All @@ -35,4 +34,4 @@ jobs:
with:
duckdb_version: v0.9.2
extension_name: spatial
deploy_latest: ${{ startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main' }}
deploy_latest: ${{ startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main' }}
18 changes: 10 additions & 8 deletions .github/workflows/_extension_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,9 @@ jobs:
- id: parse-matrices
run: |
python3 ${{ inputs.matrix_parse_script }} --input ./duckdb/.github/config/distribution_matrix.json --deploy_matrix --output deploy_matrix.json --exclude "${{ inputs.exclude_archs }}" --pretty
cat ./duckdb/.github/config/distribution_matrix.json > distribution_matrix.json
grep wasm distribution_matrix.json || (head -n -1 ./duckdb/.github/config/distribution_matrix.json > distribution_matrix.json && echo ',"wasm":{"include":[{"duckdb_arch":"wasm_mvp","vcpkg_triplet":"wasm32-emscripten"},{"duckdb_arch":"wasm_eh","vcpkg_triplet":"wasm32-emscripten"},{"duckdb_arch":"wasm_threads","vcpkg_triplet":"wasm32-emscripten"}]}}' >> distribution_matrix.json)
python3 ${{ inputs.matrix_parse_script }} --input distribution_matrix.json --deploy_matrix --output deploy_matrix.json --exclude "${{ inputs.exclude_archs }}" --pretty
deploy_matrix="`cat deploy_matrix.json`"
echo deploy_matrix=$deploy_matrix >> $GITHUB_OUTPUT
echo `cat $GITHUB_OUTPUT`
Expand All @@ -94,18 +96,18 @@ jobs:
- uses: actions/download-artifact@v2
with:
name: ${{ inputs.extension_name }}-${{ inputs.duckdb_version }}-extension-${{matrix.duckdb_arch}}${{inputs.artifact_postfix}}
name: ${{ inputs.extension_name }}-${{ inputs.duckdb_version }}-extension-${{matrix.duckdb_arch}}${{inputs.artifact_postfix}}${{startsWith(matrix.duckdb, 'wasm') && '.wasm' || ''}}
path: |
/tmp/extension
- name: Deploy
shell: bash
env:
AWS_ACCESS_KEY_ID: ${{ secrets.S3_DEPLOY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.S3_DEPLOY_KEY }}
AWS_DEFAULT_REGION: ${{ secrets.S3_REGION }}
BUCKET_NAME: ${{ secrets.S3_BUCKET }}
DUCKDB_EXTENSION_SIGNING_PK: ${{ secrets.DUCKDB_EXTENSION_SIGNING_PK }}
AWS_ACCESS_KEY_ID: ${{ secrets.S3_DUCKDB_ORG_DEPLOY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.S3_DUCKDB_ORG_DEPLOY_KEY }}
AWS_DEFAULT_REGION: ${{ secrets.S3_DUCKDB_ORG_REGION }}
BUCKET_NAME: ${{ secrets.S3_DUCKDB_ORG_BUCKET }}
DUCKDB_EXTENSION_SIGNING_PK: ${{ secrets.S3_DUCKDB_ORG_EXTENSION_SIGNING_PK }}
run: |
pwd
python3 -m pip install pip awscli
Expand All @@ -118,4 +120,4 @@ jobs:
git fetch --tags
export EXT_VERSION=`git tag --points-at HEAD`
export EXT_VERSION=${EXT_VERSION:=`git log -1 --format=%h`}
${{ inputs.deploy_script }} ${{ inputs.extension_name }} $EXT_VERSION $DUCKDB_VERSION ${{ matrix.duckdb_arch }} $BUCKET_NAME ${{inputs.deploy_latest || 'true' && 'false'}} ${{inputs.deploy_versioned || 'true' && 'false'}}
${{ inputs.deploy_script }} ${{ inputs.extension_name }} $EXT_VERSION $DUCKDB_VERSION ${{ matrix.duckdb_arch }} $BUCKET_NAME ${{inputs.deploy_latest || 'true' && 'false'}} ${{inputs.deploy_versioned || 'true' && 'false'}}
27 changes: 23 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ add_definitions(-DDUCKDB_PATCH_VERSION=${DUCKDB_PATCH_VERSION})
# Enable network functionality (OpenSSL and GDAL's CURL based fs/drivers)
option(SPATIAL_USE_NETWORK "Enable network functionality" ON)

if (EMSCRIPTEN)
set(SPATIAL_USE_NETWORK OFF)
endif()

include_directories(spatial/include)
add_subdirectory(spatial/src)

Expand All @@ -39,6 +43,8 @@ execute_process(
# Generate project
COMMAND
${CMAKE_COMMAND} -G ${CMAKE_GENERATOR}
-DDUCKDB_ENABLE_DEPRECATED_API=1
-DWASM_LOADABLE_EXTENSIONS=1
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-DOSX_BUILD_ARCH=${OSX_BUILD_ARCH}
-DSPATIAL_USE_NETWORK=${SPATIAL_USE_NETWORK}
Expand All @@ -65,8 +71,19 @@ set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH}
${CMAKE_BINARY_DIR}/deps/local)
set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES} MD.lib
)# annoyingly for expat on windows

list(APPEND CMAKE_FIND_ROOT_PATH "${CMAKE_BINARY_DIR}/deps/local/")
list(APPEND CMAKE_PREFIX_PATH "${CMAKE_BINARY_DIR}/deps/local/")

message(STATUS "Find libraries path: '${CMAKE_PREFIX_PATH}'")

set(ZLIB_USE_STATIC_LIBS ON)
set(OPENSSL_USE_STATIC_LIBS ON)

if (EMSCRIPTEN)
set(OPENSSL_USE_STATIC_LIBS OFF)
endif()

find_library(SQLITE3_MEMVFS memvfs)
find_package(ZLIB REQUIRED)
find_package(PROJ REQUIRED)
Expand Down Expand Up @@ -100,11 +117,13 @@ if(WIN32)
list(APPEND EXTENSION_DEPENDENCIES wbemuuid.lib)
endif()

if(APPLE)
find_library(CoreFoundation_Library CoreFoundation)
find_library(SystemConfiguration_Library SystemConfiguration)
list(APPEND EXTENSION_DEPENDENCIES ${CoreFoundation_Library}
if(NOT EMSCRIPTEN)
if(APPLE)
find_library(CoreFoundation_Library CoreFoundation)
find_library(SystemConfiguration_Library SystemConfiguration)
list(APPEND EXTENSION_DEPENDENCIES ${CoreFoundation_Library}
${SystemConfiguration_Library})
endif()
endif()

# Geographiclib is special
Expand Down
32 changes: 31 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ ifeq ($(GEN),ninja)
GENERATOR=-G "Ninja" -DFORCE_COLORED_OUTPUT=1
endif

EXT_NAME=spatial

#### Configuration for this extension
EXTENSION_NAME=SPATIAL
Expand All @@ -54,6 +55,10 @@ EXTRA_EXTENSIONS_FLAG=-DBUILD_EXTENSIONS="parquet;json"
BUILD_FLAGS=-DEXTENSION_STATIC_BUILD=1 $(EXTENSION_FLAGS) ${EXTRA_EXTENSIONS_FLAG} $(OSX_BUILD_FLAG) $(TOOLCHAIN_FLAGS)
ifeq (${BUILD_SHELL}, 0)
BUILD_FLAGS += -DBUILD_SHELL=0
else
ifeq ($(OS),Windows_NT)
BUILD_FLAGS += -DBUILD_SHELL=0
endif
endif
CLIENT_FLAGS:=

Expand Down Expand Up @@ -141,4 +146,29 @@ clean:
rm -rf build
rm -rf testext
#cd duckdb && make clean
#cd duckdb && make clean-python
#cd duckdb && make clean-python

VCPKG_EMSDK_FLAGS=-DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=$(EMSDK)/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake
WASM_COMPILE_TIME_COMMON_FLAGS=-DWASM_LOADABLE_EXTENSIONS=1 -DBUILD_EXTENSIONS_ONLY=1 -DSKIP_EXTENSIONS="parquet;json" $(VCPKG_EMSDK_FLAGS)
WASM_CXX_MVP_FLAGS=
WASM_CXX_EH_FLAGS=$(WASM_CXX_MVP_FLAGS) -fwasm-exceptions -DWEBDB_FAST_EXCEPTIONS=1
WASM_CXX_THREADS_FLAGS=$(WASM_COMPILE_TIME_EH_FLAGS) -DWITH_WASM_THREADS=1 -DWITH_WASM_SIMD=1 -DWITH_WASM_BULK_MEMORY=1
WASM_LINK_TIME_FLAGS=../../deps/local/lib/*.a

wasm_mvp:
mkdir -p build/wasm_mvp
emcmake cmake $(GENERATOR) $(EXTENSION_FLAGS) $(WASM_COMPILE_TIME_COMMON_FLAGS) -Bbuild/wasm_mvp -DCMAKE_CXX_FLAGS="$(WASM_CXX_MVP_FLAGS) -DDUCKDB_CUSTOM_PLATFORM=wasm_mvp" -S duckdb
emmake make -j8 -Cbuild/wasm_mvp
cd build/wasm_mvp/extension/${EXT_NAME} && emcc $f -sSIDE_MODULE=1 -o ../../${EXT_NAME}.duckdb_extension.wasm -O3 ${EXT_NAME}.duckdb_extension $(WASM_LINK_TIME_FLAGS)

wasm_eh:
mkdir -p build/wasm_eh
emcmake cmake $(GENERATOR) $(EXTENSION_FLAGS) $(WASM_COMPILE_TIME_COMMON_FLAGS) -Bbuild/wasm_eh -DCMAKE_CXX_FLAGS="$(WASM_CXX_EH_FLAGS) -DDUCKDB_CUSTOM_PLATFORM=wasm_eh" -S duckdb
emmake make -j8 -Cbuild/wasm_eh
cd build/wasm_eh/extension/${EXT_NAME} && emcc $f -sSIDE_MODULE=1 -o ../../${EXT_NAME}.duckdb_extension.wasm -O3 ${EXT_NAME}.duckdb_extension $(WASM_LINK_TIME_FLAGS)

wasm_threads:
mkdir -p ./build/wasm_threads
emcmake cmake $(GENERATOR) $(EXTENSION_FLAGS) $(WASM_COMPILE_TIME_COMMON_FLAGS) -Bbuild/wasm_threads -DCMAKE_CXX_FLAGS="$(WASM_CXX_THREADS_FLAGS) -DDUCKDB_CUSTOM_PLATFORM=wasm_threads" -S duckdb
emmake make -j8 -Cbuild/wasm_threads
cd build/wasm_threads/extension/${EXT_NAME} && emcc $f -sSIDE_MODULE=1 -o ../../${EXT_NAME}.duckdb_extension.wasm -O3 ${EXT_NAME}.duckdb_extension $(WASM_LINK_TIME_FLAGS)
63 changes: 45 additions & 18 deletions deps/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,28 @@ if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.24.0")
cmake_policy(SET CMP0135 NEW)
endif()

if (OSX_BUILD_ARCH)
message(STATUS "building for OSX architecture: ${OSX_BUILD_ARCH}")
if (NOT APPLE)
error("This only makes sense on OSX")
if (NOT EMSCRIPTEN)
if (OSX_BUILD_ARCH)
message(STATUS "building for OSX architecture: ${OSX_BUILD_ARCH}")
if (NOT APPLE)
error("This only makes sense on OSX")
endif()
set(CMAKE_OSX_ARCHITECTURES ${OSX_BUILD_ARCH})
# Escape semicolons in CMAKE_OSX_ARCHITECTURES before passing to ExternalProject_Add
string(REPLACE ";" "$<SEMICOLON>" CMAKE_OSX_ARCHITECTURES_PACKED "${CMAKE_OSX_ARCHITECTURES}")
endif()
set(CMAKE_OSX_ARCHITECTURES ${OSX_BUILD_ARCH})

# Escape semicolons in CMAKE_OSX_ARCHITECTURES before passing to ExternalProject_Add
string(REPLACE ";" "$<SEMICOLON>" CMAKE_OSX_ARCHITECTURES_PACKED "${CMAKE_OSX_ARCHITECTURES}")
endif()

set(CMAKE_FLAGS_POINTER_SIZE )
set(CMAKE_PROJ_FLAGS )
set(CMAKE_GDAL_FLAGS )
set(PATCH_NAME_ENDING )
if (EMSCRIPTEN)
set(CMAKE_FLAGS_POINTER_SIZE -DCMAKE_SIZEOF_VOID_P=4 -DCMAKE_SIZEOF_VOIDP=4)
set(CMAKE_PROJ_FLAGS -DCMAKE_MODULE_PATH=${LOCAL_INSTALL_DIR}/lib/cmake -DSQLITE3_INCLUDE_DIR=${LOCAL_INSTALL_DIR}/include -DSQLITE3_LIBRARY=${LOCAL_INSTALL_DIR}/lib/libsqlite3.a)
set(CMAKE_GDAL_FLAGS -DACCEPT_MISSING_LINUX_FS_HEADER=ON -DSIZEOF_INT=4 -DSIZEOF_UNSIGNED_LONG=4 -DSIZEOF_OFF_T=4 -DGEOS_DIR=${LOCAL_INSTALL_DIR}/lib/cmake/geos -DGeographicLib_DIR=${LOCAL_INSTALL_DIR}/lib/cmake/GeographicLib -DSQLITE3_LIBRARY=${LOCAL_INSTALL_DIR}/lib/libsqlite3.a)
set(PATCH_NAME_ENDING _wasm)
endif()

# ZLIB
ExternalProject_Add(
Expand All @@ -31,16 +42,21 @@ ExternalProject_Add(
CMAKE_ARGS
-DCMAKE_INSTALL_PREFIX:PATH=${LOCAL_INSTALL_DIR}
-DCMAKE_PREFIX_PATH=${LOCAL_INSTALL_DIR}
-DCMAKE_MODULE_PATH=${LOCAL_INSTALL_DIR}/lib/cmake
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-DBUILD_SHARED_LIBS=OFF
-DCMAKE_OSX_ARCHITECTURES=${CMAKE_OSX_ARCHITECTURES_PACKED}
-DCMAKE_POSITION_INDEPENDENT_CODE=ON
-DBUILD_SHARED_LIBS=OFF
${CMAKE_FLAGS_POINTER_SIZE}
# vcpkg options
-DVCPKG_MANIFEST_DIR='${VCPKG_MANIFEST_DIR}'
-DVCPKG_INSTALLED_DIR='${VCPKG_INSTALLED_DIR}'
-DCMAKE_TOOLCHAIN_FILE='${CMAKE_TOOLCHAIN_FILE}'
-DVCPKG_TARGET_TRIPLET='${VCPKG_TARGET_TRIPLET}'
)
if (EMSCRIPTEN)
find_program(EXE_SQLITE3 sqlite3)
endif()
set(GDAL_DEPENDENCIES ${GDAL_DEPENDENCIES} ZLIB)

# SQLite3
Expand All @@ -49,11 +65,12 @@ ExternalProject_Add(
DEPENDS ZLIB
URL ${CMAKE_CURRENT_SOURCE_DIR}/vendor/sqlite3
CONFIGURE_HANDLED_BY_BUILD TRUE
CMAKE_ARGS
CMAKE_ARGS
-DCMAKE_INSTALL_PREFIX:PATH=${LOCAL_INSTALL_DIR}
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-DCMAKE_OSX_ARCHITECTURES=${CMAKE_OSX_ARCHITECTURES_PACKED}
-DCMAKE_POSITION_INDEPENDENT_CODE=ON
${CMAKE_FLAGS_POINTER_SIZE}
# vcpkg options
-DVCPKG_MANIFEST_DIR='${VCPKG_MANIFEST_DIR}'
-DVCPKG_INSTALLED_DIR='${VCPKG_INSTALLED_DIR}'
Expand All @@ -73,9 +90,9 @@ ExternalProject_Add(
-DCMAKE_INSTALL_PREFIX:PATH=${LOCAL_INSTALL_DIR}
-DCMAKE_PREFIX_PATH=${LOCAL_INSTALL_DIR}
-DCMAKE_DEBUG_POSTFIX=${} # Do not append "d" to the library name when building in debug mode
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-DCMAKE_OSX_ARCHITECTURES=${CMAKE_OSX_ARCHITECTURES_PACKED}
-DCMAKE_POSITION_INDEPENDENT_CODE=ON
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
# vcpkg options
-DVCPKG_MANIFEST_DIR='${VCPKG_MANIFEST_DIR}'
-DVCPKG_INSTALLED_DIR='${VCPKG_INSTALLED_DIR}'
Expand All @@ -100,13 +117,16 @@ ExternalProject_Add(
DEPENDS SQLITE3 ZLIB
URL ${CMAKE_CURRENT_SOURCE_DIR}/vendor/proj-9.1.1.zip
CONFIGURE_HANDLED_BY_BUILD TRUE
PATCH_COMMAND patch -p1 < "${CMAKE_CURRENT_LIST_DIR}/patches/proj${PATCH_NAME_ENDING}.patch"
CMAKE_ARGS
# CMake options
-DCMAKE_OSX_ARCHITECTURES=${CMAKE_OSX_ARCHITECTURES_PACKED}
-DCMAKE_POSITION_INDEPENDENT_CODE=ON
-DCMAKE_PREFIX_PATH=${LOCAL_INSTALL_DIR}
-DCMAKE_INSTALL_PREFIX:PATH=${LOCAL_INSTALL_DIR}
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-DCMAKE_OSX_ARCHITECTURES=${CMAKE_OSX_ARCHITECTURES_PACKED}
-DCMAKE_POSITION_INDEPENDENT_CODE=ON
${CMAKE_PROJ_FLAGS}
${CMAKE_FLAGS_POINTER_SIZE}
# vcpkg options
-DVCPKG_MANIFEST_DIR='${VCPKG_MANIFEST_DIR}'
-DVCPKG_INSTALLED_DIR='${VCPKG_INSTALLED_DIR}'
Expand All @@ -126,6 +146,7 @@ ExternalProject_Add(
EXPAT
URL ${CMAKE_CURRENT_SOURCE_DIR}/vendor/expat-2.5.0.tar.bz2
CONFIGURE_HANDLED_BY_BUILD TRUE
PATCH_COMMAND patch -p1 < "${CMAKE_CURRENT_LIST_DIR}/patches/expat${PATCH_NAME_ENDING}.patch"
CMAKE_ARGS
# CMake options
-DCMAKE_INSTALL_PREFIX:PATH=${LOCAL_INSTALL_DIR}
Expand Down Expand Up @@ -156,9 +177,11 @@ ExternalProject_Add(
CMAKE_ARGS
# CMake options
-DCMAKE_INSTALL_PREFIX:PATH=${LOCAL_INSTALL_DIR}
-DCMAKE_PREFIX_PATH=${LOCAL_INSTALL_DIR}
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-DCMAKE_OSX_ARCHITECTURES=${CMAKE_OSX_ARCHITECTURES_PACKED}
-DCMAKE_POSITION_INDEPENDENT_CODE=ON
${CMAKE_FLAGS_POINTER_SIZE}
# vcpkg options
-DVCPKG_MANIFEST_DIR='${VCPKG_MANIFEST_DIR}'
-DVCPKG_INSTALLED_DIR='${VCPKG_INSTALLED_DIR}'
Expand All @@ -178,10 +201,12 @@ ExternalProject_Add(
GEOGRAPHICLIB
URL ${CMAKE_CURRENT_SOURCE_DIR}/vendor/GeographicLib-2.2.zip
CONFIGURE_HANDLED_BY_BUILD TRUE
PATCH_COMMAND patch -p1 < "${CMAKE_CURRENT_LIST_DIR}/patches/geographiclib${PATCH_NAME_ENDING}.patch"
CMAKE_ARGS
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-DCMAKE_OSX_ARCHITECTURES=${CMAKE_OSX_ARCHITECTURES_PACKED}
-DCMAKE_INSTALL_PREFIX:PATH=${LOCAL_INSTALL_DIR}
-DCMAKE_PREFIX_PATH=${LOCAL_INSTALL_DIR}
-DCMAKE_OSX_ARCHITECTURES=${CMAKE_OSX_ARCHITECTURES_PACKED}
-DCMAKE_POSITION_INDEPENDENT_CODE=ON
# vcpkg options
-DVCPKG_MANIFEST_DIR='${VCPKG_MANIFEST_DIR}'
Expand All @@ -200,16 +225,17 @@ ExternalProject_Add(
DEPENDS ${GDAL_DEPENDENCIES}
URL ${CMAKE_CURRENT_SOURCE_DIR}/vendor/gdal380.zip
CONFIGURE_HANDLED_BY_BUILD TRUE
PATCH_COMMAND patch -p1 < "${CMAKE_CURRENT_LIST_DIR}/patches/remove_filehandler.patch"
PATCH_COMMAND patch -p1 < "${CMAKE_CURRENT_LIST_DIR}/patches/remove_filehandler${PATCH_NAME_ENDING}.patch"
CMAKE_ARGS
# CMake options
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-DCMAKE_OSX_ARCHITECTURES=${CMAKE_OSX_ARCHITECTURES_PACKED}
-DCMAKE_INSTALL_PREFIX:PATH=${LOCAL_INSTALL_DIR}
-DCMAKE_OSX_ARCHITECTURES=${CMAKE_OSX_ARCHITECTURES_PACKED}
-DCMAKE_POSITION_INDEPENDENT_CODE=ON
-DCMAKE_PREFIX_PATH=${LOCAL_INSTALL_DIR}
-DCMAKE_MODULE_PATH=${LOCAL_INSTALL_DIR}/lib/cmake
-DCMAKE_POSITION_INDEPENDENT_CODE=ON
-DCMAKE_FIND_ROOT_PATH=${LOCAL_INSTALL_DIR}
${CMAKE_FLAGS_POINTER_SIZE}
# vcpkg options
-DVCPKG_MANIFEST_DIR='${VCPKG_MANIFEST_DIR}'
-DVCPKG_INSTALLED_DIR='${VCPKG_INSTALLED_DIR}'
Expand All @@ -221,6 +247,7 @@ ExternalProject_Add(
-DBUILD_APPS=OFF
# Build static library
-DBUILD_SHARED_LIBS=OFF
${CMAKE_GDAL_FLAGS}

# Arrow
-DGDAL_USE_ARROW=OFF
Expand Down Expand Up @@ -306,4 +333,4 @@ ExternalProject_Add(


# Ouch! Remember that the order of these libraries is important! (reverse order of dependencies)
#target_link_libraries(dependencies INTERFACE gdal geos_c geos proj expat memvfs sqlite3 zlib)
#target_link_libraries(dependencies INTERFACE gdal geos_c geos proj expat memvfs sqlite3 zlib)
Empty file added deps/patches/expat.patch
Empty file.
17 changes: 17 additions & 0 deletions deps/patches/expat_wasm.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
--- /ConfigureChecks.cmake 2023-11-28 16:13:15
+++ /ConfigureChecks.cmake 2023-11-28 15:58:45
@@ -37,13 +37,7 @@
#/* Define to 1 if you have the ANSI C header files. */
check_include_files("stdlib.h;stdarg.h;string.h;float.h" STDC_HEADERS)

-test_big_endian(WORDS_BIGENDIAN)
-#/* 1234 = LIL_ENDIAN, 4321 = BIGENDIAN */
-if(WORDS_BIGENDIAN)
- set(BYTEORDER 4321)
-else(WORDS_BIGENDIAN)
- set(BYTEORDER 1234)
-endif(WORDS_BIGENDIAN)
+set(BYTEORDER 1234)

if(HAVE_SYS_TYPES_H)
check_symbol_exists("off_t" "sys/types.h" OFF_T)
Empty file added deps/patches/gdal.patch
Empty file.
12 changes: 12 additions & 0 deletions deps/patches/gdal_wasm.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
--- /cmake/helpers/configure.cmake 2023-12-04 11:26:04
+++ /cmake/helpers/configure.cmake 2023-12-04 11:27:03
@@ -72,7 +72,8 @@

else ()
# linux, mac and mingw/windows
- test_big_endian(WORDS_BIGENDIAN)
+ set(WORDS_BIGENDIAN FALSE)
+ # test_big_endian(WORDS_BIGENDIAN)
if (MINGW)
set(THREADS_PREFER_PTHREAD_FLAG ON)
endif ()
Empty file.
Loading

0 comments on commit d4c9032

Please sign in to comment.