build: add Valgrind detection and include libco
@@ -42,6 +42,7 @@ option(MK_LINUX_TRACE "Enable Lttng support" No)
option(MK_PTHREAD_TLS "Use old Pthread TLS mode" No)
option(MK_SYSTEM_MALLOC "Use system memory allocator" No)
option(MK_MBEDTLS_SHARED "Use mbedtls shared lib" No)
+option(MK_VALGRIND "Enable Valgrind support" No)
# Plugins: what should be build ?, these options
# will be processed later on the plugins/CMakeLists.txt file
@@ -159,6 +160,17 @@ if(HAVE_C_TLS)
MK_DEFINITION(MK_HAVE_C_TLS)
endif()
+# Valgrind support
+check_c_source_compiles("
+ #include <valgrind/valgrind.h>
+ int main() {
+ return 0;
+ }" MK_HAVE_VALGRIND)
+
+if(MK_VALGRIND OR MK_HAVE_VALGRIND)
+ MK_DEFINITION(MK_HAVE_VALGRIND)
+endif()
+
# Use system memory allocator instead of Jemalloc
if(MK_SYSTEM_MALLOC)
MK_DEFINITION(MK_HAVE_MALLOC_LIBC)
@@ -294,6 +306,7 @@ configure_file(
# General Headers
include_directories(./)
include_directories(deps/rbtree)
+include_directories(deps/flb_libco)
include_directories(include)
include_directories(include/monkey/)
@@ -307,6 +320,7 @@ include_directories(include/monkey/)
add_subdirectory(man)
add_subdirectory(deps/rbtree)
+add_subdirectory(deps/flb_libco)
add_subdirectory(mk_core)
add_subdirectory(plugins)
add_subdirectory(mk_server)
