Skip to content

Commit

Permalink
Merge pull request conan-io#51 from kam/merge-from-conan-io
Browse files Browse the repository at this point in the history
Resolve CMake merge conflicts from conan-io, add saharay as assignee and reviewer
  • Loading branch information
datalogics-saharay authored and GitHub Enterprise committed May 1, 2023
2 parents 38cbc12 + 4678f47 commit fdb770b
Show file tree
Hide file tree
Showing 53 changed files with 1,185 additions and 220 deletions.
4 changes: 2 additions & 2 deletions dlproject.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -866,8 +866,8 @@ merge_upstream:
# Overrides the defaults in the MergeUpstreamConfig class in tasks/merge_upstream.py
# Note the use of nested dataclasses; use nested dictionaries here.
pull_request:
reviewers: [ kam ]
assignee: kam
reviewers: [ kam, saharay ]
assignee: saharay
# Defaults:
# cci:
# url: [email protected]:conan-io/conan-center-index.git
Expand Down
5 changes: 5 additions & 0 deletions recipes/amqp-cpp/all/conandata.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
sources:
"4.3.24":
url: "https://github.com/CopernicaMarketingSoftware/AMQP-CPP/archive/v4.3.24.tar.gz"
sha256: "c3312f8af813cacabf6c257dfaf41bf9e66606bbf7d62d085a9b7da695355245"
"4.3.18":
url: "https://github.com/CopernicaMarketingSoftware/AMQP-CPP/archive/v4.3.18.tar.gz"
sha256: "cc2c1fc5da00a1778c2804306e06bdedc782a5f74762b9d9b442d3a498dd0c4f"
Expand All @@ -24,6 +27,8 @@ sources:
url: "https://github.com/CopernicaMarketingSoftware/AMQP-CPP/archive/v4.1.5.tar.gz"
sha256: "9840c7fb17bb0c0b601d269e528b7f9cac5ec008dcf8d66bef22434423b468aa"
patches:
"4.3.24":
- patch_file: "patches/4.3.24-0001-cmake-openssl-install-directories.patch"
"4.3.18":
- patch_file: "patches/0001-cmake-openssl-install-directories.patch"
"4.3.16":
Expand Down
35 changes: 35 additions & 0 deletions recipes/amqp-cpp/all/conanfile.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
from conan import ConanFile
from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout
from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir, save
from conan.tools.scm import Version
from conan.tools.build import check_min_cppstd
from conan.errors import ConanInvalidConfiguration
import os
import textwrap

Expand Down Expand Up @@ -46,6 +49,38 @@ def requirements(self):
if self.options.get_safe("linux_tcp_module"):
self.requires("openssl/[>=1.1 <4]")

@property
def _min_cppstd(self):
return "11" if Version(self.version) < "4.3.20" else "17"

@property
def _compilers_minimum_version(self):
return {
"17": {
"gcc": "7.4",
"Visual Studio": "15.7",
"msvc": "191",
"clang": "6",
"apple-clang": "10",
},
}.get(self._min_cppstd, {})

def validate(self):
if self.settings.compiler.get_safe("cppstd"):
check_min_cppstd(self, self._min_cppstd)

def loose_lt_semver(v1, v2):
lv1 = [int(v) for v in v1.split(".")]
lv2 = [int(v) for v in v2.split(".")]
min_length = min(len(lv1), len(lv2))
return lv1[:min_length] < lv2[:min_length]

minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False)
if minimum_version and loose_lt_semver(str(self.settings.compiler.version), minimum_version):
raise ConanInvalidConfiguration(
f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support."
)

def source(self):
get(self, **self.conan_data["sources"][self.version], strip_root=True)

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 69deeaf..4623ab2 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -91,7 +91,10 @@ else()
#add_library(${PROJECT_NAME} STATIC ${SRCS})
add_library(${PROJECT_NAME} STATIC ${src_MAIN} ${src_LINUX_TCP})
endif()
-
+if(AMQP-CPP_LINUX_TCP)
+find_package(OpenSSL REQUIRED)
+target_link_libraries(${PROJECT_NAME} OpenSSL::SSL OpenSSL::Crypto)
+endif()
# install rules
# ------------------------------------------------------------------------------------------------------

