Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Adam Duskett <aduskett@gmail.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 1/1] libcpprestsdk: fix building as a static library
Date: Tue,  6 Feb 2018 11:59:50 -0500	[thread overview]
Message-ID: <20180206165950.10154-1-aduskett@gmail.com> (raw)

zlib must be put after OpenSSL when building as a static library or else
OpenSSL will be unable to find zlib specific functions.

Put the search for zlib below the search for OpenSSL to
ensure that zlib links after OpenSSL.

Fixes:
http://autobuild.buildroot.net/results/1df528254468a5ece2f6fe37b3401e68737beed1
Signed-off-by: Adam Duskett <aduskett@gmail.com>
---
 .../0004-fix-static-library-linking.patch          | 56 ++++++++++++++++++++++
 1 file changed, 56 insertions(+)
 create mode 100644 package/libcpprestsdk/0004-fix-static-library-linking.patch

diff --git a/package/libcpprestsdk/0004-fix-static-library-linking.patch b/package/libcpprestsdk/0004-fix-static-library-linking.patch
new file mode 100644
index 0000000000..e904bb96c1
--- /dev/null
+++ b/package/libcpprestsdk/0004-fix-static-library-linking.patch
@@ -0,0 +1,56 @@
+From cefe8da037e0c2bb97dc1cb4d7ff43e7123feabf Mon Sep 17 00:00:00 2001
+From: Adam Duskett <aduskett@gmail.com>
+Date: Tue, 6 Feb 2018 11:34:49 -0500
+Subject: [PATCH] fix static library linking
+
+zlib must be put after OpenSSL when building as a static library or else
+OpenSSL will be unable to find zlib specific functions.
+
+Put the search for zlib below the search for OpenSSL to
+ensure that zlib links after OpenSSL.
+
+Upstream status: submitted
+https://github.com/Microsoft/cpprestsdk/pull/688
+
+Signed-off-by: Adam Duskett <aduskett@gmail.com>
+---
+ Release/src/CMakeLists.txt | 16 ++++++++--------
+ 1 file changed, 8 insertions(+), 8 deletions(-)
+
+diff --git a/Release/src/CMakeLists.txt b/Release/src/CMakeLists.txt
+index 3f8a0f8..2a6d440 100644
+--- a/Release/src/CMakeLists.txt
++++ b/Release/src/CMakeLists.txt
+@@ -75,14 +75,6 @@ else()
+   message(FATAL_ERROR "Invalid implementation")
+ endif()
+ 
+-# Compression component
+-if(CPPREST_EXCLUDE_COMPRESSION)
+-  target_compile_definitions(cpprest PRIVATE -DCPPREST_EXCLUDE_COMPRESSION=1)
+-else()
+-  cpprest_find_zlib()
+-  target_link_libraries(cpprest PRIVATE cpprestsdk_zlib_internal)
+-endif()
+-
+ # PPLX component
+ if(CPPREST_PPLX_IMPL STREQUAL "apple")
+   find_library(COREFOUNDATION CoreFoundation "/")
+@@ -133,6 +125,14 @@ else()
+   message(FATAL_ERROR "Invalid implementation")
+ endif()
+ 
++# Compression component
++if(CPPREST_EXCLUDE_COMPRESSION)
++  target_compile_definitions(cpprest PRIVATE -DCPPREST_EXCLUDE_COMPRESSION=1)
++else()
++  cpprest_find_zlib()
++  target_link_libraries(cpprest PRIVATE cpprestsdk_zlib_internal)
++endif()
++
+ # fileio streams component
+ if(CPPREST_FILEIO_IMPL STREQUAL "win32")
+   target_sources(cpprest PRIVATE streams/fileio_win32.cpp)
+-- 
+2.14.3
+
-- 
2.14.3

             reply	other threads:[~2018-02-06 16:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-06 16:59 Adam Duskett [this message]
2018-02-08 21:24 ` [Buildroot] [PATCH 1/1] libcpprestsdk: fix building as a static library Thomas Petazzoni

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180206165950.10154-1-aduskett@gmail.com \
    --to=aduskett@gmail.com \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox