Skip to content

Commit da9f96d

Browse files
authored
Merge pull request #637 from Maxxen/main-dev
Merge with v1.3.2, apply patches
2 parents f0bfd0d + 0001ce9 commit da9f96d

File tree

114 files changed

+9929
-289703
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

114 files changed

+9929
-289703
lines changed

.github/workflows/MainDistributionPipeline.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,25 +21,24 @@ concurrency:
2121
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.head_ref || '' }}-${{ github.base_ref || '' }}-${{ github.ref != 'refs/heads/main' || github.sha }}
2222
cancel-in-progress: true
2323

24+
2425
jobs:
2526
duckdb-latest-build:
2627
name: Build extension binaries
2728
uses: duckdb/extension-ci-tools/.github/workflows/_extension_distribution.yml@main
2829
with:
29-
duckdb_version: v1.3-ossivalis
30+
duckdb_version: main
3031
extension_name: spatial
3132
ci_tools_version: main
32-
vcpkg_commit: 5e5d0e1cd7785623065e77eff011afdeec1a3574
33-
exclude_archs: linux_amd64_musl
33+
vcpkg_commit: ce613c41372b23b1f51333815feb3edd87ef8a8b
3434

3535
duckdb-latest-deploy:
3636
name: Deploy extension binaries
3737
needs: duckdb-latest-build
3838
uses: duckdb/extension-ci-tools/.github/workflows/_extension_deploy.yml@main
3939
secrets: inherit
4040
with:
41-
duckdb_version: v1.3-ossivalis
41+
duckdb_version: main
4242
ci_tools_version: main
4343
extension_name: spatial
44-
deploy_latest: ${{ startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main' }}
45-
exclude_archs: linux_amd64_musl
44+
deploy_latest: ${{ startsWith(github.ref, 'refs/heads/v') || github.ref == 'refs/heads/main' }}

CMakeLists.txt

Lines changed: 19 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -6,32 +6,28 @@ set(TARGET_NAME spatial)
66
set(EXTENSION_NAME ${TARGET_NAME}_extension)
77
set(CMAKE_CXX_STANDARD 11)
88

9+
if (EMSCRIPTEN)
10+
# _LINKED_LIBS influences only Wasm compilation
11+
# it's unclear why this is needed, but somehow the global symbol pj_release from PROJ is not properly exported otherwise
12+
# this solves by basically re-linking (at the moment the Wasm binary is actually produced)
13+
set (DUCKDB_EXTENSION_SPATIAL_LINKED_LIBS "../../vcpkg_installed/wasm32-emscripten/lib/lib*.a")
14+
endif()
15+
916
project(${TARGET_NAME})
1017

1118
add_definitions(-DDUCKDB_MAJOR_VERSION=${DUCKDB_MAJOR_VERSION})
1219
add_definitions(-DDUCKDB_MINOR_VERSION=${DUCKDB_MINOR_VERSION})
1320
add_definitions(-DDUCKDB_PATCH_VERSION=${DUCKDB_PATCH_VERSION})
21+
add_definitions(-DDUCKDB_SPATIAL_EXTENSION=1)
1422

1523
# Options
1624

1725
# Enable network functionality (OpenSSL and GDAL's CURL based fs/drivers)
1826
option(SPATIAL_USE_NETWORK "Enable network functionality" ON)
1927

20-
if (VCPKG_TARGET_IS_EMSCRIPTEN)
21-
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
22-
set(EMSCRIPTEN ON)
23-
endif()
24-
25-
2628
# Enable GEOS support
2729
option(SPATIAL_USE_GEOS "Enable GEOS support" ON)
2830

29-
if(EMSCRIPTEN
30-
OR IOS
31-
OR ANDROID)
32-
set(SPATIAL_USE_NETWORK OFF)
33-
endif()
34-
3531
add_subdirectory(src/spatial)
3632
add_subdirectory(src/sgl)
3733
include_directories(src)
@@ -46,70 +42,19 @@ add_subdirectory(src/third_party/shapelib)
4642

4743
add_library(${EXTENSION_NAME} STATIC ${EXTENSION_SOURCES})
4844

49-
# Build dependencies TODO: in the future we should allow users to dynamically
50-
# link to their own dependencies if they are building locally. If they have a
51-
# local (compatible) GDAL installation, we should use that instead of building
52-
# our own. (unless a static build is requested)
53-
54-
if(NOT EXISTS ${CMAKE_BINARY_DIR}/deps)
55-
execute_process(
56-
# Generate project
57-
COMMAND
58-
${CMAKE_COMMAND} -G ${CMAKE_GENERATOR}
59-
-DENABLE_SANITIZER=${ENABLE_SANITIZER}
60-
-DCMAKE_CXX_COMPILER='${CMAKE_CXX_COMPILER}'
61-
-DCMAKE_C_COMPILER='${CMAKE_C_COMPILER}' -DDUCKDB_ENABLE_DEPRECATED_API=1
62-
-DWASM_LOADABLE_EXTENSIONS=1 -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
63-
-DOSX_BUILD_ARCH=${OSX_BUILD_ARCH}
64-
-DSPATIAL_USE_NETWORK=${SPATIAL_USE_NETWORK}
65-
-DSPATIAL_USE_GEOS=${SPATIAL_USE_GEOS}
66-
-DOPENSSL_ROOT_DIR=$ENV{OPENSSL_ROOT_DIR}
67-
-DVCPKG_MANIFEST_DIR='${VCPKG_MANIFEST_DIR}'
68-
-DVCPKG_INSTALLED_DIR='${CMAKE_BINARY_DIR}/vcpkg_installed'
69-
-DCMAKE_TOOLCHAIN_FILE='${CMAKE_TOOLCHAIN_FILE}'
70-
-DVCPKG_TARGET_TRIPLET='${VCPKG_TARGET_TRIPLET}'
71-
-DVCPKG_CHAINLOAD_TOOLCHAIN_FILE='${VCPKG_CHAINLOAD_TOOLCHAIN_FILE}' -S
72-
${CMAKE_CURRENT_SOURCE_DIR}/deps -B ${CMAKE_BINARY_DIR}/deps
73-
RESULT_VARIABLE DEPENDENCIES_GENERATE_RESULT)
74-
if(NOT DEPENDENCIES_GENERATE_RESULT EQUAL 0)
75-
message(FATAL_ERROR "Could not generate dependencies project")
76-
endif()
77-
78-
execute_process(
79-
# Build project
80-
COMMAND ${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR}/deps --config
81-
${CMAKE_BUILD_TYPE} RESULT_VARIABLE DEPENDENCIES_BUILD_RESULT)
82-
if(NOT DEPENDENCIES_BUILD_RESULT EQUAL 0)
83-
message(FATAL_ERROR "Could not build dependencies project")
84-
endif()
85-
endif()
86-
8745
# annoyingly for expat on windows
8846
set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES} MD.lib)
89-
90-
# Add dependencies
91-
list(APPEND CMAKE_FIND_ROOT_PATH "${CMAKE_BINARY_DIR}/deps/local/")
92-
list(APPEND CMAKE_PREFIX_PATH "${CMAKE_BINARY_DIR}/deps/local/")
93-
94-
message(STATUS "Find libraries path: '${CMAKE_PREFIX_PATH}'")
95-
9647
set(ZLIB_USE_STATIC_LIBS ON)
9748
set(OPENSSL_USE_STATIC_LIBS ON)
98-
99-
if(EMSCRIPTEN)
100-
set(OPENSSL_USE_STATIC_LIBS OFF)
101-
endif()
102-
103-
find_library(SQLITE3_MEMVFS memvfs)
10449
find_package(ZLIB REQUIRED)
105-
find_package(PROJ REQUIRED)
106-
find_package(SQLite3 REQUIRED)
107-
find_package(GDAL REQUIRED)
50+
find_package(PROJ CONFIG REQUIRED)
51+
find_package(GDAL CONFIG REQUIRED)
10852
find_package(EXPAT REQUIRED)
53+
find_package(unofficial-sqlite3 CONFIG REQUIRED)
10954

