(#21333) duckdb: add version 0.9.2

* duckdb: add version 0.9.2

* drop support msvc shared debug build in 0.9.2
This commit is contained in:
toge
2023-12-06 01:08:38 +09:00
committed by GitHub
parent b68bfcf503
commit 36db4d88d1
4 changed files with 131 additions and 0 deletions

View File

@@ -1,4 +1,7 @@
sources:
"0.9.2":
url: "https://github.com/duckdb/duckdb/archive/refs/tags/v0.9.2.tar.gz"
sha256: "afff7bd925a98dc2af4039b8ab2159b0705cbf5e0ee05d97f7bb8dce5f880dc2"
"0.9.0":
url: "https://github.com/duckdb/duckdb/archive/refs/tags/v0.9.0.tar.gz"
sha256: "3dbf3326a831bf0797591572440e81a3d6d668f8e33a25ce04efae19afc3a23d"
@@ -21,6 +24,10 @@ sources:
url: "https://github.com/duckdb/duckdb/archive/refs/tags/v0.5.1.tar.gz"
sha256: "3dab7ba0d0f8d024d3c73fd3d4fb8834203c31d7b0ddb1e8539ee266e11b0e9b"
patches:
"0.9.2":
- patch_file: "patches/0.9.2-0001-fix-cmake.patch"
patch_description: "install static of shared library, add installation for odbc extention"
patch_type: "portability"
"0.9.0":
- patch_file: "patches/0.9.0-0001-fix-cmake.patch"
patch_description: "install static of shared library, add installation for odbc extention"

View File

@@ -1,4 +1,5 @@
from conan import ConanFile
from conan.errors import ConanInvalidConfiguration
from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rm, rmdir, replace_in_file
from conan.tools.build import check_min_cppstd
from conan.tools.scm import Version
@@ -89,6 +90,10 @@ class DuckdbConan(ConanFile):
def validate(self):
if self.settings.compiler.cppstd:
check_min_cppstd(self, self._min_cppstd)
# FIXME: drop support MSVC debug shared build
if Version(self.version) >= "0.9.2" and \
is_msvc(self) and self.options.shared and self.settings.build_type == "Debug":
raise ConanInvalidConfiguration(f"{self.ref} does not support MSVC debug shared build")
def source(self):
get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True)

View File

@@ -0,0 +1,117 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 67444db..c34c3ce 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -721,7 +721,7 @@ function(build_static_extension NAME PARAMETERS)
set(FILES ${ARGV})
list(REMOVE_AT FILES 0)
add_library(${NAME}_extension STATIC ${FILES})
- target_link_libraries(${NAME}_extension duckdb_static)
+# target_link_libraries(${NAME}_extension duckdb_static)
endfunction()
# Internal extension register function
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index cda2d86..011ecb5 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -76,21 +76,21 @@ else()
duckdb_hyperloglog
duckdb_fastpforlib
duckdb_mbedtls)
-
+ if(BUILD_SHARED_LIBS)
add_library(duckdb SHARED ${ALL_OBJECT_FILES})
target_link_libraries(duckdb ${DUCKDB_LINK_LIBS})
link_threads(duckdb)
link_extension_libraries(duckdb)
-
+ endif()
add_library(duckdb_static STATIC ${ALL_OBJECT_FILES})
target_link_libraries(duckdb_static ${DUCKDB_LINK_LIBS})
link_threads(duckdb_static)
link_extension_libraries(duckdb_static)
-
+ if(BUILD_SHARED_LIBS)
target_include_directories(
duckdb PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
-
+ endif()
target_include_directories(
duckdb_static PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
@@ -105,10 +105,18 @@ else()
DESTINATION "${INSTALL_INCLUDE_DIR}")
endif()
-
+if(BUILD_SHARED_LIBS)
install(
- TARGETS duckdb duckdb_static
+ TARGETS duckdb
EXPORT "${DUCKDB_EXPORT_SET}"
LIBRARY DESTINATION "${INSTALL_LIB_DIR}"
ARCHIVE DESTINATION "${INSTALL_LIB_DIR}"
RUNTIME DESTINATION "${INSTALL_BIN_DIR}")
+else()
+install(
+ TARGETS duckdb_static
+ EXPORT "${DUCKDB_EXPORT_SET}"
+ LIBRARY DESTINATION "${INSTALL_LIB_DIR}"
+ ARCHIVE DESTINATION "${INSTALL_LIB_DIR}"
+ RUNTIME DESTINATION "${INSTALL_BIN_DIR}")
+endif()
diff --git a/tools/odbc/CMakeLists.txt b/tools/odbc/CMakeLists.txt
index 4a8e7e1..8ae9681 100644
--- a/tools/odbc/CMakeLists.txt
+++ b/tools/odbc/CMakeLists.txt
@@ -53,6 +53,13 @@ add_library(
set_target_properties(duckdb_odbc PROPERTIES DEFINE_SYMBOL "DUCKDB_ODBC_API")
target_link_libraries(duckdb_odbc ${LINK_LIB_LIST} duckdb_static)
+install(
+ TARGETS duckdb_odbc
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
+)
if(NOT CLANG_TIDY)
add_subdirectory(test)
diff --git a/tools/sqlite3_api_wrapper/CMakeLists.txt b/tools/sqlite3_api_wrapper/CMakeLists.txt
index 3fa4166..42af485 100644
--- a/tools/sqlite3_api_wrapper/CMakeLists.txt
+++ b/tools/sqlite3_api_wrapper/CMakeLists.txt
@@ -25,20 +25,20 @@ if(NOT AMALGAMATION_BUILD)
endif()
link_threads(sqlite3_api_wrapper_static)
-if(NOT WIN32 AND NOT ZOS)
+if(BUILD_SHARED_LIBS AND NOT WIN32 AND NOT ZOS)
add_library(sqlite3_api_wrapper SHARED ${SQLITE_API_WRAPPER_FILES})
target_link_libraries(sqlite3_api_wrapper duckdb ${DUCKDB_EXTRA_LINK_FLAGS})
link_threads(sqlite3_api_wrapper)
endif()
-include_directories(../../third_party/catch)
+# include_directories(../../third_party/catch)
-include_directories(test/include)
-add_subdirectory(test)
+# include_directories(test/include)
+# add_subdirectory(test)
-add_executable(test_sqlite3_api_wrapper ${SQLITE_TEST_FILES})
-if(WIN32 OR ZOS)
- target_link_libraries(test_sqlite3_api_wrapper sqlite3_api_wrapper_static)
-else()
- target_link_libraries(test_sqlite3_api_wrapper sqlite3_api_wrapper)
-endif()
+#add_executable(test_sqlite3_api_wrapper ${SQLITE_TEST_FILES})
+#if(WIN32 OR ZOS)
+# target_link_libraries(test_sqlite3_api_wrapper sqlite3_api_wrapper_static)
+#else()
+# target_link_libraries(test_sqlite3_api_wrapper sqlite3_api_wrapper)
+#endif()

View File

@@ -1,4 +1,6 @@
versions:
"0.9.2":
folder: "all"
"0.9.0":
folder: "all"
"0.8.1":