@@ -100,7 +103,7 @@ if(AMQP-CPP_BUILD_SHARED)
install(TARGETS ${PROJECT_NAME} EXPORT ${PROJECT_NAME}Config
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
- RUNTIME DESTINATION lib
+ RUNTIME DESTINATION bin
)
else()
# copy static lib
4 changes: 4 additions & 0 deletions recipes/amqp-cpp/all/test_package/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,8 @@ find_package(amqpcpp REQUIRED CONFIG)

add_executable(${PROJECT_NAME} test_package.cpp)
target_link_libraries(${PROJECT_NAME} PRIVATE amqpcpp)
if(amqpcpp_VERSION VERSION_LESS "4.3.20")
target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11)
else()
target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17)
endif()
2 changes: 2 additions & 0 deletions recipes/amqp-cpp/config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
versions:
"4.3.24":
folder: all
"4.3.18":
folder: all
"4.3.16":
Expand Down
34 changes: 9 additions & 25 deletions recipes/arduinojson/all/conanfile.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
from conan import ConanFile
from conan.tools.build import check_min_cppstd
from conan.tools.files import copy, get, save
from conan.tools.layout import basic_layout
from conan.tools.scm import Version
from conan.tools.build import check_min_cppstd
from conan.errors import ConanInvalidConfiguration
import os
import textwrap

Expand All @@ -22,35 +21,22 @@ class ArduinojsonConan(ConanFile):
no_copy_source = True

@property
def _compilers_minimum_version(self):
return {
"Visual Studio": "16",
"msvc": "192",
"gcc": "6",
"clang": "6",
}
def _min_cppstd(self):
return "98" if Version(self.version) < "6.21.0" else "11"

def validate(self):
if Version(self.version) >= "6.21.0":
if self.settings.compiler.get_safe("cppstd"):
check_min_cppstd(self, 11)
elif str(self.settings.compiler) == 'apple-clang':
raise ConanInvalidConfiguration("cppstd needs to be set on apple-clang to activate c++11.")
else:
minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False)
if minimum_version and Version(self.settings.compiler.version) < minimum_version:
raise ConanInvalidConfiguration(f"{self.ref} requires C++11, which your compiler does not support.")
def layout(self):
basic_layout(self, src_folder="src")

def package_id(self):
self.info.clear()

def layout(self):
basic_layout(self, src_folder="src")
def validate(self):
if self.settings.compiler.get_safe("cppstd"):
check_min_cppstd(self, self._min_cppstd)

def source(self):
has_arduinojson_root=Version(self.version) < "6.18.2"
get(self, **self.conan_data["sources"][self.version],
destination=self.source_folder, strip_root=has_arduinojson_root)
get(self, **self.conan_data["sources"][self.version], strip_root=has_arduinojson_root)

def build(self):
pass
Expand Down Expand Up @@ -85,9 +71,7 @@ def package_info(self):
self.cpp_info.set_property("cmake_file_name", "ArduinoJson")
self.cpp_info.set_property("cmake_target_name", "ArduinoJson")
self.cpp_info.bindirs = []
self.cpp_info.frameworkdirs = []
self.cpp_info.libdirs = []
self.cpp_info.resdirs = []

# TODO: to remove in conan v2 once cmake_find_package* generators removed
self.cpp_info.names["cmake_find_package"] = "ArduinoJson"
Expand Down
5 changes: 4 additions & 1 deletion recipes/arduinojson/all/test_package/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
cmake_minimum_required(VERSION 3.1)
cmake_minimum_required(VERSION 3.8)
project(test_package LANGUAGES CXX)

find_package(ArduinoJson REQUIRED CONFIG)

add_executable(${PROJECT_NAME} test_package.cpp)
target_link_libraries(${PROJECT_NAME} PRIVATE ArduinoJson)
if(ArduinoJson_VERSION VERSION_GREATER_EQUAL "6.21.0")
target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11)
endif()
7 changes: 4 additions & 3 deletions recipes/arduinojson/all/test_package/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@
class TestPackageConan(ConanFile):
settings = "os", "arch", "compiler", "build_type"
generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv"

