use std::move_only_function
C++23 has a replacement for function2 in std::move_only_function.
Leverage that and remove the extra dependency.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: I69fa59627b91fc1f640f7a688926bed7f138ca19
diff --git a/bmc/meson.build b/bmc/meson.build
index 461d03c..3d9e5e6 100644
--- a/bmc/meson.build
+++ b/bmc/meson.build
@@ -1,7 +1,7 @@
bmc_inc = include_directories('.')
common_pre = declare_dependency(
- dependencies: [function2_dep, json_dep],
+ dependencies: [json_dep],
include_directories: [root_inc, bmc_inc])
common_lib = static_library(
diff --git a/meson.build b/meson.build
index 1f31026..c45a49b 100644
--- a/meson.build
+++ b/meson.build
@@ -129,26 +129,6 @@
blobs_dep = dependency('phosphor-ipmi-blobs')
cpp = meson.get_compiler('cpp')
-# Function2 might not have a pkg-config. It is header only so just make
-# sure we can access the needed symbols from the header.
-function2_dep = dependency('function2', required: false)
-has_function2 = cpp.has_header_symbol(
- 'function2/function2.hpp',
- 'fu2::unique_function',
- dependencies: function2_dep,
- required: false)
-if not has_function2
- function2_opts = import('cmake').subproject_options()
- function2_opts.add_cmake_defines({'BUILD_TESTING': 'OFF'})
- function2_proj = import('cmake').subproject(
- 'function2',
- options: function2_opts,
- required: false)
- assert(function2_proj.found(), 'function2 is required')
- if function2_proj.found()
- function2_dep = function2_proj.dependency('function2')
- endif
-endif
if cpp.has_header('nlohmann/json.hpp')
json_dep = declare_dependency()
diff --git a/status.hpp b/status.hpp
index e3342d2..821d09c 100644
--- a/status.hpp
+++ b/status.hpp
@@ -1,8 +1,7 @@
#pragma once
-#include <function2/function2.hpp>
-
#include <cstdint>
+#include <functional>
namespace ipmi_flash
{
@@ -19,7 +18,7 @@
class TriggerableActionInterface
{
public:
- using Callback = fu2::unique_function<void(TriggerableActionInterface&)>;
+ using Callback = std::move_only_function<void(TriggerableActionInterface&)>;
virtual ~TriggerableActionInterface() = default;
diff --git a/subprojects/function2.wrap b/subprojects/function2.wrap
deleted file mode 100644
index 3e495a8..0000000
--- a/subprojects/function2.wrap
+++ /dev/null
@@ -1,3 +0,0 @@
-[wrap-git]
-url = https://github.com/Naios/function2
-revision = HEAD
diff --git a/tools/meson.build b/tools/meson.build
index 58fff65..826d04c 100644
--- a/tools/meson.build
+++ b/tools/meson.build
@@ -5,8 +5,7 @@
dependency('pciaccess', fallback: ['pciaccess', 'dep_pciaccess']),
dependency('stdplus', fallback: ['stdplus', 'stdplus_dep']),
blobs_dep,
- sys_dep,
- function2_dep]
+ sys_dep]
updater_lib = static_library(
'updater_lib',