]> rtime.felk.cvut.cz Git - coffee/buildroot.git/blob - package/libcpprestsdk/0004-libcpprestsdk-fix-building-as-a-static-library.patch
libcpprestsdk: fix building as a static library
[coffee/buildroot.git] / package / libcpprestsdk / 0004-libcpprestsdk-fix-building-as-a-static-library.patch
1 From 8a9c3db14a390c0a8788405e52e9b8737a430191 Mon Sep 17 00:00:00 2001
2 From: Adam Duskett <aduskett@gmail.com>
3 Date: Mon, 12 Feb 2018 07:49:34 -0500
4 Subject: [PATCH] libcpprestsdk: fix building as a static library
5
6 Use pkg-config to find OpenSSL. This will automatically find any
7 dependent libraries and put them in the correct order for linking.
8
9 Upstream status: submitted
10 https://github.com/Microsoft/cpprestsdk/pull/688
11
12 Signed-off-by: Adam Duskett <aduskett@gmail.com>
13 ---
14  Release/cmake/cpprest_find_openssl.cmake | 10 +++++++---
15  1 file changed, 7 insertions(+), 3 deletions(-)
16
17 diff --git a/Release/cmake/cpprest_find_openssl.cmake b/Release/cmake/cpprest_find_openssl.cmake
18 index 0b49a7e..2be8afb 100644
19 --- a/Release/cmake/cpprest_find_openssl.cmake
20 +++ b/Release/cmake/cpprest_find_openssl.cmake
21 @@ -41,8 +41,12 @@ function(cpprest_find_openssl)
22        # This should prevent linking against the system provided 0.9.8y
23        set(_OPENSSL_VERSION "")
24      endif()
25 -    find_package(OpenSSL 1.0.0 REQUIRED)
26 -
27 +    if(UNIX)
28 +               find_package(PkgConfig REQUIRED)
29 +               pkg_search_module(OPENSSL openssl REQUIRED)
30 +    else()
31 +       find_package(OpenSSL 1.0.0 REQUIRED)
32 +       endif()
33      INCLUDE(CheckCXXSourceCompiles)
34      set(CMAKE_REQUIRED_INCLUDES "${OPENSSL_INCLUDE_DIR}")
35      set(CMAKE_REQUIRED_LIBRARIES "${OPENSSL_LIBRARIES}")
36 -- 
37 2.14.3
38