From 65ddd0553b21289db60eb1e11d27ce6fa90eac15 Mon Sep 17 00:00:00 2001 From: Timothy Flynn Date: Tue, 4 Jun 2024 16:28:35 -0400 Subject: [PATCH] Meta+LibWebView: Install and link sqlite3 with vcpkg We will use sqlite3 as a replacement for LibSQL. Using a tried-and-true database will allow us to avoid maintaining our an incomplete, non-ACID, and less performant implementation. It also means we do not have to launch and manage the singleton SQLServer process. --- CMakeLists.txt | 3 +++ Userland/Libraries/LibWebView/CMakeLists.txt | 4 ++++ vcpkg-configuration.json | 14 ++++++++++++++ vcpkg.json | 11 +++++++++++ 4 files changed, 32 insertions(+) create mode 100644 vcpkg-configuration.json create mode 100644 vcpkg.json diff --git a/CMakeLists.txt b/CMakeLists.txt index 25cac077b23..6a1016b8b8e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,8 @@ cmake_minimum_required(VERSION 3.25) +SET(CMAKE_TOOLCHAIN_FILE "$ENV{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake") +set(VCPKG_INSTALL_OPTIONS --no-print-usage) + project(ladybird VERSION 0.1.0 LANGUAGES C CXX diff --git a/Userland/Libraries/LibWebView/CMakeLists.txt b/Userland/Libraries/LibWebView/CMakeLists.txt index 497715439b0..402018492f8 100644 --- a/Userland/Libraries/LibWebView/CMakeLists.txt +++ b/Userland/Libraries/LibWebView/CMakeLists.txt @@ -49,6 +49,10 @@ serenity_lib(LibWebView webview) target_link_libraries(LibWebView PRIVATE LibCore LibFileSystem LibGfx LibIPC LibProtocol LibJS LibWeb LibSQL LibUnicode LibURL) target_compile_definitions(LibWebView PRIVATE ENABLE_PUBLIC_SUFFIX=$) +find_package(SQLite3 REQUIRED) +target_include_directories(LibWebView PRIVATE ${SQLite3_INCLUDE_DIRS}) +target_link_libraries(LibWebView PRIVATE ${SQLite3_LIBRARIES}) + foreach(header ${GENERATED_SOURCES}) get_filename_component(extension ${header} EXT) if (NOT "${extension}" STREQUAL ".h") diff --git a/vcpkg-configuration.json b/vcpkg-configuration.json new file mode 100644 index 00000000000..4bca4e6cb57 --- /dev/null +++ b/vcpkg-configuration.json @@ -0,0 +1,14 @@ +{ + "default-registry": { + "kind": "git", + "baseline": "01f602195983451bc83e72f4214af2cbc495aa94", + "repository": "https://github.com/microsoft/vcpkg" + }, + "registries": [ + { + "kind": "artifact", + "location": "https://github.com/microsoft/vcpkg-ce-catalog/archive/refs/heads/main.zip", + "name": "microsoft" + } + ] +} diff --git a/vcpkg.json b/vcpkg.json new file mode 100644 index 00000000000..a91bca6ca84 --- /dev/null +++ b/vcpkg.json @@ -0,0 +1,11 @@ +{ + "dependencies": [ + "sqlite3" + ], + "overrides": [ + { + "name": "sqlite3", + "version": "3.45.3" + } + ] +}