Skip to content

Commit ca1a5dd

Browse files
committed
format
1 parent f6815ce commit ca1a5dd

File tree

6 files changed

+35
-31
lines changed

6 files changed

+35
-31
lines changed

CMakeLists.txt

+20-21
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ add_definitions(-DDUCKDB_PATCH_VERSION=${DUCKDB_PATCH_VERSION})
1717
# Enable network functionality (OpenSSL and GDAL's CURL based fs/drivers)
1818
option(SPATIAL_USE_NETWORK "Enable network functionality" ON)
1919

20-
if (EMSCRIPTEN OR IOS OR ANDROID)
20+
if(EMSCRIPTEN
21+
OR IOS
22+
OR ANDROID)
2123
set(SPATIAL_USE_NETWORK OFF)
2224
endif()
2325

@@ -32,7 +34,6 @@ include_directories(spatial/third_party/protozero/include)
3234
include_directories(spatial/third_party/shapelib)
3335
add_subdirectory(spatial/third_party/shapelib)
3436

35-
3637
add_library(${EXTENSION_NAME} STATIC ${EXTENSION_SOURCES})
3738

3839
# Build dependencies TODO: in the future we should allow users to dynamically
@@ -44,19 +45,17 @@ if(NOT EXISTS ${CMAKE_BINARY_DIR}/deps)
4445
execute_process(
4546
# Generate project
4647
COMMAND
47-
${CMAKE_COMMAND} -G ${CMAKE_GENERATOR}
48-
-DDUCKDB_ENABLE_DEPRECATED_API=1
49-
-DWASM_LOADABLE_EXTENSIONS=1
50-
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
48+
${CMAKE_COMMAND} -G ${CMAKE_GENERATOR} -DDUCKDB_ENABLE_DEPRECATED_API=1
49+
-DWASM_LOADABLE_EXTENSIONS=1 -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
5150
-DOSX_BUILD_ARCH=${OSX_BUILD_ARCH}
5251
-DSPATIAL_USE_NETWORK=${SPATIAL_USE_NETWORK}
5352
-DOPENSSL_ROOT_DIR=$ENV{OPENSSL_ROOT_DIR}
5453
-DVCPKG_MANIFEST_DIR='${VCPKG_MANIFEST_DIR}'
5554
-DVCPKG_INSTALLED_DIR='${CMAKE_BINARY_DIR}/vcpkg_installed'
5655
-DCMAKE_TOOLCHAIN_FILE='${CMAKE_TOOLCHAIN_FILE}'
5756
-DVCPKG_TARGET_TRIPLET='${VCPKG_TARGET_TRIPLET}'
58-
-DVCPKG_CHAINLOAD_TOOLCHAIN_FILE='${VCPKG_CHAINLOAD_TOOLCHAIN_FILE}'
59-
-S ${CMAKE_CURRENT_SOURCE_DIR}/deps -B ${CMAKE_BINARY_DIR}/deps
57+
-DVCPKG_CHAINLOAD_TOOLCHAIN_FILE='${VCPKG_CHAINLOAD_TOOLCHAIN_FILE}' -S
58+
${CMAKE_CURRENT_SOURCE_DIR}/deps -B ${CMAKE_BINARY_DIR}/deps
6059
RESULT_VARIABLE DEPENDENCIES_GENERATE_RESULT)
6160
if(NOT DEPENDENCIES_GENERATE_RESULT EQUAL 0)
6261
message(FATAL_ERROR "Could not generate dependencies project")
@@ -83,7 +82,7 @@ message(STATUS "Find libraries path: '${CMAKE_PREFIX_PATH}'")
8382
set(ZLIB_USE_STATIC_LIBS ON)
8483
set(OPENSSL_USE_STATIC_LIBS ON)
8584

86-
if (EMSCRIPTEN)
85+
if(EMSCRIPTEN)
8786
set(OPENSSL_USE_STATIC_LIBS OFF)
8887
endif()
8988

