Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Try alternative patch for cmake s2geography openssl #91

Merged
merged 1 commit into from
Dec 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 18 additions & 13 deletions ci/s2geography-add-openssl-as-requirement.patch
Original file line number Diff line number Diff line change
@@ -1,30 +1,35 @@
From ccac9b1ea8ef85678473f6f6825e482ca4c19ebc Mon Sep 17 00:00:00 2001
From 7287508b986e65403b3352889c94249ee11a231a Mon Sep 17 00:00:00 2001
From: Benoit Bovy <[email protected]>
Date: Mon, 2 Dec 2024 15:52:58 +0100
Subject: [PATCH] fix openssl header not found in specific cases
Date: Wed, 11 Dec 2024 09:09:47 +0100
Subject: [PATCH] another approach for openssl

E.g., on MacOS with s2geometry built from source and installed in a
custom directory and linked against openssl installed in an other,
standard directory.
---
CMakeLists.txt | 5 +++++
1 file changed, 5 insertions(+)
CMakeLists.txt | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5fb3e93..6d040ad 100644
index 5fb3e93..0028c86 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -173,6 +173,11 @@ elseif(${S2_SOURCE} STREQUAL "SYSTEM")
@@ -173,6 +173,9 @@ elseif(${S2_SOURCE} STREQUAL "SYSTEM")
endif()
endif()

+# this might be needed since s2geometry includes it in general
+# but not for any target explicilty?
+# --- OpenSSL
+find_package(OpenSSL REQUIRED)
+target_include_directories(${s2_NOALIAS_TARGET} INTERFACE ${OPENSSL_INCLUDE_DIR})
+
# --- Abseil (bundled build not supported)

find_package(absl REQUIRED)
@@ -271,7 +274,8 @@ if(MSVC)
target_compile_options(s2geography PUBLIC /J)
endif()

-target_link_libraries(s2geography PUBLIC s2::s2 absl::memory absl::str_format)
+target_link_libraries(s2geography PUBLIC s2::s2 absl::memory absl::str_format
+ OpenSSL::SSL OpenSSL::Crypto)

# Set somewhat aggressive compiler warning flags
if(S2GEOGRAPHY_EXTRA_WARNINGS)
--
2.36.0
Loading