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

rapidyaml: add version 0.7.0 #23837

Merged
merged 4 commits into from
Jun 17, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 7 additions & 0 deletions recipes/rapidyaml/all/conandata.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
sources:
"0.6.0":
url: "https://github.com/biojppm/rapidyaml/releases/download/v0.6.0/rapidyaml-0.6.0-src.tgz"
sha256: "07353f3a71890900c052231172b4c9855616de9c9213e55a4213eef13f424f6d"
"0.5.0":
url: "https://github.com/biojppm/rapidyaml/releases/download/v0.5.0/rapidyaml-0.5.0-src.tgz"
sha256: "6493557778791a3a2375510ce6c0ecd70163fc8ce4f8ed683acc36e3e55ee881"
Expand All @@ -12,6 +15,10 @@ sources:
url: "https://github.com/biojppm/rapidyaml/releases/download/v0.3.0/rapidyaml-0.3.0-src.tgz"
sha256: "38854b8359eaf42cc27352f4b7321f509f6775445a3e2746cc8cd1e468a52aa9"
patches:
"0.6.0":
- patch_file: "patches/0.6.0-001-remove-internal-c4core.patch"
patch_description: "disable using internal c4core"
patch_type: "conan"
"0.5.0":
- patch_file: "patches/0.5.0-001-remove-internal-c4core.patch"
patch_description: "disable using internal c4core"
Expand Down
15 changes: 14 additions & 1 deletion recipes/rapidyaml/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,16 @@ class RapidYAMLConan(ConanFile):
"fPIC": [True, False],
"with_default_callbacks": [True, False],
"with_tab_tokens": [True, False],
"with_default_callback_uses_exceptions": [True, False],
"with_assert": [True, False],
}
default_options = {
"shared": False,
"fPIC": True,
"with_default_callbacks": True,
"with_tab_tokens": False,
"with_default_callback_uses_exceptions": False,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Afaik this one should only be valid if with_default_callbacks is true as per biojppm/rapidyaml@v0.5.0...v0.6.0#diff-1e7de1ae2d059d21e1dd75d5812d5a34b0222cef273b7c3a2af62eb747f9d20aR17-R19 - we might need to delete the option in configure if that is true

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@RubenRBS
Sorry for late resposne.
I fixed it.

"with_assert": False,
}

@property
Expand All @@ -41,6 +45,9 @@ def config_options(self):
del self.options.fPIC
if Version(self.version) < "0.4.0":
del self.options.with_tab_tokens
if Version(self.version) < "0.6.0":
del self.options.with_default_callback_uses_exceptions
del self.options.with_assert

def configure(self):
if self.options.shared:
Expand All @@ -50,7 +57,10 @@ def layout(self):
cmake_layout(self, src_folder="src")

def requirements(self):
self.requires("c4core/0.1.11", transitive_headers=True)
if Version(self.version) < "0.6.0":
self.requires("c4core/0.1.11", transitive_headers=True)
else:
self.requires("c4core/0.2.0", transitive_headers=True)

def validate(self):
if self.info.settings.compiler.cppstd:
Expand All @@ -65,6 +75,9 @@ def generate(self):
tc.variables["RYML_DEFAULT_CALLBACKS"] = self.options.with_default_callbacks
if Version(self.version) >= "0.4.0":
tc.variables["RYML_WITH_TAB_TOKENS"] = self.options.with_tab_tokens
if Version(self.version) >= "0.6.0":
tc.variables["RYML_DEFAULT_CALLBACK_USES_EXCEPTIONS"] = self.options.with_default_callback_uses_exceptions
tc.variables["RYML_USE_ASSERT"] = self.options.with_assert
tc.generate()

deps = CMakeDeps(self)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index dbd00b7..33b9d4f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -6,7 +6,7 @@ project(ryml
LANGUAGES CXX)
include(./compat.cmake)

-c4_project(VERSION 0.6.0 STANDALONE
+c4_project(VERSION 0.6.0
AUTHOR "Joao Paulo Magalhaes <dev@jpmag.me>")


@@ -27,10 +27,7 @@ option(RYML_INSTALL "Enable install target" ON)

#-------------------------------------------------------

-c4_require_subproject(c4core INCORPORATE
- SUBDIRECTORY ${RYML_EXT_DIR}/c4core
- OVERRIDE C4CORE_INSTALL ${RYML_INSTALL}
-)
+find_package(c4core REQUIRED CONFIG)

c4_add_library(ryml
SOURCES
@@ -64,8 +61,7 @@ c4_add_library(ryml
INC_DIRS
$<BUILD_INTERFACE:${RYML_SRC_DIR}>
$<INSTALL_INTERFACE:include>
- LIBS c4core
- INCORPORATE c4core
+ LIBS c4core::c4core
)

if(RYML_WITH_TAB_TOKENS)
@@ -93,7 +89,7 @@ endif()

if(RYML_INSTALL)
c4_install_target(ryml)
- c4_install_exports(DEPENDENCIES c4core)
+# c4_install_exports(DEPENDENCIES c4core)
c4_pack_project()
endif()

2 changes: 2 additions & 0 deletions recipes/rapidyaml/config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
versions:
"0.6.0":
folder: all
"0.5.0":
folder: all
"0.4.1":
Expand Down