szaszm commented on code in PR #2168: URL: https://github.com/apache/nifi-minifi-cpp/pull/2168#discussion_r3227171046
########## cmake/ssl/FindCrypto.cmake: ########## @@ -0,0 +1,56 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +if(TARGET crypto OR TARGET AWS::crypto) + set(CRYPTO_FOUND TRUE) + set(crypto_FOUND TRUE) + return() +endif() + +if(NOT OPENSSL_ROOT_DIR) + message(FATAL_ERROR "Strict bundled crypto requires OPENSSL_ROOT_DIR to be passed to this CMake scope!") +endif() + +find_library(crypto_STATIC_LIBRARY + NAMES libcrypto.a crypto.lib + PATHS "${OPENSSL_ROOT_DIR}/lib" "${OPENSSL_ROOT_DIR}/lib64" + NO_DEFAULT_PATH # Strictly prevent system fallback +) + +set(crypto_INCLUDE_DIR "${OPENSSL_ROOT_DIR}/include") +set(crypto_LIBRARY "${crypto_STATIC_LIBRARY}") + +if(NOT crypto_LIBRARY OR NOT EXISTS "${crypto_INCLUDE_DIR}") + message(FATAL_ERROR "Failed to locate bundled crypto (libcrypto) inside ${OPENSSL_ROOT_DIR}") +endif() + +set(CRYPTO_FOUND TRUE) +set(crypto_FOUND TRUE) +set(crypto_SHARED_LIBRARY "") +set(crypto_STATIC_LIBRARY "${crypto_LIBRARY}") + +add_library(AWS::crypto UNKNOWN IMPORTED) Review Comment: Do we need an AWS::crypto target when the AWS SDK was patched to use OpenSSL::Crypto? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