@@ -97,16 +96,15 @@ find_package(EXPAT REQUIRED)
9796
find_package(GeographicLib REQUIRED)
9897

9998
# Important: The link order matters, its the reverse order of dependency
100-
set(EXTENSION_DEPENDENCIES
101-
GDAL::GDAL
102-
GEOS::geos_c
103-
PROJ::proj
104-
EXPAT::EXPAT
105-
SQLite::SQLite3
106-
ZLIB::ZLIB
107-
${SQLITE3_MEMVFS}
108-
${GeographicLib_LIBRARIES}
109-
)
99+
set(EXTENSION_DEPENDENCIES
100+
GDAL::GDAL
101+
GEOS::geos_c
102+
PROJ::proj
103+
EXPAT::EXPAT
104+
SQLite::SQLite3
105+
ZLIB::ZLIB
106+
${SQLITE3_MEMVFS}
107+
${GeographicLib_LIBRARIES})
110108

111109
if(SPATIAL_USE_NETWORK)
112110
message(STATUS "Building with network functionality")
@@ -125,7 +123,7 @@ if((NOT EMSCRIPTEN) AND (NOT IOS))
125123
find_library(CoreFoundation_Library CoreFoundation)
126124
find_library(SystemConfiguration_Library SystemConfiguration)
127125
list(APPEND EXTENSION_DEPENDENCIES ${CoreFoundation_Library}
128-
${SystemConfiguration_Library})
126+
${SystemConfiguration_Library})
129127
endif()
130128
endif()
131129

@@ -139,7 +137,8 @@ target_link_libraries(${EXTENSION_NAME} PUBLIC ${EXTENSION_DEPENDENCIES})
139137
set(PARAMETERS "-warnings")
140138
build_loadable_extension(${TARGET_NAME} ${PARAMETERS} ${EXTENSION_SOURCES})
141139

142-
target_link_libraries(${TARGET_NAME}_loadable_extension ${EXTENSION_DEPENDENCIES})
140+
target_link_libraries(${TARGET_NAME}_loadable_extension
141+
${EXTENSION_DEPENDENCIES})
143142

