From 002a93a33cc46ce46cd77fce69ab4a78c1857974 Mon Sep 17 00:00:00 2001 From: devgianlu Date: Fri, 20 Dec 2024 09:06:14 +0100 Subject: [PATCH] LibCrypto: Link with OpenSSL Add OpenSSL with vcpkg and link with LibCrypto using CMake. Also added a placeholder GN setup. --- Libraries/LibCrypto/CMakeLists.txt | 3 +++ Meta/gn/build/libs/openssl/BUILD.gn | 5 +++++ Meta/gn/secondary/Userland/Libraries/LibCrypto/BUILD.gn | 1 + vcpkg.json | 1 + 4 files changed, 10 insertions(+) create mode 100644 Meta/gn/build/libs/openssl/BUILD.gn diff --git a/Libraries/LibCrypto/CMakeLists.txt b/Libraries/LibCrypto/CMakeLists.txt index ef9909971a3..bbda3f54886 100644 --- a/Libraries/LibCrypto/CMakeLists.txt +++ b/Libraries/LibCrypto/CMakeLists.txt @@ -39,3 +39,6 @@ set(SOURCES serenity_lib(LibCrypto crypto) target_link_libraries(LibCrypto PRIVATE LibCore) + +find_package(OpenSSL REQUIRED) +target_link_libraries(LibCrypto PUBLIC OpenSSL::Crypto) diff --git a/Meta/gn/build/libs/openssl/BUILD.gn b/Meta/gn/build/libs/openssl/BUILD.gn new file mode 100644 index 00000000000..28362044828 --- /dev/null +++ b/Meta/gn/build/libs/openssl/BUILD.gn @@ -0,0 +1,5 @@ +import("//Meta/gn/build/libs/third_party.gni") + +third_party_dependency("openssl") { + libs = [ "openssl" ] +} diff --git a/Meta/gn/secondary/Userland/Libraries/LibCrypto/BUILD.gn b/Meta/gn/secondary/Userland/Libraries/LibCrypto/BUILD.gn index 259d3f66446..85a8fdcebea 100644 --- a/Meta/gn/secondary/Userland/Libraries/LibCrypto/BUILD.gn +++ b/Meta/gn/secondary/Userland/Libraries/LibCrypto/BUILD.gn @@ -4,6 +4,7 @@ shared_library("LibCrypto") { cflags_cc = [ "-Wvla" ] deps = [ "//AK", + "//Meta/gn/build/libs/openssl", "//Userland/Libraries/LibCore", ] sources = [ diff --git a/vcpkg.json b/vcpkg.json index 4b9361c96ea..e41da159de8 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -80,6 +80,7 @@ "name": "mman", "platform": "windows" }, + "openssl", { "name": "pthread", "platform": "windows"