def requirements(self):
self.requires(self.tested_reference_str)
test_type = "explicit"

def layout(self):
cmake_layout(self)

def requirements(self):
self.requires(self.tested_reference_str)

def build(self):
cmake = CMake(self)
cmake.configure()
Expand Down
8 changes: 3 additions & 5 deletions recipes/arduinojson/all/test_v1_package/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
cmake_minimum_required(VERSION 3.1)
project(test_package LANGUAGES CXX)
project(test_package)

include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
conan_basic_setup(TARGETS)

find_package(ArduinoJson REQUIRED CONFIG)

add_executable(${PROJECT_NAME} ../test_package/test_package.cpp)
target_link_libraries(${PROJECT_NAME} PRIVATE ArduinoJson)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package
${CMAKE_CURRENT_BINARY_DIR}/test_package)
15 changes: 2 additions & 13 deletions recipes/benchmark/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,20 +49,9 @@ def validate(self):
if Version(self.version) < "1.7.0" and is_msvc(self) and self.options.shared:
raise ConanInvalidConfiguration(f"{self.ref} doesn't support msvc shared builds")

def _cmake_new_enough(self, required_version):
try:
import re
from io import StringIO
output = StringIO()
self.run("cmake --version", output)
m = re.search(r'cmake version (\d+\.\d+\.\d+)', output.getvalue())
return Version(m.group(1)) >= required_version
except:
return False

def build_requirements(self):
if Version(self.version) >= "1.7.1" and not self._cmake_new_enough("3.16.3"):
self.tool_requires("cmake/3.25.3")
if Version(self.version) >= "1.7.1":
self.tool_requires("cmake/[>=3.16.3 <4]")

