Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[libspatialindex] Update to 1.9.3 #17506

Merged
merged 12 commits into from
May 26, 2021
6 changes: 0 additions & 6 deletions ports/libspatialindex/CONTROL

This file was deleted.

20 changes: 14 additions & 6 deletions ports/libspatialindex/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,16 +1,25 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO libspatialindex/libspatialindex
REF 1.9.0
SHA512 368537e9bfe52db96486a1febfabe035f9f7714fd1cb50450e3ab89d51c5ffffb0e2ea219e08bee34f772ba9813a3a7f9e63d8b8946887ce83811ef68d17d1cc
REF 1.9.3
SHA512 d4c608abbd631dc163b7b4fb6bf09dee3e85ce692a5f8875d51f05a26e09c75cd17dff1ed9d2c232a071f0f5864d21d877b4cbc252f3416896db24dfa3fa18cb
HEAD_REF master
PATCHES
PATCHES
static.patch
)

if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
set(BUILD_SHARED_LIBS ON)
else()
set(BUILD_SHARED_LIBS OFF)
endif()
longhuan2018 marked this conversation as resolved.
Show resolved Hide resolved

longhuan2018 marked this conversation as resolved.
Show resolved Hide resolved
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
OPTIONS -DCMAKE_DEBUG_POSTFIX=d -DSIDX_BUILD_TESTS:BOOL=OFF
OPTIONS
-DCMAKE_DEBUG_POSTFIX=d
-DSIDX_BUILD_TESTS:BOOL=OFF
-DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS}
longhuan2018 marked this conversation as resolved.
Show resolved Hide resolved
)

vcpkg_install_cmake()
Expand All @@ -21,5 +30,4 @@ vcpkg_copy_pdbs()
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)

# Handle copyright
file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/libspatialindex)
file(RENAME ${CURRENT_PACKAGES_DIR}/share/libspatialindex/COPYING ${CURRENT_PACKAGES_DIR}/share/libspatialindex/copyright)
file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
76 changes: 66 additions & 10 deletions ports/libspatialindex/static.patch
Original file line number Diff line number Diff line change
@@ -1,21 +1,77 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c34ee8d71..84e4a9247 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -43,7 +43,7 @@ SET(SIDX_VERSION_MINOR "9")
SET(SIDX_VERSION_PATCH "3")
SET(SIDX_LIB_VERSION "6.1.1")
SET(SIDX_LIB_SOVERSION "6")
-SET(BUILD_SHARED_LIBS ON)
+option(BUILD_SHARED_LIBS "Build shared libs" ON)


set(SIDX_VERSION_STRING "${SIDX_VERSION_MAJOR}.${SIDX_VERSION_MINOR}.${SIDX_VERSION_PATCH}")

diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index e6b733bd..8f227ab0 100644
index 90f4501bc..aad327181 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -194,9 +194,13 @@ if (NOT WITH_STATIC_LASZIP)
endif()
endif()
@@ -188,9 +188,13 @@ set(SIDX_SOURCES
#endif()


-add_library(${SIDX_LIB_NAME} SHARED ${SIDX_SOURCES})
-add_library(${SIDX_LIB_NAME} ${SIDX_SOURCES})
-
-add_library(${SIDX_C_LIB_NAME} SHARED ${SIDX_CAPI_CPP})
-add_library(${SIDX_C_LIB_NAME} ${SIDX_CAPI_CPP})
+if(BUILD_SHARED_LIBS)
+ add_library(${SIDX_LIB_NAME} SHARED ${SIDX_SOURCES})
+ add_library(${SIDX_C_LIB_NAME} SHARED ${SIDX_CAPI_CPP})
+ add_library(${SIDX_LIB_NAME} SHARED ${SIDX_SOURCES})
+ add_library(${SIDX_C_LIB_NAME} SHARED ${SIDX_CAPI_CPP})
+else(BUILD_SHARED_LIBS)
+ add_library(${SIDX_LIB_NAME} STATIC ${SIDX_SOURCES})
+ add_library(${SIDX_C_LIB_NAME} STATIC ${SIDX_CAPI_CPP})
+ add_library(${SIDX_LIB_NAME} STATIC ${SIDX_SOURCES})
+ add_library(${SIDX_C_LIB_NAME} STATIC ${SIDX_CAPI_CPP})
+endif(BUILD_SHARED_LIBS)

target_link_libraries(${SIDX_C_LIB_NAME}
${SIDX_LIB_NAME}
@@ -208,9 +212,10 @@ if(WIN32)
target_compile_options(${SIDX_LIB_NAME} PRIVATE "/wd4068")
target_compile_options(${SIDX_C_LIB_NAME} PRIVATE "/wd4068")

- target_compile_definitions(${SIDX_C_LIB_NAME} PRIVATE "-DSIDX_DLL_EXPORT=1")
- target_compile_definitions(${SIDX_LIB_NAME} PRIVATE "-DSIDX_DLL_EXPORT=1")
- if (NOT WITH_STATIC_SIDX)
+ if (BUILD_SHARED_LIBS)
+ target_compile_definitions(${SIDX_C_LIB_NAME} PRIVATE "-DSIDX_DLL_EXPORT=1")
+ target_compile_definitions(${SIDX_LIB_NAME} PRIVATE "-DSIDX_DLL_EXPORT=1")
+ else()
target_compile_definitions(${SIDX_LIB_NAME} PRIVATE "-DSIDX_DLL_IMPORT=1")
target_compile_definitions(${SIDX_C_LIB_NAME} PRIVATE "-DSIDX_DLL_IMPORT=1")
endif()

diff --git a/include/spatialindex/capi/sidx_export.h b/include/spatialindex/capi/sidx_export.h
index b6c84f1ef..7b0a39364 100644
--- a/include/spatialindex/capi/sidx_export.h
+++ b/include/spatialindex/capi/sidx_export.h
@@ -29,7 +29,7 @@
#pragma once

#ifndef SIDX_C_DLL
-#if defined(_MSC_VER)
+#if defined(_MSC_VER) && defined(SIDX_DLL_EXPORT)
# define SIDX_C_DLL __declspec(dllexport)
# define SIDX_DLL __declspec(dllexport)
#else

diff --git a/include/spatialindex/tools/Tools.h b/include/spatialindex/tools/Tools.h
index 322bc819e..46b62fa00 100644
--- a/include/spatialindex/tools/Tools.h
+++ b/include/spatialindex/tools/Tools.h
@@ -46,7 +46,7 @@
#ifdef SIDX_DLL_EXPORT
#define SIDX_DLL __declspec(dllexport)
#else
- #define SIDX_DLL __declspec(dllimport)
+ #define SIDX_DLL
#endif

// Nuke this annoying warning. See http://www.unknownroad.com/rtfm/VisualStudio/warningC4251.html
9 changes: 9 additions & 0 deletions ports/libspatialindex/vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"name": "libspatialindex",
"version": "1.9.3",
"description": "C++ implementation of R*-tree, an MVR-tree and a TPR-tree with C API.",
"homepage": "http://libspatialindex.github.com",
"dependencies": [
"zlib"
]
}
2 changes: 1 addition & 1 deletion versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -3489,7 +3489,7 @@
"port-version": 4
},
"libspatialindex": {
"baseline": "1.9.0",
"baseline": "1.9.3",
"port-version": 0
},
"libspatialite": {
Expand Down
5 changes: 5 additions & 0 deletions versions/l-/libspatialindex.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "11be717916e7d0d047992f511ef2ef665be90ef4",
"version": "1.9.3",
"port-version": 0
},
{
"git-tree": "4313465aee191d0e9e0154f01beaf2e4e47a3e4f",
"version-string": "1.9.0",
Expand Down