Skip to content

Commit fb0cdb2

Browse files
perseoGIjeremydumais
authored andcommitted
concurrencpp: add missing includes, maintenance changes (conan-io#28285)
* fix: πŸ› concurrencpp: add missing includes * Relax libc++ requirement when using clang * Restrict clang > 14 and gcc > 13
1 parent 7260e68 commit fb0cdb2

File tree

7 files changed

+31
-92
lines changed

7 files changed

+31
-92
lines changed

β€Žrecipes/concurrencpp/all/conandata.ymlβ€Ž

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,8 @@ sources:
22
"0.1.7":
33
url: "https://github.com/David-Haim/concurrencpp/archive/refs/tags/v.0.1.7.tar.gz"
44
sha256: "049f3e83ad1828e0b8b518652de1a3160d5849fdff03d521d0a5af0167338e89"
5-
"0.1.6":
6-
url: "https://github.com/David-Haim/concurrencpp/archive/refs/tags/v.0.1.6.tar.gz"
7-
sha256: "e7d5c23a73ff1d7199d361d3402ad2a710dfccf7630b622346df94a7532b4221"
8-
"0.1.5":
9-
url: "https://github.com/David-Haim/concurrencpp/archive/refs/tags/v.0.1.5.tar.gz"
10-
sha256: "330150ebe11b3d30ffcb3efdecc184a34cf50a6bd43b68e294a496225d286651"
11-
"0.1.4":
12-
url: "https://github.com/David-Haim/concurrencpp/archive/refs/tags/v.0.1.4.tar.gz"
13-
sha256: "3ad9424f975b766accc6eaedf4acfe1a20b5fdbb57fa3ae71f400e13d471e86f"
145
patches:
156
"0.1.7":
16-
- patch_file: "patches/cmake-min-version.patch"
17-
- patch_file: "patches/directory-name-0.1.6.patch"
18-
"0.1.6":
19-
- patch_file: "patches/cmake-min-version.patch"
20-
- patch_file: "patches/directory-name-0.1.6.patch"
21-
"0.1.5":
22-
- patch_file: "patches/cmake-min-version.patch"
23-
- patch_file: "patches/directory-name-0.1.5.patch"
24-
"0.1.4":
257
- patch_file: "patches/cmake-min-version.patch"
268
- patch_file: "patches/directory-name.patch"
9+
- patch_file: "patches/include-missing-headers.patch"
Lines changed: 7 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
from conan import ConanFile
2-
from conan.errors import ConanInvalidConfiguration
32
from conan.tools.build import check_min_cppstd
43
from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout
54
from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir
6-
from conan.tools.microsoft import is_msvc
75
from conan.tools.scm import Version
6+
from conan.errors import ConanInvalidConfiguration
87
import os
98

10-
required_conan_version = ">=1.53.0"
9+
required_conan_version = ">=2.1"
1110

1211

1312
class ConcurrencppConan(ConanFile):
@@ -27,53 +26,26 @@ class ConcurrencppConan(ConanFile):
2726
"shared": False,
2827
"fPIC": True,
2928
}
30-
31-
@property
32-
def _min_cppstd(self):
33-
return "20"
29+
implements = ["auto_shared_fpic"]
3430

3531
@property
3632
def _minimum_compilers_version(self):
3733
return {
38-
"Visual Studio": "16",
39-
"msvc": "192",
40-
"clang": "11",
41-
"gcc": "13",
34+
"clang": "14", # Until clang-14 coroutines are not fully supported
35+
"gcc": "13", # Until gcc-13 alignas specifier is not supported
4236
}
4337

4438
def export_sources(self):
4539
export_conandata_patches(self)
4640

47-
def config_options(self):
48-
if self.settings.os == "Windows":
49-
del self.options.fPIC
50-
51-
def configure(self):
52-
if self.options.shared:
53-
self.options.rm_safe("fPIC")
54-
5541
def layout(self):
5642
cmake_layout(self, src_folder="src")
5743

