svn commit: r1920423 - in /apr/apr-util/branches/1.7.x: ./ CMakeLists.txt include/apu.hwc

[email protected]
Newsgroups gmane.comp.apache.apr.cvs
Message-ID <[email protected]>
Author: ivan
Date: Tue Sep  3 12:15:31 2024
New Revision: 1920423

URL: http://svn.apache.org/viewvc?rev=1920423&view=rev
Log:
Merged r1895526 from apr/trunk:
* Add support for building sqlite3 dbd module ... It compiles and pass tests.

Modified:
    apr/apr-util/branches/1.7.x/   (props changed)
    apr/apr-util/branches/1.7.x/CMakeLists.txt
    apr/apr-util/branches/1.7.x/include/apu.hwc

Propchange: apr/apr-util/branches/1.7.x/
------------------------------------------------------------------------------
  Merged /apr/apr/trunk:r1895526

Modified: apr/apr-util/branches/1.7.x/CMakeLists.txt
URL: http://svn.apache.org/viewvc/apr/apr-util/branches/1.7.x/CMakeLists.txt?rev=1920423&r1=1920422&r2=1920423&view=diff
==============================================================================
--- apr/apr-util/branches/1.7.x/CMakeLists.txt (original)
+++ apr/apr-util/branches/1.7.x/CMakeLists.txt Tue Sep  3 12:15:31 2024
@@ -31,6 +31,7 @@ FIND_PACKAGE(APR REQUIRED)
 FIND_PACKAGE(EXPAT)
 FIND_PACKAGE(LibXml2)
 FIND_PACKAGE(OpenSSL)
+FIND_PACKAGE(SQLite3)
 
 IF(NOT EXPAT_FOUND AND NOT LIBXML2_FOUND)
   MESSAGE(FATAL_ERROR "Either Expat or LibXml2 is required, but neither was found")
@@ -49,6 +50,7 @@ OPTION(APU_BUILD_STATIC     "Build stati
 OPTION(APU_DSO_BUILD        "Use DSO build of modular components"       ON)
 OPTION(APU_HAVE_CRYPTO      "Crypto support"                            OFF)
 OPTION(APU_HAVE_ODBC        "Build ODBC DBD driver"                     ON)
+OPTION(APU_HAVE_SQLITE3     "Build SQLite3 DBD driver"                  OFF)
 OPTION(APR_HAS_LDAP         "LDAP support"                              ON)
 OPTION(INSTALL_PDB          "Install .pdb files (if generated)"         ON)
 OPTION(APR_BUILD_TESTAPR    "Build the test suite"                      OFF)
@@ -83,6 +85,12 @@ IF(NOT OPENSSL_FOUND)
 ENDIF()
 ENDIF()
 
+IF(APU_HAVE_SQLITE3)
+IF(NOT SQLite3_FOUND)
+  MESSAGE(FATAL_ERROR "SQLite3 wasn't found!")
+ENDIF()
+ENDIF()
+
 # create 1-or-0 representation of feature tests for apu.h
 
 SET(apu_have_apr_iconv_10 0) # not yet implemented
@@ -295,6 +303,13 @@ IF(NOT APU_DSO_BUILD AND APU_HAVE_ODBC)
   LIST(APPEND APU_EXTRA_LIBRARIES odbc32 odbccp32)
 ENDIF()
 
+IF(NOT APU_DSO_BUILD AND APU_HAVE_SQLITE3)
+  LIST(APPEND dbd_drivers sqlite3)
+
+  LIST(APPEND APU_EXTRA_SOURCES dbd/apr_dbd_sqlite3.c)
+  LIST(APPEND APU_EXTRA_LIBRARIES ${SQLite3_LIBRARIES})
+ENDIF()
+
 # libaprutil-1 is shared, aprutil-1 is static
 IF(APU_BUILD_SHARED)
   ADD_LIBRARY(libaprutil-1 SHARED ${APR_SOURCES} ${APU_EXTRA_SOURCES} ${APR_PUBLIC_HEADERS_GENERATED} libaprutil.rc)
@@ -362,6 +377,20 @@ ELSE()
   SET(apr_ldap_libraries)
 ENDIF()
 
+IF(APU_DSO_BUILD AND APU_HAVE_SQLITE3)
+  ADD_LIBRARY(apr_dbd_sqlite3-1 SHARED dbd/apr_dbd_sqlite3.c libaprutil.rc)
+  SET(install_targets ${install_targets} apr_dbd_sqlite3-1)
+  SET(install_bin_pdb ${install_bin_pdb} ${PROJECT_BINARY_DIR}/apr_dbd_sqlite3-1.pdb)
+  SET(dbd_drivers ${dbd_drivers} sqlite3)
+  TARGET_INCLUDE_DIRECTORIES(apr_dbd_sqlite3-1
+                             PRIVATE "${SQLite3_INCLUDE_DIRS}")
+  TARGET_LINK_LIBRARIES(apr_dbd_sqlite3-1
+                        PRIVATE libaprutil-1 apr::libapr-1 ${SQLite3_LIBRARIES})
+  SET_PROPERTY(TARGET apr_dbd_sqlite3-1 APPEND PROPERTY LINK_FLAGS /export:apr_dbd_sqlite3_driver)
+  TARGET_COMPILE_DEFINITIONS(apr_dbd_sqlite3-1
+                             PRIVATE "DLL_NAME=apr_dbd_sqlite3-1")
+ENDIF()
+
 IF(APR_BUILD_TESTAPR)
   ENABLE_TESTING()
   # Create a "check" target that displays test program output to the console.
@@ -439,6 +468,7 @@ MESSAGE(STATUS "  Install .pdb (if avail
 MESSAGE(STATUS "  Install prefix .................. : ${CMAKE_INSTALL_PREFIX}")
 MESSAGE(STATUS "  C compiler ...................... : ${CMAKE_C_COMPILER}")
 MESSAGE(STATUS "  DBD ODBC driver ................. : ${APU_HAVE_ODBC}")
+MESSAGE(STATUS "  DBD SQLite3 driver .............. : ${APU_HAVE_SQLITE3}")
 MESSAGE(STATUS "  APU_HAVE_CRYPTO ................. : ${APU_HAVE_CRYPTO}")
 MESSAGE(STATUS "  APR_HAS_LDAP .................... : ${APR_HAS_LDAP}")
 MESSAGE(STATUS "  Use Expat ....................... : ${APU_USE_EXPAT}")

Modified: apr/apr-util/branches/1.7.x/include/apu.hwc
URL: http://svn.apache.org/viewvc/apr/apr-util/branches/1.7.x/include/apu.hwc?rev=1920423&r1=1920422&r2=1920423&view=diff
==============================================================================
--- apr/apr-util/branches/1.7.x/include/apu.hwc (original)
+++ apr/apr-util/branches/1.7.x/include/apu.hwc Tue Sep  3 12:15:31 2024
@@ -124,12 +124,12 @@
 #ifndef APU_DSO_MODULE_BUILD
 #define APU_HAVE_PGSQL          0
 #define APU_HAVE_MYSQL          0
-#define APU_HAVE_SQLITE3        0
 #define APU_HAVE_SQLITE2        0
 #define APU_HAVE_ORACLE         0
 #endif
 
 #cmakedefine01 APU_HAVE_ODBC
+#cmakedefine01 APU_HAVE_SQLITE3
 #cmakedefine01 APU_HAVE_CRYPTO
 
 #ifndef APU_DSO_MODULE_BUILD
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.