Skip to content

Commit

Permalink
(conan-io#15454) plf_colony: add version 7.06, support apple-clang 14
Browse files Browse the repository at this point in the history
* plf_colony: add version 7.06, support apple-clang 14

* remove no_copy_source

* create patch files for apple-clang 14
  • Loading branch information
toge authored and StellaSmith committed Feb 2, 2023
1 parent cc4eb62 commit bc3c0a1
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 9 deletions.
16 changes: 16 additions & 0 deletions recipes/plf_colony/all/conandata.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
sources:
"7.06":
url: "https://github.com/mattreecebentley/plf_colony/archive/348174f0da2ea65b7a561b08412e81ce1f5e6161.tar.gz"
sha256: "c6a34d08d4946f0ce54a9836b564b329afffc7ce173720282c7e2b0b57cbc484"
"7.03":
url: "https://github.com/mattreecebentley/plf_colony/archive/f182529ea6f125fc9cee5ca57f499284c777cecb.tar.gz"
sha256: "8fa98993283a158779596f0de17217bd7ef2923fbfc116861172f4ba20f4bc81"
Expand All @@ -8,3 +11,16 @@ sources:
"6.25":
url: "https://github.com/mattreecebentley/plf_colony/archive/848305c2f83fbd5407e6e3fdb9c3e3e8dcfa2ea6.tar.gz"
sha256: "4d298dbd9266201be9733ef276046e9a55d7f35a8c16378fc1dcb687ca8ab4ad"
patches:
"7.06":
- patch_file: "patches/7.06-0001-disable-cxx20-from-apple-clang14.patch"
patch_description: "apple-clang 14 defaults C++ 20, but it doesn't support C++20 features little"
patch_type: "portability"
"7.03":
- patch_file: "patches/7.00-0001-disable-cxx20-from-apple-clang14.patch"
patch_description: "apple-clang 14 defaults C++ 20, but it doesn't support C++20 features little"
patch_type: "portability"
"7.00":
- patch_file: "patches/7.00-0001-disable-cxx20-from-apple-clang14.patch"
patch_description: "apple-clang 14 defaults C++ 20, but it doesn't support C++20 features little"
patch_type: "portability"
10 changes: 6 additions & 4 deletions recipes/plf_colony/all/conanfile.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from conan import ConanFile
from conan.tools.files import copy, get
from conan.tools.files import copy, get, apply_conandata_patches, export_conandata_patches
from conan.tools.layout import basic_layout
import os

Expand All @@ -11,11 +11,13 @@ class PlfcolonyConan(ConanFile):
description = "An unordered data container providing fast iteration/insertion/erasure " \
"while maintaining pointer/iterator/reference validity to non-erased elements."
license = "Zlib"
topics = ("plf_colony", "container", "bucket", "unordered")
topics = ("container", "bucket", "unordered", "header-only")
homepage = "https://github.com/mattreecebentley/plf_colony"
url = "https://github.com/conan-io/conan-center-index"
settings = "os", "arch", "compiler", "build_type"
no_copy_source = True

def export_sources(self):
export_conandata_patches(self)

def package_id(self):
self.info.clear()
Expand All @@ -28,7 +30,7 @@ def source(self):
destination=self.source_folder, strip_root=True)

def build(self):
pass
apply_conandata_patches(self)

def package(self):
copy(self, "LICENSE.md", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses"))
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/plf_colony.h b/plf_colony.h
index a9911f3..c707edc 100644
--- a/plf_colony.h
+++ b/plf_colony.h
@@ -165,7 +165,7 @@
#define PLF_CONSTEXPR constexpr
#endif

- #if __cplusplus > 201704L && ((defined(_LIBCPP_VERSION) && _LIBCPP_VERSION >= 13) || !defined(_LIBCPP_VERSION)) && ((defined(__clang__) && (__clang_major__ >= 13)) || (defined(__GNUC__) && __GNUC__ >= 10) || (!defined(__clang__) && !defined(__GNUC__)))
+ #if __cplusplus > 201704L && ((defined(_LIBCPP_VERSION) && _LIBCPP_VERSION >= 13) || !defined(_LIBCPP_VERSION)) && ((!defined(__APPLE_CC__) && defined(__clang__) && (__clang_major__ >= 13)) || (defined(__GNUC__) && __GNUC__ >= 10) || (!defined(__clang__) && !defined(__GNUC__)))
#define PLF_CPP20_SUPPORT
#undef PLF_CONSTFUNC
#define PLF_CONSTFUNC constexpr
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/plf_colony.h b/plf_colony.h
index e789331..2e2005b 100644
--- a/plf_colony.h
+++ b/plf_colony.h
@@ -176,7 +176,7 @@
#define PLF_CONSTEXPR constexpr
#endif

- #if __cplusplus > 201704L && ((defined(_LIBCPP_VERSION) && _LIBCPP_VERSION >= 13) || !defined(_LIBCPP_VERSION)) && ((defined(__clang__) && (__clang_major__ >= 13)) || (defined(__GNUC__) && __GNUC__ >= 10) || (!defined(__clang__) && !defined(__GNUC__)))
+ #if __cplusplus > 201704L && ((defined(_LIBCPP_VERSION) && _LIBCPP_VERSION >= 13) || !defined(_LIBCPP_VERSION)) && ((!defined(__APPLE_CC__) && defined(__clang__) && (__clang_major__ >= 13)) || (defined(__GNUC__) && __GNUC__ >= 10) || (!defined(__clang__) && !defined(__GNUC__)))
#define PLF_CPP20_SUPPORT
#undef PLF_CONSTFUNC
#define PLF_CONSTFUNC constexpr
8 changes: 3 additions & 5 deletions recipes/plf_colony/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(plf_colony REQUIRED CONFIG)

add_executable(${PROJECT_NAME} ../test_package/test_package.cpp)
target_link_libraries(${PROJECT_NAME} PRIVATE plf_colony::plf_colony)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/
${CMAKE_CURRENT_BINARY_DIR}/test_package/)
2 changes: 2 additions & 0 deletions recipes/plf_colony/config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
versions:
"7.06":
folder: all
"7.03":
folder: all
"7.00":
Expand Down

0 comments on commit bc3c0a1

Please sign in to comment.