5844
def validate(self):
59-
if self.settings.compiler.get_safe("cppstd"):
60-
check_min_cppstd(self, self._min_cppstd)
61-
if Version(self.version) <= "0.1.5" and self.options.shared and is_msvc(self):
62-
# see https://github.com/David-Haim/concurrencpp/issues/75
63-
raise ConanInvalidConfiguration(f"{self.ref} does not support shared builds with Visual Studio")
64-
if Version(self.version) <= "0.1.6" and self.settings.compiler == "gcc":
65-
raise ConanInvalidConfiguration("gcc is not supported by concurrencpp")
66-
if Version(self.version) >= "0.1.5" and self.settings.compiler == "apple-clang":
67-
# apple-clang does not seem to support the C++20 synchronization library which concurrencpp 0.1.5 depends on
68-
raise ConanInvalidConfiguration("apple-clang is not supported by concurrencpp 0.1.5 and higher")
69-
45+
check_min_cppstd(self, 20)
7046
minimum_version = self._minimum_compilers_version.get(str(self.settings.compiler), False)
7147
if minimum_version and Version(self.settings.compiler.version) < minimum_version:
72-
raise ConanInvalidConfiguration(
73-
f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support."
74-
)
75-
if self.settings.compiler == "clang" and self.settings.compiler.libcxx != "libc++":
76-
raise ConanInvalidConfiguration("libc++ required")
48+
raise ConanInvalidConfiguration(f"{self.ref} requires C++20, which your compiler does not support.")
7749

7850
def source(self):
7951
get(self, **self.conan_data["sources"][self.version], strip_root=True)
@@ -95,8 +67,6 @@ def package(self):
9567
rmdir(self, os.path.join(self.package_folder, "lib", "cmake"))
9668

9769
def package_info(self):
98-
self.cpp_info.set_property("cmake_file_name", "concurrencpp")
99-
self.cpp_info.set_property("cmake_target_name", "concurrencpp::concurrencpp")
10070
self.cpp_info.libs = ["concurrencpp"]
10171
if self.settings.os in ["Linux", "FreeBSD"]:
10272
self.cpp_info.system_libs = ["m", "pthread", "rt"]

β€Žrecipes/concurrencpp/all/patches/directory-name-0.1.5.patchβ€Ž

Lines changed: 0 additions & 14 deletions
This file was deleted.

β€Žrecipes/concurrencpp/all/patches/directory-name-0.1.6.patchβ€Ž

Lines changed: 0 additions & 14 deletions
This file was deleted.
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
diff --git a/CMakeLists.txt b/CMakeLists.txt
22
--- a/CMakeLists.txt
33
+++ b/CMakeLists.txt
4-
@@ -99,8 +99,8 @@ include(CMakePackageConfigHelpers)
4+
@@ -116,8 +116,8 @@ include(CMakePackageConfigHelpers)
55
include(CMakePackageConfigHelpers)
66
include(GNUInstallDirs)
77

@@ -10,5 +10,5 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt
1010
+set(concurrencpp_directory "concurrencpp")
1111
+set(concurrencpp_include_directory "${CMAKE_INSTALL_INCLUDEDIR}")
1212

13-
install(TARGETS concurrencpp
14-
EXPORT concurrencppTargets
13+
install(
14+
TARGETS concurrencpp
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
--- a/include/concurrencpp/results/impl/shared_result_state.h
2+
+++ b/include/concurrencpp/results/impl/shared_result_state.h
3+
@@ -5,6 +5,7 @@
4+
#include "concurrencpp/results/impl/result_state.h"
5+
6+
#include <atomic>
7+
+#include <chrono>
8+
#include <semaphore>
9+
10+
#include <cassert>
11+
--- a/include/concurrencpp/threads/thread.h
12+
+++ b/include/concurrencpp/threads/thread.h
13+
@@ -4,6 +4,7 @@
14+
#include "concurrencpp/platform_defs.h"
15+
16+
#include <functional>
17+
+#include <string>
18+
#include <string_view>
19+
#include <thread>
20+
Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
11
versions:
22
"0.1.7":
33
folder: all
4-
"0.1.6":
5-
folder: all
6-
"0.1.5":
7-
folder: all
8-
"0.1.4":
9-
folder: all

0 commit comments

Comments
Β (0)