You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

75 lines
2.1 KiB

--- /dev/null
+++ b/cmake/FindAtomic.cmake
@@ -0,0 +1,11 @@
+find_library(ATOMIC_LIBRARIES NAMES atomic
+ HINTS ${ATOMIC_LIBRARIES_DIR_HINT})
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(Atomic DEFAULT_MSG ATOMIC_LIBRARIES)
+
+mark_as_advanced(ATOMIC_LIBRARIES)
+
+if (ATOMIC_LIBRARIES)
+ set(HAVE_ATOMIC "1")
+endif()
--- a/cmake/include_libraries.cmake
+++ b/cmake/include_libraries.cmake
@@ -15,6 +15,7 @@ if (ENABLE_UNIT_TESTS)
endif (ENABLE_UNIT_TESTS)
# optional libraries
+find_package(Atomic QUIET)
find_package(LibLZMA QUIET)
find_package(Asciidoc QUIET)
find_package(DBLATEX QUIET)
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -116,6 +116,14 @@ else ()
DAQ Modules: Dynamic")
endif ()
+if (HAVE_ATOMIC)
+ message("\
+ libatomic: ON")
+else ()
+ message("\
+ libatomic: OFF")
+endif ()
+
if (HAVE_FLATBUFFERS)
message("\
Flatbuffers: ON")
--- a/configure_cmake.sh
+++ b/configure_cmake.sh
@@ -108,6 +108,8 @@ Optional Packages:
libhs include directory
--with-hyperscan-libraries=DIR
libhs library directory
+ --with-atomic-libraries=DIR
+ atomic library directory
--with-flatbuffers-includes=DIR
flatbuffers include directory
--with-flatbuffers-libraries=DIR
@@ -447,6 +449,9 @@ while [ $# -ne 0 ]; do
--with-hyperscan-libraries=*)
append_cache_entry HS_LIBRARIES_DIR PATH $optarg
;;
+ --with-atomic-libraries=*)
+ append_cache_entry ATOMIC_LIBRARIES_DIR_HINT PATH $optarg
+ ;;
--with-flatbuffers-includes=*)
append_cache_entry FLATBUFFERS_INCLUDE_DIR_HINT PATH $optarg
;;
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -25,6 +25,10 @@ set(EXTERNAL_INCLUDES
${ZLIB_INCLUDE_DIRS}
)
+if ( HAVE_ATOMIC )
+ LIST(APPEND EXTERNAL_LIBRARIES ${ATOMIC_LIBRARIES})
+endif()
+
if ( ENABLE_STATIC_DAQ )
LIST(APPEND EXTERNAL_LIBRARIES ${DAQ_STATIC_MODULE_LIBS})
endif ()