build: Generate libmctp-sizes.h
This can be used to allocate static storage for a struct mctp used with
heapless mctp_setup().
core.c internal data structures are moved to core-internal.h so that
sizeof(struct mctp) can be compiled without linking other objects.
Change-Id: I72dcd46ef11d6f4b4f5ba1c9ae6c95e40dda40f8
Signed-off-by: Matt Johnston <matt@codeconstruct.com.au>
diff --git a/meson.build b/meson.build
index ab16cab..aa11c32 100644
--- a/meson.build
+++ b/meson.build
@@ -156,6 +156,17 @@
link_with: libmctp,
)
+sizeof_mctp = compiler.sizeof('struct mctp',
+ include_directories: libmctp_include_dir,
+ prefix: '#include "core-internal.h"')
+sizes_h = configure_file(configuration: {
+ 'sizeof_struct_mctp': sizeof_mctp,
+ },
+ input: 'libmctp-sizes.h.in',
+ output: 'libmctp-sizes.h',
+ )
+install_headers(sizes_h)
+
if feat_fileio.allowed()
subdir('utils')
endif