11055
# Important: The link order matters, its the reverse order of dependency
111-
set(EXTENSION_DEPENDENCIES GDAL::GDAL PROJ::proj EXPAT::EXPAT SQLite::SQLite3
112-
ZLIB::ZLIB ${SQLITE3_MEMVFS})
56+
set(EXTENSION_DEPENDENCIES GDAL::GDAL PROJ::proj EXPAT::EXPAT unofficial::sqlite3::sqlite3
57+
ZLIB::ZLIB)
11358

11459
if(SPATIAL_USE_GEOS)
11560
message(STATUS "Building with GEOS functionality")
@@ -118,6 +63,11 @@ if(SPATIAL_USE_GEOS)
11863
add_definitions(-DSPATIAL_USE_GEOS=1)
11964
endif()
12065

66+
if(EMSCRIPTEN)
67+
message(STATUS "Building for Emscripten, disabling network functionality")
68+
set(SPATIAL_USE_NETWORK OFF)
69+
endif()
70+
12171
if(SPATIAL_USE_NETWORK)
12272
message(STATUS "Building with network functionality")
12373
message(STATUS "OpenSSL root dir hint: '$ENV{OPENSSL_ROOT_DIR}'")
@@ -140,7 +90,7 @@ if((NOT EMSCRIPTEN) AND (NOT IOS))
14090
endif()
14191

14292
# Add dependencies to extension
143-
target_link_libraries(${EXTENSION_NAME} PUBLIC ${EXTENSION_DEPENDENCIES})
93+
target_link_libraries(${EXTENSION_NAME} ${EXTENSION_DEPENDENCIES})
14494

14595
# Build extensions
14696
set(PARAMETERS "-warnings")

0 commit comments

Comments
 (0)