diff options
Diffstat (limited to 'fluent-bit/lib/monkey/deps/flb_libco/CMakeLists.txt')
-rw-r--r-- | fluent-bit/lib/monkey/deps/flb_libco/CMakeLists.txt | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/fluent-bit/lib/monkey/deps/flb_libco/CMakeLists.txt b/fluent-bit/lib/monkey/deps/flb_libco/CMakeLists.txt new file mode 100644 index 000000000..1f0c55395 --- /dev/null +++ b/fluent-bit/lib/monkey/deps/flb_libco/CMakeLists.txt @@ -0,0 +1,28 @@ +set(src + libco.c + ) + +include(CheckSymbolExists) + +# Check for posix_memalign so that Apple Silicon can be supported +check_symbol_exists(posix_memalign "stdlib.h" HAVE_POSIX_MEMALIGN_IN_STDLIB) + +IF(HAVE_POSIX_MEMALIGN_IN_STDLIB) + # We need HAVE_POSIX_MEMALIGN for the ifdefs to use posix_memalign + # We defined HAVE_POSIX_MEMALIGN_IN_STDLIB in order to avoid including in malloc.h + add_definitions(-DHAVE_POSIX_MEMALIGN_IN_STDLIB -DHAVE_POSIX_MEMALIGN) + MESSAGE("Found posix_memalign in stdlib.h -DHAVE_POSIX_MEMALIGN_IN_STDLIB -DHAVE_POSIX_MEMALIGN") +ENDIF(HAVE_POSIX_MEMALIGN_IN_STDLIB) + +# Check for posix_memalign so that FreeBSD can be supported +check_symbol_exists(posix_memalign "malloc_np.h" HAVE_POSIX_MEMALIGN_IN_PTHREAD_NP) + +IF(HAVE_POSIX_MEMALIGN_IN_PTHREAD_NP) + # We need HAVE_POSIX_MEMALIGN for the ifdefs to use posix_memalign + # We defined DHAVE_POSIX_MEMALIGN_IN_PTHREAD_NP in order to include malloc_np.h + add_definitions(-DHAVE_POSIX_MEMALIGN_IN_PTHREAD_NP -DHAVE_POSIX_MEMALIGN) + MESSAGE("Found posix_memalign in malloc_np.h -DHAVE_POSIX_MEMALIGN_IN_PTHREAD_NP -DHAVE_POSIX_MEMALIGN") +ENDIF(HAVE_POSIX_MEMALIGN_IN_PTHREAD_NP) + +add_definitions(-DLIBCO_MP) +add_library(co STATIC ${src}) |