From 06db2a1048de1ded0bced96a7059e44ebb3d35ab Mon Sep 17 00:00:00 2001 From: Dean Sellers Date: Mon, 17 Nov 2025 10:24:13 +1100 Subject: [PATCH] zephyr: Add files to support using with zephyr RTOS Files to allow importing and building as a zephyr module. Signed-off-by: Dean Sellers --- zephyr/CMakeLists.txt | 3 +++ zephyr/Kconfig | 7 +++++++ zephyr/README.md | 24 ++++++++++++++++++++++++ zephyr/module.yaml | 3 +++ 4 files changed, 37 insertions(+) create mode 100644 zephyr/CMakeLists.txt create mode 100644 zephyr/Kconfig create mode 100644 zephyr/README.md create mode 100644 zephyr/module.yaml diff --git a/zephyr/CMakeLists.txt b/zephyr/CMakeLists.txt new file mode 100644 index 00000000..1e04516f --- /dev/null +++ b/zephyr/CMakeLists.txt @@ -0,0 +1,3 @@ +if (CONFIG_LIB_BOOST_SML) + zephyr_include_directories(../include) +endif() diff --git a/zephyr/Kconfig b/zephyr/Kconfig new file mode 100644 index 00000000..046f9b36 --- /dev/null +++ b/zephyr/Kconfig @@ -0,0 +1,7 @@ +config LIB_BOOST_SML + bool "Enable use of the boost::sml C++ state machine library" + default n + depends on CPP && !STD_CPP98 && !STD_CPP11 && !STD_CPP14 + help + Include the boost::sml state machine language library, + see https://github.com/boost-ext/sml. diff --git a/zephyr/README.md b/zephyr/README.md new file mode 100644 index 00000000..1a21e494 --- /dev/null +++ b/zephyr/README.md @@ -0,0 +1,24 @@ +# Support for using the boost::sml as a [Zephyr](https://docs.zephyrproject.org/latest/index.html) module + +To use add the reposiory path to your west maifest file, probably `west.yml`. See the zephyr documentation on [project manifests](https://docs.zephyrproject.org/latest/develop/west/manifest.html#projects) for details. + + +``` yaml + projects: + - name: boost-sml + url: http://your.git.server/sml + revision: tag|branch|sha +``` + +Then run `west update` to pull in the code. You need to then add the following config options to `prj.conf` or whereever you manage your configuration. + +``` +CONFIG_CPP=y +CONFIG_STD_CPP17=y +CONFIG_REQUIRES_FULL_LIBCPP=y + +# Include boost sml state machine +CONFIG_LIB_BOOST_SML=y +``` + +Then you can `#include ` to use the library. diff --git a/zephyr/module.yaml b/zephyr/module.yaml new file mode 100644 index 00000000..cbff6a1a --- /dev/null +++ b/zephyr/module.yaml @@ -0,0 +1,3 @@ +build: + cmake: zephyr + kconfig: zephyr/Kconfig