Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 1 addition & 18 deletions recipes/concurrencpp/all/conandata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
44 changes: 7 additions & 37 deletions recipes/concurrencpp/all/conanfile.py
Original file line number Diff line number Diff line change
@@ -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):
Expand All @@ -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)
Expand All @@ -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"]
14 changes: 0 additions & 14 deletions recipes/concurrencpp/all/patches/directory-name-0.1.5.patch

This file was deleted.

14 changes: 0 additions & 14 deletions recipes/concurrencpp/all/patches/directory-name-0.1.6.patch

This file was deleted.

6 changes: 3 additions & 3 deletions recipes/concurrencpp/all/patches/directory-name.patch
Original file line number Diff line number Diff line change
@@ -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)

Expand All @@ -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
20 changes: 20 additions & 0 deletions recipes/concurrencpp/all/patches/include-missing-headers.patch
Original file line number Diff line number Diff line change
@@ -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 <atomic>
+#include <chrono>
#include <semaphore>

#include <cassert>
--- a/include/concurrencpp/threads/thread.h
+++ b/include/concurrencpp/threads/thread.h
@@ -4,6 +4,7 @@
#include "concurrencpp/platform_defs.h"

#include <functional>
+#include <string>
#include <string_view>
#include <thread>

6 changes: 0 additions & 6 deletions recipes/concurrencpp/config.yml
Original file line number Diff line number Diff line change
@@ -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