diff --git a/iio-config.h.cmakein b/iio-config.h.cmakein index 39a9c73bc..781bfb6cc 100644 --- a/iio-config.h.cmakein +++ b/iio-config.h.cmakein @@ -17,9 +17,9 @@ #cmakedefine01 WITH_NETWORK_EVENTFD #cmakedefine01 WITH_IIOD_USBD #cmakedefine01 WITH_LOCAL_CONFIG +#cmakedefine01 WITH_AIO #cmakedefine01 HAVE_DNS_SD #cmakedefine01 HAVE_AVAHI -#cmakedefine01 ENABLE_AIO #cmakedefine01 WITH_ZSTD #cmakedefine HAS_PIPE2 diff --git a/iiod/CMakeLists.txt b/iiod/CMakeLists.txt index 22b699d5e..49049b488 100644 --- a/iiod/CMakeLists.txt +++ b/iiod/CMakeLists.txt @@ -24,7 +24,7 @@ find_library(LIBAIO_LIBRARIES aio) find_path(LIBAIO_INCLUDE_DIR libaio.h) if (LIBAIO_LIBRARIES AND LIBAIO_INCLUDE_DIR) - option(ENABLE_AIO "Build IIOD with async. I/O support" ON) + option(WITH_AIO "Build IIOD with async. I/O support" ON) endif () include(CheckTypeSize) @@ -33,12 +33,12 @@ check_type_size("struct usb_functionfs_descs_head_v2" FUNCTIONFS_V2) set(CMAKE_EXTRA_INCLUDE_FILES) if (HAVE_FUNCTIONFS_V2) - OPTION(WITH_IIOD_USBD "Add support for USB through FunctionFS within IIOD" ${ENABLE_AIO}) + OPTION(WITH_IIOD_USBD "Add support for USB through FunctionFS within IIOD" ${WITH_AIO}) if (WITH_IIOD_USBD) - if (NOT ENABLE_AIO) + if (NOT WITH_AIO) message(SEND_ERROR "USB support in IIOD requires async. I/O support") - endif (NOT ENABLE_AIO) + endif (NOT WITH_AIO) set(IIOD_CFILES ${IIOD_CFILES} usbd.c) endif (WITH_IIOD_USBD) @@ -52,8 +52,7 @@ set_target_properties(iiod PROPERTIES ) target_link_libraries(iiod iio ${PTHREAD_LIBRARIES} ${AVAHI_LIBRARIES}) -if (ENABLE_AIO) - add_definitions(-DWITH_AIO=1) +if (WITH_AIO) include_directories(${LIBAIO_INCLUDE_DIR}) target_link_libraries(iiod ${LIBAIO_LIBRARIES}) endif () diff --git a/iiod/iiod.c b/iiod/iiod.c index b4dc3d889..178558b90 100644 --- a/iiod/iiod.c +++ b/iiod/iiod.c @@ -373,7 +373,7 @@ int main(int argc, char **argv) interactive = true; break; case 'a': - if (!ENABLE_AIO) { + if (!WITH_AIO) { IIO_ERROR("IIOD was not compiled with AIO support.\n"); return EXIT_FAILURE; }