Author: rinrab
Date: Fri Aug 30 15:24:43 2024
New Revision: 1920296

URL: http://svn.apache.org/viewvc?rev=1920296&view=rev
Log:
On the 'cmake' branch: fix 'SQLiteAmalgamation or not' problem.

There were an explicit CMake option that tells CMake which SQLite to use,
installed or the amalgamation. It was set to use the amalgamation by default
which is actually uncommon.

To resolve the issue, firstly the default is going to be changed to 'ON'.
Afterwards, if the option has not been changed (is still set to ON), we will
also try to find the amalgamation instead, and write a warning of implicitly
using SQLite amalgamation.

This follows that the user will use the installed library if they didn't
change this option, will use amalgamation if is is specified explicitly,
and also will use the amalgamation if the library wasn't found.

* CMakeLists.txt
  (options): Change default of the SVN_SQLITE_USE_AMALGAMATION option to OFF.
  (sqlite): Try SQLite amalgamation even if SVN_SQLITE_USE_AMALGAMATION tells
   not to use it.

Modified:
    subversion/branches/cmake/CMakeLists.txt

Modified: subversion/branches/cmake/CMakeLists.txt
URL: 
http://svn.apache.org/viewvc/subversion/branches/cmake/CMakeLists.txt?rev=1920296&r1=1920295&r2=1920296&view=diff
==============================================================================
--- subversion/branches/cmake/CMakeLists.txt (original)
+++ subversion/branches/cmake/CMakeLists.txt Fri Aug 30 15:24:43 2024
@@ -100,7 +100,7 @@ option(SVN_USE_DSO "Defined if svn shoul
 # Dependecies
 option(SVN_USE_INTERNAL_LZ4 "Use internal version of lz4" ON)
 option(SVN_USE_INTERNAL_UTF8PROC "Use internal version of utf8proc" ON)
-option(SVN_SQLITE_USE_AMALGAMATION "Use sqlite amalgamation" ON)
+option(SVN_SQLITE_USE_AMALGAMATION "Use sqlite amalgamation" OFF)
 set(SQLiteAmalgamation_ROOT "${CMAKE_SOURCE_DIR}/sqlite-amalgamation" CACHE 
STRING "Directory with sqlite amalgamation")
 
 # Require C++ compiler
@@ -231,8 +231,22 @@ if(SVN_SQLITE_USE_AMALGAMATION)
   find_package(SQLiteAmalgamation REQUIRED)
   add_library(external-sqlite ALIAS SQLite::SQLite3Amalgamation)
 else()
-  find_package(SQLite3 REQUIRED)
-  add_library(external-sqlite ALIAS SQLite::SQLite3)
+  # It should be not required.
+  find_package(SQLite3)
+
+  if(SQLite3_FOUND)
+    add_library(external-sqlite ALIAS SQLite::SQLite3)
+  else()
+    find_package(SQLiteAmalgamation REQUIRED)
+    add_library(external-sqlite ALIAS SQLite::SQLite3Amalgamation)
+
+    # Is implicitness an actual problem? This warning could be removed
+    # if it isn't.
+    message(WARNING
+      "Implicitly using SQLite amalgamation; enable"
+      "SVN_SQLITE_USE_AMALGAMATION option to force it."
+    )
+  endif()
 endif()
 
 ### Serf


Reply via email to