From: Ricardo Simoes <[email protected]>

magic-enum is a header-only C++17 library provides static reflection
for enums, works with any enum type without any macro or boilerplate
code.

Signed-off-by: Ricardo Simoes <[email protected]>
Signed-off-by: Mark Jonas <[email protected]>
---
 .../magic-enum/magic-enum/run-ptest           | 27 ++++++++++++
 .../magic-enum/magic-enum_0.9.5.bb            | 44 +++++++++++++++++++
 2 files changed, 71 insertions(+)
 create mode 100644 meta-oe/recipes-extended/magic-enum/magic-enum/run-ptest
 create mode 100644 meta-oe/recipes-extended/magic-enum/magic-enum_0.9.5.bb

diff --git a/meta-oe/recipes-extended/magic-enum/magic-enum/run-ptest 
b/meta-oe/recipes-extended/magic-enum/magic-enum/run-ptest
new file mode 100644
index 000000000..865da9f69
--- /dev/null
+++ b/meta-oe/recipes-extended/magic-enum/magic-enum/run-ptest
@@ -0,0 +1,27 @@
+#!/bin/sh
+
+# SPDX-FileCopyrightText: 2024 Bosch Sicherheitssysteme GmbH
+#
+# SPDX-License-Identifier: MIT
+
+fail_count=0
+all_count=0
+
+for test_suite in tests/test_*
+do
+    if "./$test_suite"
+    then
+        echo "PASS: $test_suite"
+    else
+        echo "FAIL: $test_suite"
+        fail_count=$((fail_count + 1))
+    fi
+    all_count=$((all_count + 1))
+done
+
+if [ $fail_count -eq 0 ]
+then
+    echo "PASS: All $all_count tests passed"
+else
+    echo "FAIL: $fail_count of $all_count tests failed"
+fi
diff --git a/meta-oe/recipes-extended/magic-enum/magic-enum_0.9.5.bb 
b/meta-oe/recipes-extended/magic-enum/magic-enum_0.9.5.bb
new file mode 100644
index 000000000..096f869c3
--- /dev/null
+++ b/meta-oe/recipes-extended/magic-enum/magic-enum_0.9.5.bb
@@ -0,0 +1,44 @@
+# SPDX-FileCopyrightText: 2024 Bosch Sicherheitssysteme GmbH
+#
+# SPDX-License-Identifier: MIT
+
+SUMMARY = "Static reflection for enums"
+DESCRIPTION = "Header-only C++17 library provides static reflection for enums, 
works \
+with any enum type without any macro or boilerplate code."
+BUGTRACKER = "https://github.com/Neargye/magic_enum/issues";
+HOMEPAGE = "https://github.com/Neargye/magic_enum";
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=b15f48588464ec8ef87d2b560aad2caa"
+
+SRC_URI = " \
+    git://github.com/Neargye/magic_enum.git;protocol=https;branch=master \
+    file://run-ptest \
+"
+
+SRCREV = "e55b9b54d5cf61f8e117cafb17846d7d742dd3b4"
+S = "${WORKDIR}/git"
+
+inherit cmake ptest
+
+EXTRA_OECMAKE = "\
+    -DMAGIC_ENUM_OPT_BUILD_EXAMPLES=OFF \
+"
+
+do_install_ptest () {
+    install -d ${D}${PTEST_PATH}/tests
+    install -m 0755 ${B}/test/test_* ${D}${PTEST_PATH}/tests
+}
+
+# Add catkin and colcon (ROS build system) support
+FILES:${PN}-dev += "\
+    ${datadir}/magic_enum/package.xml \
+"
+
+# Header-only library
+# ${PN} is empty so we need to tweak -dev and -dbg package dependencies
+RDEPENDS:${PN}-dev = ""
+RDEPENDS:${PN}-ptest = ""
+RRECOMMENDS:${PN}-dbg = "${PN}-dev (= ${EXTENDPKGV})"
+
+BBCLASSEXTEND = "native nativesdk"
-- 
2.34.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#110963): 
https://lists.openembedded.org/g/openembedded-devel/message/110963
Mute This Topic: https://lists.openembedded.org/mt/106757432/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to