1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00

cmake: fix some #ifdefs

This commit is contained in:
Steffen Vogel 2018-06-25 06:00:34 +02:00
parent f585a94ebf
commit 58a13ae92e
8 changed files with 22 additions and 15 deletions

View file

@ -70,11 +70,18 @@ extern "C"{
#cmakedefine WITH_API
#cmakedefine WITH_HOOKS
#cmakedefine WITH_IO
#cmakedefine WITH_CONFIG
/* OS Headers */
#cmakedefine HAS_EVENTFD
#cmakedefine HAS_SEMAPHORE
#cmakedefine LIBWEBSOCKETS_FOUND
#cmakedefine HDF5_FOUND
#cmakedefine PROTOBUF_FOUND
#cmakedefine LIBNL3_ROUTE_FOUND
#cmakedefine LIBCONFIG_FOUND
#ifdef __cplusplus
}
#endif

View file

@ -40,13 +40,13 @@
#include <villas/config.h>
#include <villas/io.h>
#ifdef WITH_LIBNL_ROUTE_30
#ifdef LIBNL3_ROUTE_FOUND
#include <villas/kernel/if.h>
#include <villas/kernel/nl.h>
#include <villas/kernel/tc.h>
#define WITH_NETEM
#endif /* WITH_LIBNL_ROUTE_30 */
#endif /* LIBNL3_ROUTE_FOUND */
#include <villas/node.h>

View file

@ -26,7 +26,7 @@
#include <villas/config_helper.h>
#include <villas/utils.h>
#ifdef WITH_CONFIG
#ifdef LIBCONFIG_FOUND
static int json_to_config_type(int type)
{
@ -143,7 +143,7 @@ int json_to_config(json_t *json, config_setting_t *parent)
return 0;
}
#endif /* WITH_CONFIG */
#endif /* LIBCONFIG_FOUND */
void json_object_extend_key_value(json_t *obj, const char *key, const char *value)
{

View file

@ -103,7 +103,7 @@ int super_node_parse_uri(struct super_node *sn, const char *uri)
/* Parse config */
sn->cfg = json_loadf(f, 0, &err);
if (sn->cfg == NULL) {
#ifdef WITH_CONFIG
#ifdef LIBCONFIG_FOUND
int ret;
config_t cfg;
@ -150,7 +150,7 @@ int super_node_parse_uri(struct super_node *sn, const char *uri)
config_destroy(&cfg);
#else
jerror(&err, "Failed to parse configuration file");
#endif /* WITH_CONFIG */
#endif /* LIBCONFIG_FOUND */
}
/* Close configuration file */

View file

@ -58,14 +58,14 @@ lws_callback_function websocket_protocol_cb;
.rx_buffer_size = 0
},
#endif /* WITH_API */
#ifdef WITH_NODE_WEBSOCKET
#ifdef LIBWEBSOCKETS_FOUND
{
.name = "live",
.callback = websocket_protocol_cb,
.per_session_data_size = sizeof(struct websocket_connection),
.rx_buffer_size = 0
},
#endif /* WITH_NODE_WEBSOCKET */
#endif /* LIBWEBSOCKETS_FOUND */
#if 0 /* not supported yet */
{
.name = "log",

View file

@ -341,13 +341,13 @@ check: if (optarg == endptr)
if (!node)
error("Node '%s' does not exist!", nodestr);
#ifdef WITH_NODE_WEBSOCKET
#ifdef LIBWEBSOCKETS_FOUND
/* Only start web subsystem if villas-pipe is used with a websocket node */
if (node->_vt->start == websocket_start) {
web_start(&sn.web);
api_start(&sn.api);
}
#endif /* WITH_NODE_WEBSOCKET */
#endif /* LIBWEBSOCKETS_FOUND */
if (reverse)
node_reverse(node);

View file

@ -22,7 +22,7 @@
#include <criterion/criterion.h>
#ifdef WITH_LIBCONFIG
#ifdef LIBCONFIG_FOUND
#include <jansson.h>
#include <libconfig.h>
@ -117,4 +117,4 @@ Test(utils, json_to_config)
json_decref(json);
}
#endif
#endif /* LIBCONFIG_FOUND */

View file

@ -39,10 +39,10 @@
#define NUM_VALUES 10
static char formats[][32] = {
#ifdef WITH_FORMAT_HDF5
#ifdef LIBHDF5_FOUND
"hdf5",
#endif
#ifdef WITH_FORMAT_PROTOBUF
#ifdef LIBPROTOBUF_FOUND
"protobuf",
#endif
"raw.int8",