Description
Describe the bug
Hi,
while working on packaging the 1.11 version for Conan (conan-io/conan-center-index#22905) I noticed that compilation cannot find any OpenSSL headers. The Conan package manager fiddles with some CMake default lookup rules which might reveal the error.
This is for version 1.11.273: In your CMakeLists.txt
in line 208 you include external_dependencies
Line 208 in 5929e20
which does the OpenSSL crypto lib lookup and as part of that sets CRYPTO_LIBS
to the imported target AWS::crypto
:
aws-sdk-cpp/cmake/external_dependencies.cmake
Lines 40 to 54 in 5929e20
This is good because linking the CMake aws-cpp-sdk-all
against the imported target later will apply both, the link libraries and the include dirs.
But in your CMakeLists.txt
lines 250 you overwrite CRYPTO_LIBS
with ${OPENSSL_LIBRARIES}
.
Lines 260 to 266 in 5929e20
The problem is that OPENSSL_LIBRARIES
is empty and I also could not find any invocation of find_package(OpenSSL)
which could have set it.
The same problem applies to CLIENT_LIBS
.
Could you please take a look what's going on and which of the code blocks is the correct and desired one?
Expected Behavior
OpenSSL is properly used.
Current Behavior
[ 18%] Building CXX object src/aws-cpp-sdk-core/CMakeFiles/aws-cpp-sdk-core.dir/source/http/curl/CurlHttpClient.cpp.o
In file included from /Users/jenkins/w/prod-v2/bsr@2/98097/eacca/p/b/aws-s92c917073c641/b/build/Release/src/aws-cpp-sdk-core/ub_core.cpp:50:
In file included from /Users/jenkins/w/prod-v2/bsr@2/98097/eacca/p/b/aws-s92c917073c641/b/src/src/aws-cpp-sdk-core/source/utils/crypto/openssl/CryptoImpl.cpp:9:
/Users/jenkins/w/prod-v2/bsr@2/98097/eacca/p/b/aws-s92c917073c641/b/src/src/aws-cpp-sdk-core/include/aws/core/utils/crypto/openssl/CryptoImpl.h:12:10: fatal error: 'openssl/ossl_typ.h' file not found
#include <openssl/ossl_typ.h>
^~~~~~~~~~~~~~~~~~~~
Reproduction Steps
git clone https://github.com/gjasny/conan-center-index.git
git checkout aws-sdk-cpp/1.11.179
git reset --hard 026b203b4f46d6b637899e2b020cd41e914f9667
# install Conan 2
recipes/aws-sdk-cpp/conan create all/conanfile.py --version 1.11.179 --user local --channel local -pr:b=default -pr:h=default --build=missing
Possible Solution
I commented out the block which overwrites the discovered variables:
https://github.com/gjasny/conan-center-index/blob/6d49f275630c48a8f757b2ec0f58fe0ebb607b69/recipes/aws-sdk-cpp/all/patches/1.11.179-0002-fix-openssl-and-curl-lookup.patch#L1-L22
Additional Information/Context
No response
AWS CPP SDK version used
1.11.273
Compiler and Version used
Xcode 15
Operating System and version
macOS 14.3