diff options
author | Suren A. Chilingaryan <csa@dside.dyndns.org> | 2012-12-03 22:09:48 +0100 |
---|---|---|
committer | Suren A. Chilingaryan <csa@dside.dyndns.org> | 2012-12-03 22:09:48 +0100 |
commit | 5ae22aeedb43629fed30f64d025b9df3cf25cff8 (patch) | |
tree | e3068d475d5c9f39f3c4386aa193994dda161123 /CMakeLists.txt | |
parent | 9742a733bb8b06d26c90f2ccb330366d0ab1ae9e (diff) | |
download | fastwriter-5ae22aeedb43629fed30f64d025b9df3cf25cff8.tar.gz fastwriter-5ae22aeedb43629fed30f64d025b9df3cf25cff8.tar.bz2 fastwriter-5ae22aeedb43629fed30f64d025b9df3cf25cff8.tar.xz fastwriter-5ae22aeedb43629fed30f64d025b9df3cf25cff8.zip |
AIO support
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 7a95a93..496864e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,6 +5,7 @@ set(FASTWRITER_ABI_VERSION "0") cmake_minimum_required(VERSION 2.8) +set(DISABLE_AIO TRUE CACHE BOOL "Use kernel AIO writer") set(DISABLE_XFS_REALTIME FALSE CACHE BOOL "Disable support of RealTime XFS partition") @@ -26,7 +27,16 @@ include_directories( add_definitions("-fPIC --std=c99 -Wall -O2 -pthread") set(HEADERS fastwriter.h sysinfo.h default.h private.h) -add_library(fastwriter SHARED fastwriter.c sysinfo.c default.c) +set(SOURCES fastwriter.c sysinfo.c default.c) + +if (NOT DISABLE_AIO) + check_include_files("libaio.h" HAVE_LIBAIO_H) + if (NOT HAVE_LIBAIO_H) + message(FATAL_ERROR "error: libaio.h is not found...") + endif (NOT HAVE_LIBAIO_H) +endif (NOT DISABLE_AIO) + +add_library(fastwriter SHARED ${SOURCES}) set_target_properties(fastwriter PROPERTIES VERSION ${FASTWRITER_VERSION} @@ -34,6 +44,11 @@ set_target_properties(fastwriter PROPERTIES LINK_FLAGS "-pthread" ) +if (NOT DISABLE_AIO) + target_link_libraries(fastwriter aio) +endif (NOT DISABLE_AIO) + + set(TARNAME "fastwriter") set(PACKAGE_VERSION ${FASTWRITER_VERSION}) set(PACKAGE_NAME "${TARNAME}") |