Skip to content

Commit 0b0d140

Browse files
authored
Merge pull request #987 from compnerd/vendor
build: add support to vendor SQLite3
2 parents 72b0343 + f542c10 commit 0b0d140

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

CMakeLists.txt

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,20 @@ endif()
5050
set(THREADS_PREFER_PTHREAD_FLAG FALSE)
5151
find_package(Threads REQUIRED)
5252

53-
find_package(SQLite3 REQUIRED)
53+
find_package(SQLite3 QUIET)
54+
if(NOT SQLite3_FOUND)
55+
include(FetchContent)
56+
57+
message("-- Vendoring SQLite3")
58+
FetchContent_Declare(SQLite
59+
GIT_REPOSITORY https://github.com/swiftlang/swift-toolchain-sqlite
60+
GIT_TAG main)
61+
62+
FetchContent_MakeAvailable(SQLite)
63+
64+
add_library(SQLite::SQLite3 ALIAS SQLite3)
65+
set_property(GLOBAL APPEND PROPERTY LLBuild_EXPORTS SQLite3)
66+
endif()
5467

5568
# Include custom modules.
5669
include(Utility)

0 commit comments

Comments
 (0)