summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorChris Packham <judge.packham@gmail.com>2015-10-26 20:25:32 +1300
committerChris Packham <judge.packham@gmail.com>2015-10-26 20:25:59 +1300
commitd3ee55fe1b6d09795c419f12a3ad6f7d0b5df6b4 (patch)
tree8dccdb7cf77b4d8abfa3ec23f053c064a6f7ca74 /CMakeLists.txt
parent937c10bbe64a36579bc8bafcd29554e786143c86 (diff)
downloadrabbitmq-c-d3ee55fe1b6d09795c419f12a3ad6f7d0b5df6b4.tar.gz
build: Add check for posix_spawn functions
These are usually found in librt. On some systems clock_gettime is also in librt so checking for it was implicitly satisfying the requirement for the posix_spawn functions. On newer systems (glibc >2.17 for example) clock_gettime is also found in libc so AC_SEARCH_LIBS() decides that it is not necessary to add -lrt to LIBS. Add an explicit check for posix_spawnp() to decide if -lrt is necessary.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt3
1 files changed, 2 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 899d142..179630e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -144,7 +144,8 @@ endif()
cmake_pop_check_state()
check_library_exists(rt clock_gettime "time.h" CLOCK_GETTIME_NEEDS_LIBRT)
-if (CLOCK_GETTIME_NEEDS_LIBRT)
+check_library_exists(rt posix_spawnp "spawn.h" POSIX_SPAWNP_NEEDS_LIBRT)
+if (CLOCK_GETTIME_NEEDS_LIBRT OR POSIX_SPAWNP_NEEDS_LIBRT)
set(LIBRT rt)
endif()