Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xenium: new recipe #26692

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
4 changes: 4 additions & 0 deletions recipes/xenium/all/conandata.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
sources:
"cci.20250206":
url: "https://github.com/mpoeter/xenium/archive/3f08ceac00f54d0992c053de81743b3937aaf543.tar.gz"
sha256: "2B57A0F43FF61DE8DF3F7A59DF98A385D8A7F448BFFDE8C8AD7A6789054D00C1"
47 changes: 47 additions & 0 deletions recipes/xenium/all/conanfile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
from conan import ConanFile
from conan.errors import ConanInvalidConfiguration
from conan.tools.files import get, copy
from conan.tools.build import check_min_cppstd
from conan.tools.layout import basic_layout
import os

required_conan_version = ">=2.0.0"

class XeniumConan(ConanFile):
name = "xenium"
description = "A C++ library providing various concurrent data structures and reclamation schemes"
license = "MIT"
url = "https://github.com/conan-io/conan-center-index"
homepage = "https://github.com/mpoeter/xenium"
topics = ("parallelism", "lockfree", "reclamation", "header-only")
package_type = "header-library"
settings = "os", "arch", "compiler", "build_type"
no_copy_source = True

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

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

def validate(self):
if self.settings.arch not in ("x86_64", "armv8", "armv8.3", "arm64ec", "sparc", "sparcv9"):
raise ConanInvalidConfiguration(f"{self.ref} only supports x86_64, armv8, armv8.3, arm64ec, sparc, and sparcv9 architecture.")
if self.settings.compiler.get_safe("cppstd"):
check_min_cppstd(self, 17)

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

def package(self):
copy(self, pattern="LICENSE*", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder)
copy(
self,
pattern="*.hpp",
dst=os.path.join(self.package_folder, "include", "xenium"),
src=os.path.join(self.source_folder, "xenium"),
)

def package_info(self):
self.cpp_info.bindirs = []
self.cpp_info.libdirs = []
7 changes: 7 additions & 0 deletions recipes/xenium/all/test_package/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
cmake_minimum_required(VERSION 3.20)
project(test_package LANGUAGES CXX)

find_package(xenium REQUIRED CONFIG)

add_executable(${PROJECT_NAME} test_package.cpp)
target_link_libraries(${PROJECT_NAME} PRIVATE xenium::xenium)
29 changes: 29 additions & 0 deletions recipes/xenium/all/test_package/conanfile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
from conan import ConanFile
from conan.tools.build import can_run
from conan.tools.cmake import cmake_layout, CMake
import os


class TestPackageConan(ConanFile):
settings = "os", "arch", "compiler", "build_type"
generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv"
test_type = "explicit"

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

def layout(self):
cmake_layout(self)

def build_requirements(self):
self.tool_requires("cmake/[>=3.20 <4]")

def build(self):
cmake = CMake(self)
cmake.configure()
cmake.build()

def test(self):
if can_run(self):
bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package")
self.run(bin_path, env="conanrun")
13 changes: 13 additions & 0 deletions recipes/xenium/all/test_package/test_package.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#include <xenium/nikolaev_queue.hpp>
#include <xenium/reclamation/generic_epoch_based.hpp>

int main(void) {
xenium::nikolaev_queue<int, xenium::policy::reclaimer<xenium::reclamation::epoch_based<>>> queue;

queue.push(0);

int data = -1;
queue.try_pop(data);

return data;
}
3 changes: 3 additions & 0 deletions recipes/xenium/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
versions:
"cci.20250206":
folder: all