-
Notifications
You must be signed in to change notification settings - Fork 312
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CMake scripts cleanups #680
Changes from 1 commit
826e451
70c4e0e
adf33f2
57db981
e8b3574
9c87375
ff96fc8
c31cc2f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does this mean that we only provide the option if the libraries are installed in the system? If so, I'm not sure if it would not be better to always provide the option and look for the libraries if the option is enabled. Then make it explicit that dependencies are needed (cmake failure)... Otherwise, users might not even be aware that this feature is possible... |
||
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 () | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a comment which has noting to do with this... We should definitely consider about replacing aio for io_uring and liburing for libiio2 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I will definitely have a look at io_uring. I want to see if it can help us with zero-copy.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It has both ring buffers shared between kernel and userspace so that's something already in the right way... Another neat thing is that we can potential reduce a lot the number of syscalls.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But I assume the IIO subsystem needs to support it (does it?).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't think so. At least for normal reads/writes on sysfs stuff. Now for ioctl (not sure if that stuff was merged; and yes, it seems io_uring is also allowing to re-implement ioctl), the last time I checked I think IIO would have to support it...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://lwn.net/Articles/844875/ - not idea the outcome of the RFC