summaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorSaya Sugiura <ssugiura@jp.adit-jv.com>2020-02-11 10:24:39 +0900
committerSaya Sugiura <39760799+ssugiura@users.noreply.github.com>2020-07-06 10:04:07 +0900
commit404bc3934bcb0bbb5671a84ecb45c95069bc1ab3 (patch)
treefb419eea29e1d8dc99dfdf7f5e6762aaf1934e01 /cmake
parent3dca373d843213f03c95df56e36b16d6b83fd58f (diff)
downloadDLT-daemon-404bc3934bcb0bbb5671a84ecb45c95069bc1ab3.tar.gz
network trace: Add mqueue verification
There is some OS (e.g. Android) which doesn't support message queue. Since network trace uses it as IPC, we need to disable it if following calls are not available: mq_open, mq_close, mq_unlink, mq_send, mq_receive Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com> Signed-off-by: KHANH LUONG HONG DUY <khanh.luonghongduy@vn.bosch.com>
Diffstat (limited to 'cmake')
-rw-r--r--cmake/CMakeLists.txt18
1 files changed, 18 insertions, 0 deletions
diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt
index d1a9a10..46b67e4 100644
--- a/cmake/CMakeLists.txt
+++ b/cmake/CMakeLists.txt
@@ -52,6 +52,7 @@ CHECK_INCLUDE_FILES( linux/stat.h HAVE_LINUXSTAT_H)
CHECK_INCLUDE_FILES( sys/uio.h HAVE_SYSUIO_H)
CHECK_INCLUDE_FILES( termios.h HAVE_TERMIOS_H)
CHECK_INCLUDE_FILES( unistd.h HAVE_UNISTD_H)
+CHECK_INCLUDE_FILES( mqueue.h HAVE_MQUEUE_H)
INCLUDE(CheckFunctionExists)
@@ -72,6 +73,23 @@ CHECK_FUNCTION_EXISTS( strerror HAVE_FUNC_STRERROR)
CHECK_FUNCTION_EXISTS( strstr HAVE_FUNC_STRSTR)
CHECK_FUNCTION_EXISTS( strtol HAVE_FUNC_STRTOL)
+# Message queue
+find_library(RT_LIBRARY rt)
+if(RT_LIBRARY)
+ include(CheckLibraryExists)
+ CHECK_LIBRARY_EXISTS( ${RT_LIBRARY} mq_open mqueue.h HAVE_FUNC_MQOPEN)
+ CHECK_LIBRARY_EXISTS( ${RT_LIBRARY} mq_close mqueue.h HAVE_FUNC_MQCLOSE)
+ CHECK_LIBRARY_EXISTS( ${RT_LIBRARY} mq_unlink mqueue.h HAVE_FUNC_MQUNLINK)
+ CHECK_LIBRARY_EXISTS( ${RT_LIBRARY} mq_send mqueue.h HAVE_FUNC_MQSEND)
+ CHECK_LIBRARY_EXISTS( ${RT_LIBRARY} mq_receive mqueue.h HAVE_FUNC_MQRECEIVE)
+else()
+ CHECK_FUNCTION_EXISTS( mq_open HAVE_FUNC_MQOPEN)
+ CHECK_FUNCTION_EXISTS( mq_close HAVE_FUNC_MQCLOSE)
+ CHECK_FUNCTION_EXISTS( mq_unlink HAVE_FUNC_MQUNLINK)
+ CHECK_FUNCTION_EXISTS( mq_send HAVE_FUNC_MQSEND)
+ CHECK_FUNCTION_EXISTS( mq_receive HAVE_FUNC_MQRECEIVE)
+endif()
+
if(WITH_CHECK_CONFIG_FILE)
configure_file(${PROJECT_SOURCE_DIR}/cmake/config.h.cmake ${PROJECT_BINARY_DIR}/include/dlt/config.h)
endif(WITH_CHECK_CONFIG_FILE)