Skip to content

Commit

Permalink
[tiff] Fix -lm on android (#22137)
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Jan 15, 2022
1 parent 371be89 commit bba8794
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 7 deletions.
30 changes: 25 additions & 5 deletions ports/tiff/fix-pkgconfig.patch
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
From f337e19d0d0564b1b000ecd5dfbefed6c37f4d5b Mon Sep 17 00:00:00 2001
From: Matthias Kuhn <matthias@opengis.ch>
Date: Tue, 21 Dec 2021 07:57:09 +0000
Subject: [PATCH] Fix pkgconfig

---
CMakeLists.txt | 4 ++--
libtiff-4.pc.in | 3 ++-
libtiff/CMakeLists.txt | 19 +++++++++++++++++++
3 files changed, 23 insertions(+), 3 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2188f97..93e6a34 100644
--- a/CMakeLists.txt
Expand Down Expand Up @@ -35,7 +46,7 @@ index abe75a6..8899725 100644
Cflags: -I${includedir}
+Requires.private: @tiff_requires_private@
diff --git a/libtiff/CMakeLists.txt b/libtiff/CMakeLists.txt
index db5f140..6db71ee 100755
index db5f140..32721ec 100755
--- a/libtiff/CMakeLists.txt
+++ b/libtiff/CMakeLists.txt
@@ -106,14 +106,19 @@ target_include_directories(tiff
Expand All @@ -58,7 +69,7 @@ index db5f140..6db71ee 100755
if(JPEG_DUAL_MODE_8_12)
target_include_directories(tiff PRIVATE ${JPEG12_INCLUDE_DIR})
target_link_libraries(tiff PRIVATE ${JPEG12_LIBRARIES})
@@ -127,14 +132,23 @@ if(LERC_SUPPORT)
@@ -127,15 +132,29 @@ if(LERC_SUPPORT)
endif()
if(LZMA_SUPPORT)
target_link_libraries(tiff PRIVATE LibLZMA::LibLZMA)
Expand All @@ -73,12 +84,21 @@ index db5f140..6db71ee 100755
+ string(APPEND tiff_requires_private " libwebp")
endif()
target_link_libraries(tiff PRIVATE CMath::CMath)
+if(CMath_LIBRARY)
+ string(APPEND tiff_libs_private " -lm")

+include(CheckLibraryExists)
+
+CHECK_LIBRARY_EXISTS(m sin "" HAVE_LIB_M)
+
+if (HAVE_LIB_M)
+ string(APPEND tiff_libs_private " -lm")
+endif()
+
+set(tiff_libs_private "${tiff_libs_private}" PARENT_SCOPE)
+set(tiff_requires_private "${tiff_requires_private}" PARENT_SCOPE)
+
set_target_properties(tiff PROPERTIES SOVERSION ${SO_COMPATVERSION})
if(NOT CYGWIN)
# This property causes shared libraries on Linux to have the full version
--
2.25.1

2 changes: 1 addition & 1 deletion ports/tiff/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "tiff",
"version": "4.3.0",
"port-version": 3,
"port-version": 4,
"description": "A library that supports the manipulation of TIFF image files",
"homepage": "https://libtiff.gitlab.io/libtiff/",
"dependencies": [
Expand Down
2 changes: 1 addition & 1 deletion versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -6802,7 +6802,7 @@
},
"tiff": {
"baseline": "4.3.0",
"port-version": 3
"port-version": 4
},
"tinkerforge": {
"baseline": "2.1.25",
Expand Down
5 changes: 5 additions & 0 deletions versions/t-/tiff.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "b416d3e62450590e19a43f04b573c65555f3bc62",
"version": "4.3.0",
"port-version": 4
},
{
"git-tree": "d96194297723032655164b0fcb88027e38e06003",
"version": "4.3.0",
Expand Down

0 comments on commit bba8794

Please sign in to comment.