diff --git a/recipes/concurrencpp/all/conandata.yml b/recipes/concurrencpp/all/conandata.yml index 65da3e9e96d97..779d5bd43bc2f 100644 --- a/recipes/concurrencpp/all/conandata.yml +++ b/recipes/concurrencpp/all/conandata.yml @@ -2,25 +2,8 @@ sources: "0.1.7": url: "https://github.com/David-Haim/concurrencpp/archive/refs/tags/v.0.1.7.tar.gz" sha256: "049f3e83ad1828e0b8b518652de1a3160d5849fdff03d521d0a5af0167338e89" - "0.1.6": - url: "https://github.com/David-Haim/concurrencpp/archive/refs/tags/v.0.1.6.tar.gz" - sha256: "e7d5c23a73ff1d7199d361d3402ad2a710dfccf7630b622346df94a7532b4221" - "0.1.5": - url: "https://github.com/David-Haim/concurrencpp/archive/refs/tags/v.0.1.5.tar.gz" - sha256: "330150ebe11b3d30ffcb3efdecc184a34cf50a6bd43b68e294a496225d286651" - "0.1.4": - url: "https://github.com/David-Haim/concurrencpp/archive/refs/tags/v.0.1.4.tar.gz" - sha256: "3ad9424f975b766accc6eaedf4acfe1a20b5fdbb57fa3ae71f400e13d471e86f" patches: "0.1.7": - - patch_file: "patches/cmake-min-version.patch" - - patch_file: "patches/directory-name-0.1.6.patch" - "0.1.6": - - patch_file: "patches/cmake-min-version.patch" - - patch_file: "patches/directory-name-0.1.6.patch" - "0.1.5": - - patch_file: "patches/cmake-min-version.patch" - - patch_file: "patches/directory-name-0.1.5.patch" - "0.1.4": - patch_file: "patches/cmake-min-version.patch" - patch_file: "patches/directory-name.patch" + - patch_file: "patches/include-missing-headers.patch" diff --git a/recipes/concurrencpp/all/conanfile.py b/recipes/concurrencpp/all/conanfile.py index 63a26ab91e6ec..951662efc4a07 100644 --- a/recipes/concurrencpp/all/conanfile.py +++ b/recipes/concurrencpp/all/conanfile.py @@ -1,13 +1,12 @@ from conan import ConanFile -from conan.errors import ConanInvalidConfiguration from conan.tools.build import check_min_cppstd from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir -from conan.tools.microsoft import is_msvc from conan.tools.scm import Version +from conan.errors import ConanInvalidConfiguration import os -required_conan_version = ">=1.53.0" +required_conan_version = ">=2.1" class ConcurrencppConan(ConanFile): @@ -27,53 +26,26 @@ class ConcurrencppConan(ConanFile): "shared": False, "fPIC": True, } - - @property - def _min_cppstd(self): - return "20" + implements = ["auto_shared_fpic"] @property def _minimum_compilers_version(self): return { - "Visual Studio": "16", - "msvc": "192", - "clang": "11", - "gcc": "13", + "clang": "14", # Until clang-14 coroutines are not fully supported + "gcc": "13", # Until gcc-13 alignas specifier is not supported } def export_sources(self): export_conandata_patches(self) - def config_options(self): - if self.settings.os == "Windows": - del self.options.fPIC - - def configure(self): - if self.options.shared: - self.options.rm_safe("fPIC") - def layout(self): cmake_layout(self, src_folder="src") def validate(self): - if self.settings.compiler.get_safe("cppstd"): - check_min_cppstd(self, self._min_cppstd) - if Version(self.version) <= "0.1.5" and self.options.shared and is_msvc(self): - # see https://github.com/David-Haim/concurrencpp/issues/75 - raise ConanInvalidConfiguration(f"{self.ref} does not support shared builds with Visual Studio") - if Version(self.version) <= "0.1.6" and self.settings.compiler == "gcc": - raise ConanInvalidConfiguration("gcc is not supported by concurrencpp") - if Version(self.version) >= "0.1.5" and self.settings.compiler == "apple-clang": - # apple-clang does not seem to support the C++20 synchronization library which concurrencpp 0.1.5 depends on - raise ConanInvalidConfiguration("apple-clang is not supported by concurrencpp 0.1.5 and higher") - + check_min_cppstd(self, 20) minimum_version = self._minimum_compilers_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++{self._min_cppstd}, which your compiler does not support." - ) - if self.settings.compiler == "clang" and self.settings.compiler.libcxx != "libc++": - raise ConanInvalidConfiguration("libc++ required") + raise ConanInvalidConfiguration(f"{self.ref} requires C++20, which your compiler does not support.") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -95,8 +67,6 @@ def package(self): rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) def package_info(self): - self.cpp_info.set_property("cmake_file_name", "concurrencpp") - self.cpp_info.set_property("cmake_target_name", "concurrencpp::concurrencpp") self.cpp_info.libs = ["concurrencpp"] if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.system_libs = ["m", "pthread", "rt"] diff --git a/recipes/concurrencpp/all/patches/directory-name-0.1.5.patch b/recipes/concurrencpp/all/patches/directory-name-0.1.5.patch deleted file mode 100644 index 73d77806a9b8a..0000000000000 --- a/recipes/concurrencpp/all/patches/directory-name-0.1.5.patch +++ /dev/null @@ -1,14 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -104,8 +104,8 @@ include(CMakePackageConfigHelpers) - include(CMakePackageConfigHelpers) - include(GNUInstallDirs) - --set(concurrencpp_directory "concurrencpp-${PROJECT_VERSION}") --set(concurrencpp_include_directory "${CMAKE_INSTALL_INCLUDEDIR}/${concurrencpp_directory}") -+set(concurrencpp_directory "concurrencpp") -+set(concurrencpp_include_directory "${CMAKE_INSTALL_INCLUDEDIR}") - - install(TARGETS concurrencpp - EXPORT concurrencppTargets diff --git a/recipes/concurrencpp/all/patches/directory-name-0.1.6.patch b/recipes/concurrencpp/all/patches/directory-name-0.1.6.patch deleted file mode 100644 index 8a56c4af6669b..0000000000000 --- a/recipes/concurrencpp/all/patches/directory-name-0.1.6.patch +++ /dev/null @@ -1,14 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -116,8 +116,8 @@ include(CMakePackageConfigHelpers) - include(CMakePackageConfigHelpers) - include(GNUInstallDirs) - --set(concurrencpp_directory "concurrencpp-${PROJECT_VERSION}") --set(concurrencpp_include_directory "${CMAKE_INSTALL_INCLUDEDIR}/${concurrencpp_directory}") -+set(concurrencpp_directory "concurrencpp") -+set(concurrencpp_include_directory "${CMAKE_INSTALL_INCLUDEDIR}") - - install( - TARGETS concurrencpp diff --git a/recipes/concurrencpp/all/patches/directory-name.patch b/recipes/concurrencpp/all/patches/directory-name.patch index b79525132cfac..8a56c4af6669b 100644 --- a/recipes/concurrencpp/all/patches/directory-name.patch +++ b/recipes/concurrencpp/all/patches/directory-name.patch @@ -1,7 +1,7 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -99,8 +99,8 @@ include(CMakePackageConfigHelpers) +@@ -116,8 +116,8 @@ include(CMakePackageConfigHelpers) include(CMakePackageConfigHelpers) include(GNUInstallDirs) @@ -10,5 +10,5 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt +set(concurrencpp_directory "concurrencpp") +set(concurrencpp_include_directory "${CMAKE_INSTALL_INCLUDEDIR}") - install(TARGETS concurrencpp - EXPORT concurrencppTargets + install( + TARGETS concurrencpp diff --git a/recipes/concurrencpp/all/patches/include-missing-headers.patch b/recipes/concurrencpp/all/patches/include-missing-headers.patch new file mode 100644 index 0000000000000..20ab8bb014a8b --- /dev/null +++ b/recipes/concurrencpp/all/patches/include-missing-headers.patch @@ -0,0 +1,20 @@ +--- a/include/concurrencpp/results/impl/shared_result_state.h ++++ b/include/concurrencpp/results/impl/shared_result_state.h +@@ -5,6 +5,7 @@ + #include "concurrencpp/results/impl/result_state.h" + + #include ++#include + #include + + #include +--- a/include/concurrencpp/threads/thread.h ++++ b/include/concurrencpp/threads/thread.h +@@ -4,6 +4,7 @@ + #include "concurrencpp/platform_defs.h" + + #include ++#include + #include + #include + diff --git a/recipes/concurrencpp/config.yml b/recipes/concurrencpp/config.yml index d1f158a132019..e6830418cc45c 100644 --- a/recipes/concurrencpp/config.yml +++ b/recipes/concurrencpp/config.yml @@ -1,9 +1,3 @@ versions: "0.1.7": folder: all - "0.1.6": - folder: all - "0.1.5": - folder: all - "0.1.4": - folder: all