144143
install(
145144
TARGETS ${EXTENSION_NAME}

spatial/include/spatial/doc_util.hpp

+4-3
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,14 @@ struct DocTag {
1111

1212
struct DocUtil {
1313
static void AddDocumentation(duckdb::DatabaseInstance &db, const char *function_name, const char *description,
14-
const char *example,
15-
const duckdb::unordered_map<duckdb::string, duckdb::string> &tags, duckdb::vector<duckdb::string> parameter_names = {});
14+
const char *example, const duckdb::unordered_map<duckdb::string, duckdb::string> &tags,
15+
duckdb::vector<duckdb::string> parameter_names = {});
1616

1717
// Abuse adding tags as a comment
1818
template <size_t N>
1919
static void AddDocumentation(duckdb::DatabaseInstance &db, const char *function_name, const char *description,
20-
const char *example, const DocTag (&tags)[N], duckdb::vector<duckdb::string> parameter_names = {}) {
20+
const char *example, const DocTag (&tags)[N],
21+
duckdb::vector<duckdb::string> parameter_names = {}) {
2122
duckdb::unordered_map<duckdb::string, duckdb::string> tag_map;
2223
for (size_t i = 0; i < N; i++) {
2324
tag_map[tags[i].key] = tags[i].value;

spatial/src/spatial/geos/functions/aggregate.cpp

+6-4
Original file line numberDiff line numberDiff line change
@@ -197,17 +197,19 @@ void GeosAggregateFunctions::Register(DatabaseInstance &db) {
197197

198198
AggregateFunctionSet st_intersection_agg("ST_Intersection_Agg");
199199
st_intersection_agg.AddFunction(
200-
AggregateFunction::UnaryAggregateDestructor<GEOSAggState, geometry_t, geometry_t, IntersectionAggFunction, AggregateDestructorType::LEGACY>(
201-
core::GeoTypes::GEOMETRY(), core::GeoTypes::GEOMETRY()));
200+
AggregateFunction::UnaryAggregateDestructor<GEOSAggState, geometry_t, geometry_t, IntersectionAggFunction,
201+
AggregateDestructorType::LEGACY>(core::GeoTypes::GEOMETRY(),
202+
core::GeoTypes::GEOMETRY()));
202203

203204
ExtensionUtil::RegisterFunction(db, st_intersection_agg);
204205
DocUtil::AddDocumentation(db, "ST_Intersection_Agg", INTERSECTION_DOC_DESCRIPTION, INTERSECTION_DOC_EXAMPLE,
205206
DOC_TAGS);
206207

207208
AggregateFunctionSet st_union_agg("ST_Union_Agg");
208209
st_union_agg.AddFunction(
209-
AggregateFunction::UnaryAggregateDestructor<GEOSAggState, geometry_t, geometry_t, UnionAggFunction, AggregateDestructorType::LEGACY>(
210-
core::GeoTypes::GEOMETRY(), core::GeoTypes::GEOMETRY()));
210+
AggregateFunction::UnaryAggregateDestructor<GEOSAggState, geometry_t, geometry_t, UnionAggFunction,
211+
AggregateDestructorType::LEGACY>(core::GeoTypes::GEOMETRY(),
212+
core::GeoTypes::GEOMETRY()));
211213

212214
ExtensionUtil::RegisterFunction(db, st_union_agg);
213215
DocUtil::AddDocumentation(db, "ST_Union_Agg", UNION_DOC_DESCRIPTION, UNION_DOC_EXAMPLE, DOC_TAGS);

spatial/src/spatial/geos/functions/scalar/st_buffer.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,8 @@ void GEOSScalarFunctions::RegisterStBuffer(DatabaseInstance &db) {
130130
GEOSFunctionLocalState::Init));
131131

132132
ExtensionUtil::RegisterFunction(db, set);
133-
DocUtil::AddDocumentation(db, "ST_Buffer", DOC_DESCRIPTION, DOC_EXAMPLE, DOC_TAGS, {"geom", "distance", "num_triangles", "join_style", "cap_style", "mitre_limit"});
133+
DocUtil::AddDocumentation(db, "ST_Buffer", DOC_DESCRIPTION, DOC_EXAMPLE, DOC_TAGS,
134+
{"geom", "distance", "num_triangles", "join_style", "cap_style", "mitre_limit"});
134135
}
135136

136137
} // namespace geos

spatial/src/spatial/proj/functions.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,8 @@ void ProjFunctions::Register(DatabaseInstance &db) {
510510
GeometryTransformFunction, TransformBind, nullptr, nullptr, ProjFunctionLocalState::Init));
511511

512512
ExtensionUtil::RegisterFunction(db, set);
513-
DocUtil::AddDocumentation(db, "ST_Transform", DOC_DESCRIPTION, DOC_EXAMPLE, DOC_TAGS, {"geom", "source_crs", "target_crs", "always_xy"});
513+
DocUtil::AddDocumentation(db, "ST_Transform", DOC_DESCRIPTION, DOC_EXAMPLE, DOC_TAGS,
514+
{"geom", "source_crs", "target_crs", "always_xy"});
514515
GenerateSpatialRefSysTable::Register(db);
515516
}
516517

spatial/src/spatial_extension.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ static string RemoveIndentAndTrailingWhitespace(const char *text) {
5454
void spatial::DocUtil::AddDocumentation(duckdb::DatabaseInstance &db, const char *function_name,
5555
const char *description, const char *example,
5656
const duckdb::unordered_map<duckdb::string, duckdb::string> &tags,
57-
duckdb::vector<duckdb::string> parameter_names) {
57+
duckdb::vector<duckdb::string> parameter_names) {
5858

5959
auto &system_catalog = Catalog::GetSystemCatalog(db);
6060
auto data = CatalogTransaction::GetSystemTransaction(db);

0 commit comments

Comments
 (0)