about summary refs log tree commit diff homepage
path: root/tools/klee-replay/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'tools/klee-replay/CMakeLists.txt')
-rw-r--r--tools/klee-replay/CMakeLists.txt16
1 files changed, 5 insertions, 11 deletions
diff --git a/tools/klee-replay/CMakeLists.txt b/tools/klee-replay/CMakeLists.txt
index e0eb8d07..6388df50 100644
--- a/tools/klee-replay/CMakeLists.txt
+++ b/tools/klee-replay/CMakeLists.txt
@@ -6,7 +6,7 @@
 # License. See LICENSE.TXT for details.
 #
 #===------------------------------------------------------------------------===#
-if (HAVE_PTY_H)
+if (HAVE_PTY_H OR HAVE_UTIL_H)
   add_executable(klee-replay
     fd_init.c
     file-creator.c
@@ -15,16 +15,10 @@ if (HAVE_PTY_H)
   )
 
   target_link_libraries(klee-replay PRIVATE kleeBasic ${LIBCAP_LIBRARIES})
-  # FIXME: This isn't quite right. This is actually an implementation detail
-  # of glibc not Linux. Really we need to test if we can use `openpty()`
-  # with/without an additional library.
-  if ("${CMAKE_SYSTEM_NAME}" MATCHES "Linux")
-    if (NOT LIBUTIL_LIBRARIES)
-      message(FATAL_ERROR "klee-replay needs libutil under Linux")
-    endif()
+  if (openpty_in_libutil)
     target_link_libraries(klee-replay PRIVATE ${LIBUTIL_LIBRARIES})
-  endif()
-install(TARGETS klee-replay RUNTIME DESTINATION bin)
+  endif (openpty_in_libutil)
+  install(TARGETS klee-replay RUNTIME DESTINATION bin)
 else()
-  message(WARNING "Not building klee-replay due to missing \"pty.h\" header file")
+  message(WARNING "Not building klee-replay due to missing library for pty functions.")
 endif()