Move to subproject to enable both projects
Yocto builds need each component to build individually, but meson wants
them to build as a single project. This follows google-misc and moves
to subprojects.
It also enables callback-manager in the build and fixes some build
errors and warnings.
Change-Id: Ie56141bf86b6d9c6b27eb697944fbc392e374c22
Signed-off-by: Jason M. Bills <jason.m.bills@linux.intel.com>
diff --git a/subprojects/callback-manager/meson.build b/subprojects/callback-manager/meson.build
new file mode 100644
index 0000000..78bd22b
--- /dev/null
+++ b/subprojects/callback-manager/meson.build
@@ -0,0 +1,66 @@
+project(
+ 'callback-manager',
+ 'cpp',
+ version: '1.1.1',
+ meson_version: '>=1.1.1',
+ default_options: ['cpp_std=c++23'],
+)
+
+# Compiler flags
+cpp_args = [
+ '-Werror',
+ '-Wall',
+ '-Wextra',
+ '-Wshadow',
+ '-Wnon-virtual-dtor',
+ '-Wold-style-cast',
+ '-Wcast-align',
+ '-Wunused',
+ '-Woverloaded-virtual',
+ '-Wpedantic',
+ '-Wconversion',
+ '-Wmisleading-indentation',
+ '-Wduplicated-cond',
+ '-Wduplicated-branches',
+ '-Wlogical-op',
+ '-Wnull-dereference',
+ '-Wuseless-cast',
+ '-Wdouble-promotion',
+ '-Wformat=2',
+ '-fno-rtti',
+]
+
+# Definitions
+add_project_arguments(
+ '-DBOOST_ERROR_CODE_HEADER_ONLY',
+ '-DBOOST_SYSTEM_NO_DEPRECATED',
+ '-DBOOST_ALL_NO_LIB',
+ '-DBOOST_NO_RTTI',
+ '-DBOOST_NO_TYPEID',
+ '-DBOOST_ASIO_DISABLE_THREADS',
+ language: 'cpp',
+)
+
+# Include directories
+inc = include_directories('include')
+
+boost = dependency('boost', version: '1.86.0', required: false)
+sdbusplus = dependency('sdbusplus', required: true)
+
+executable(
+ 'callback-manager',
+ 'src/callback_manager.cpp',
+ include_directories: inc,
+ cpp_args: cpp_args,
+ dependencies: [boost, sdbusplus],
+)
+
+# Systemd service files
+systemd_system_unit_dir = dependency('systemd').get_variable(
+ 'systemdsystemunitdir',
+)
+
+install_data(
+ 'service_files/callback-manager.service',
+ install_dir: systemd_system_unit_dir,
+)