diff options
author | Thomas White <taw@physics.org> | 2021-04-23 18:05:22 +0200 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2021-04-23 18:05:22 +0200 |
commit | 7d3a20f3d5209297575189839c7bf1ac64ceb96a (patch) | |
tree | f96b12447b4936d34c713a7f52413a1e2e5fbb99 | |
parent | a378be62b61d4c8a67c5523955babbd3f9d17b5c (diff) |
Fix build without MsgPack
-rw-r--r-- | libcrystfel/CMakeLists.txt | 7 | ||||
-rw-r--r-- | libcrystfel/meson.build | 5 | ||||
-rw-r--r-- | libcrystfel/src/image-msgpack.c | 29 |
3 files changed, 18 insertions, 23 deletions
diff --git a/libcrystfel/CMakeLists.txt b/libcrystfel/CMakeLists.txt index 7bf301f0..26ac2302 100644 --- a/libcrystfel/CMakeLists.txt +++ b/libcrystfel/CMakeLists.txt @@ -7,6 +7,7 @@ pkg_check_modules(FDIP fdip) find_package(ZLIB REQUIRED) find_package(FLEX REQUIRED) find_package(BISON REQUIRED) +pkg_check_modules(MSGPACK msgpack) find_package(Doxygen) pkg_check_modules(FFTW fftw3) pkg_check_modules(LIBCCP4 libccp4c) @@ -18,6 +19,7 @@ set(HAVE_FFTW ${FFTW_FOUND}) set(HAVE_XGANDALF ${XGANDALF_FOUND}) set(HAVE_PINKINDEXER ${PINKINDEXER_FOUND}) set(HAVE_FDIP ${FDIP_FOUND}) +set(HAVE_MSGPACK ${MSGPACK_FOUND}) set(HAVE_LIBCCP4 ${LIBCCP4_FOUND}) # Recent enough version of zlib? @@ -61,6 +63,7 @@ set(LIBCRYSTFEL_SOURCES src/image-cbf.c src/image-hdf5.c src/fom.c + src/image-msgpack.c ${BISON_symopp_OUTPUTS} ${FLEX_symopl_OUTPUTS} src/indexers/dirax.c @@ -103,10 +106,6 @@ set(LIBCRYSTFEL_HEADERS src/fom.h ) -if (MSGPACK_FOUND) - set(LIBCRYSTFEL_SOURCES ${LIBCRYSTFEL_SOURCES} src/image-msgpack.c) -endif (MSGPACK_FOUND) - if (DOXYGEN_FOUND) configure_file(${PROJECT_SOURCE_DIR}/doc/index.md index.md) set(DOXYGEN_SHOW_INCLUDE_FILES NO) diff --git a/libcrystfel/meson.build b/libcrystfel/meson.build index 09640f9d..3ee9d495 100644 --- a/libcrystfel/meson.build +++ b/libcrystfel/meson.build @@ -107,6 +107,7 @@ libcrystfel_sources = ['src/image.c', 'src/fom.c', 'src/image-cbf.c', 'src/image-hdf5.c', + 'src/image-msgpack.c', 'src/indexers/dirax.c', 'src/indexers/felix.c', 'src/indexers/mosflm.c', @@ -120,10 +121,6 @@ libcrystfel_sources = ['src/image.c', symop_parse_ch, ] -if msgpackdep.found() - libcrystfel_sources += 'src/image-msgpack.c' -endif - configure_file(input : 'config.h.in', output : 'config.h', configuration : conf_data) diff --git a/libcrystfel/src/image-msgpack.c b/libcrystfel/src/image-msgpack.c index 19b0b120..2f7b4575 100644 --- a/libcrystfel/src/image-msgpack.c +++ b/libcrystfel/src/image-msgpack.c @@ -37,18 +37,17 @@ #include <stdint.h> #include <assert.h> #include <unistd.h> -#include <zmq.h> -#include <msgpack.h> #include <image.h> #include <utils.h> -#include <msgpack.h> #include "datatemplate_priv.h" #if defined(HAVE_MSGPACK) +#include <msgpack.h> + static msgpack_object *find_main_object(msgpack_unpacked *unpacked) { int n_obj; @@ -448,28 +447,28 @@ int image_msgpack_read(struct image *image, #else /* defined(HAVE_MSGPACK) */ -static UNUSED int image_msgpack_read(struct image *image, - const DataTemplate *dtempl, - void *data, - size_t data_size) +int image_msgpack_read(struct image *image, + const DataTemplate *dtempl, + void *data, + size_t data_size) { ERROR("MessagePack is not supported in this installation (read).\n"); return 1; } -static UNUSED ImageFeatureList *image_msgpack_read_peaks(const DataTemplate *dtempl, - void *data_block, - size_t data_block_size, - int half_pixel_shift) +ImageFeatureList *image_msgpack_read_peaks(const DataTemplate *dtempl, + void *data_block, + size_t data_block_size, + int half_pixel_shift) { ERROR("MessagePack is not supported in this installation (read_peaks).\n"); return NULL; } -static UNUSED double image_msgpack_get_value(const char *name, - void *data_block, - size_t data_block_size, - char *ptype) +double image_msgpack_get_value(const char *name, + void *data_block, + size_t data_block_size, + char *ptype) { ERROR("MessagePack is not supported in this installation (get_value).\n"); *ptype = 'f'; |