def source(self):
get(self, **self.conan_data["sources"][self.version], strip_root=True)
Expand Down
19 changes: 19 additions & 0 deletions recipes/cmake/binary/conandata.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,23 @@
sources:
"3.26.3":
Linux:
armv8:
url: "https://cmake.org/files/v3.26/cmake-3.26.3-linux-aarch64.tar.gz"
sha256: "7a4fbe374475db1a098b632b54e3c9180973e8a791c700deabe5408ae23ea3ce"
x86_64:
url: "https://cmake.org/files/v3.26/cmake-3.26.3-linux-x86_64.tar.gz"
sha256: "28d4d1d0db94b47d8dfd4f7dec969a3c747304f4a28ddd6fd340f553f2384dc2"
Macos:
universal:
url: "https://cmake.org/files/v3.26/cmake-3.26.3-macos10.10-universal.tar.gz"
sha256: "b0d39ae9ddec3f193f50ff549edb30d0b35acb6c95c12f7611dbc8afc52c8ab6"
Windows:
armv8:
url: "https://cmake.org/files/v3.26/cmake-3.26.3-windows-arm64.zip"
sha256: "fd1d908ea54a081a092bc7f9dad0a6ba90fc5aa2644ee5cef901e3f925fce3d8"
x86_64:
url: "https://cmake.org/files/v3.26/cmake-3.26.3-windows-x86_64.zip"
sha256: "91a418595cc9a97d5f679e36728dfec79ee52980f51e8814ec7b05b890708523"
"3.25.3":
Linux:
armv8:
Expand Down
22 changes: 22 additions & 0 deletions recipes/cmake/combined/conandata.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,23 @@
binaries:
"3.26.3":
Linux:
armv8:
url: "https://cmake.org/files/v3.26/cmake-3.26.3-linux-aarch64.tar.gz"
sha256: "7a4fbe374475db1a098b632b54e3c9180973e8a791c700deabe5408ae23ea3ce"
x86_64:
url: "https://cmake.org/files/v3.26/cmake-3.26.3-linux-x86_64.tar.gz"
sha256: "28d4d1d0db94b47d8dfd4f7dec969a3c747304f4a28ddd6fd340f553f2384dc2"
Macos:
universal:
url: "https://cmake.org/files/v3.26/cmake-3.26.3-macos10.10-universal.tar.gz"
sha256: "b0d39ae9ddec3f193f50ff549edb30d0b35acb6c95c12f7611dbc8afc52c8ab6"
Windows:
armv8:
url: "https://cmake.org/files/v3.26/cmake-3.26.3-windows-arm64.zip"
sha256: "fd1d908ea54a081a092bc7f9dad0a6ba90fc5aa2644ee5cef901e3f925fce3d8"
x86_64:
url: "https://cmake.org/files/v3.26/cmake-3.26.3-windows-x86_64.zip"
sha256: "91a418595cc9a97d5f679e36728dfec79ee52980f51e8814ec7b05b890708523"
"3.25.3":
Linux:
armv8:
Expand Down Expand Up @@ -120,3 +139,6 @@ sources:
"3.25.3":
url: "https://github.com/Kitware/CMake/releases/download/v3.25.3/cmake-3.25.3.tar.gz"
sha256: "cc995701d590ca6debc4245e9989939099ca52827dd46b5d3592f093afe1901c"
"3.26.3":
url: "https://github.com/Kitware/CMake/releases/download/v3.26.3/cmake-3.26.3.tar.gz"
sha256: "bbd8d39217509d163cb544a40d6428ac666ddc83e22905d3e52c925781f0f659"
2 changes: 2 additions & 0 deletions recipes/cmake/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ versions:
folder: "combined"
"3.25.3":
folder: "combined"
"3.26.3":
folder: "combined"
3 changes: 3 additions & 0 deletions recipes/cpp-httplib/all/conandata.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
sources:
"0.12.3":
url: "https://github.com/yhirose/cpp-httplib/archive/v0.12.3.tar.gz"
sha256: "175ced3c9cdaf221e9edf210297568d8f7d402a41d6db01254ac9e0b25487c54"
"0.12.2":
url: "https://github.com/yhirose/cpp-httplib/archive/v0.12.2.tar.gz"
sha256: "a7897d052de8fae75817e7a261ae37b89dc4cb8ac74b74458a1f2d2e707cfd03"
Expand Down
2 changes: 2 additions & 0 deletions recipes/cpp-httplib/config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
versions:
"0.12.3":
folder: all
"0.12.2":
folder: all
"0.12.1":
Expand Down
9 changes: 2 additions & 7 deletions recipes/cppcheck/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,15 @@ class CppcheckConan(ConanFile):
license = "GPL-3.0-or-later"
package_type = "application"
settings = "os", "arch", "compiler", "build_type"
options = {"have_rules": [True, False], "with_z3": [True, False, "deprecated"]}
default_options = {"have_rules": True, "with_z3": "deprecated"}
options = {"have_rules": [True, False]}
default_options = {"have_rules": True}

def layout(self):
cmake_layout(self, src_folder="src")

def export_sources(self):
export_conandata_patches(self)

def configure(self):
if self.options.get_safe("with_z3") != "deprecated":
self.output.warning("Option \"with_z3\" is deprecated, do not use anymore.")

def requirements(self):
if self.options.get_safe("have_rules"):
self.requires("pcre/8.45")
Expand Down Expand Up @@ -61,7 +57,6 @@ def package(self):
def package_id(self):
del self.info.settings.compiler
del self.info.settings.build_type
del self.info.options.with_z3

def package_info(self):
self.cpp_info.includedirs = []
Expand Down
15 changes: 2 additions & 13 deletions recipes/cryptopp/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,20 +50,9 @@ def validate(self):
if self.options.shared and Version(self.version) >= "8.7.0":
raise ConanInvalidConfiguration("cryptopp 8.7.0 and higher do not support shared builds")

def _cmake_new_enough(self, required_version):
try:
import re
from io import StringIO
output = StringIO()
self.run("cmake --version", output)
m = re.search(r'cmake version (\d+\.\d+\.\d+)', output.getvalue())
return Version(m.group(1)) >= required_version
except:
return False

def build_requirements(self):
if Version(self.version) >= "8.7.0" and not self._cmake_new_enough("3.20"):
self.tool_requires("cmake/3.25.2")
if Version(self.version) >= "8.7.0":
self.tool_requires("cmake/[>=3.20 <4]")

def source(self):
# Get cryptopp sources
Expand Down
Loading

0 comments on commit fdb770b

Please sign in to comment.