lordgamez commented on code in PR #2214: URL: https://github.com/apache/nifi-minifi-cpp/pull/2214#discussion_r3639373608
########## thirdparty/azure-sdk-cpp/all/conanfile.py: ########## @@ -0,0 +1,196 @@ +# 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. + +# Recipe based on https://github.com/conan-io/conan-center-index/blob/master/recipes/azure-sdk-for-cpp/all/conanfile.py + +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMakeToolchain, CMake, CMakeDeps, cmake_layout +from conan.tools.files import get, copy, rmdir, replace_in_file +from conan.tools.scm import Version +import glob +import os + +required_conan_version = ">=2.1" + +class AzureSDKForCppConan(ConanFile): + name = "azure-sdk-for-cpp" + description = "Microsoft Azure Storage Client Library for C++" + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/Azure/azure-sdk-for-cpp" + topics = ("azure", "cpp", "cross-platform", "microsoft", "cloud") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + + options = { + "shared": [True, False], + "fPIC": [True, False], + "transport_winhttp": [True, False], + "transport_curl": [True, False] + } + + default_options = {"shared": False, "fPIC": True} + + default_options = { + "shared": False, + "fPIC": True, + "transport_winhttp": False, + "transport_curl": True + } + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + for cmake_file in glob.glob(os.path.join(self.source_folder, "sdk", "identity", "azure-identity", "**", "CMakeLists.txt"), recursive=True): + replace_in_file(self, cmake_file, + "set(CMAKE_CXX_STANDARD 14)", + "set(CMAKE_CXX_STANDARD 17)", + strict=False) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + else: + del self.options.transport_winhttp + + def configure(self): + if self.options.get_safe("shared"): + self.options.rm_safe("fPIC") + + def requirements(self): + self.requires("openssl/3.6.2") + self.requires("libxml2/2.15.3") + + if self.settings.os == "Windows": + # wil is always required on windows since azure-identity can't be disabled via cmake. + # azure-identity and wil are not necessary for storage if skip_test=True, but MS + # doesn't currently support that build option... + self.requires("wil/1.0.260126.7") + + if self.options.transport_curl: + self.requires("libcurl/8.20.0") + + def layout(self): + cmake_layout(self, src_folder="src") + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 14) + + if self.settings.os == "Windows": + if not self.options.transport_curl and not self.options.get_safe("transport_winhttp"): + raise ConanInvalidConfiguration("On Windows, HTTP Transport options: transport_winhttp or transport_curl must be enabled.") + elif not self.options.transport_curl: + raise ConanInvalidConfiguration("The HTTP Transport option transport_curl must be enabled.") Review Comment: Fixed in https://github.com/apache/nifi-minifi-cpp/pull/2214/commits/538e0622c37b90f9b9c7c9d2bf876b612cf43c85 ########## cmake/MiNiFiOptions.cmake: ########## @@ -174,6 +174,18 @@ add_minifi_multi_option(MINIFI_ASIO_SOURCE "Retrieves Asio from provided source" add_minifi_multi_option(MINIFI_KAFKA_SOURCE "Retrieves librdkafka from provided source" "BUILD;CONAN" "BUILD") add_minifi_multi_option(MINIFI_MAGIC_ENUM_SOURCE "Retrieves magic_enum from provided source" "BUILD;CONAN" "BUILD") add_minifi_multi_option(MINIFI_OPC_SOURCE "Retrieves open62541 from provided source" "BUILD;CONAN" "BUILD") +add_minifi_multi_option(MINIFI_OSSP_UUID_SOURCE "Retrieves ossp-uuid from provided source" "BUILD;CONAN" "BUILD") Review Comment: Good idea, added in https://github.com/apache/nifi-minifi-cpp/pull/2214/commits/538e0622c37b90f9b9c7c9d2bf876b612cf43c85 with an additional change in the main conanfile.py, this makes it unable to miss adding the MINIFI_* value change to CONAN when adding a new library. ########## thirdparty/azure-sdk-cpp/all/conanfile.py: ########## @@ -0,0 +1,196 @@ +# 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. + +# Recipe based on https://github.com/conan-io/conan-center-index/blob/master/recipes/azure-sdk-for-cpp/all/conanfile.py + +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMakeToolchain, CMake, CMakeDeps, cmake_layout +from conan.tools.files import get, copy, rmdir, replace_in_file +from conan.tools.scm import Version +import glob +import os + +required_conan_version = ">=2.1" + +class AzureSDKForCppConan(ConanFile): + name = "azure-sdk-for-cpp" + description = "Microsoft Azure Storage Client Library for C++" + license = "Apache-2.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/Azure/azure-sdk-for-cpp" + topics = ("azure", "cpp", "cross-platform", "microsoft", "cloud") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + + options = { + "shared": [True, False], + "fPIC": [True, False], + "transport_winhttp": [True, False], + "transport_curl": [True, False] + } + + default_options = {"shared": False, "fPIC": True} + Review Comment: Fixed in https://github.com/apache/nifi-minifi-cpp/pull/2214/commits/538e0622c37b90f9b9c7c9d2bf876b612cf43c85 -- 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]
