[PATCH] D96713: [cmake] Move check for libproc to config-ix.cmake

Alex Hoppen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 15 07:49:34 PST 2021


ahoppen created this revision.
Herald added a subscriber: mgorny.
ahoppen requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

As suggested by Nico in https://reviews.llvm.org/D96049, move check for libproc from CMakeLists to config-ix.cmake


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D96713

Files:
  llvm/CMakeLists.txt
  llvm/cmake/config-ix.cmake


Index: llvm/cmake/config-ix.cmake
===================================================================
--- llvm/cmake/config-ix.cmake
+++ llvm/cmake/config-ix.cmake
@@ -351,6 +351,11 @@
   unset(HAVE_FFI_CALL CACHE)
 endif( LLVM_ENABLE_FFI )
 
+check_symbol_exists(proc_pid_rusage "libproc.h" HAVE_PROC_PID_RUSAGE)
+if(HAVE_PROC_PID_RUSAGE)
+  list(APPEND CMAKE_REQUIRED_LIBRARIES proc)
+endif()
+
 # Whether we can use std::is_trivially_copyable to verify llvm::is_trivially_copyable.
 CHECK_CXX_SOURCE_COMPILES("
 #include <type_traits>
Index: llvm/CMakeLists.txt
===================================================================
--- llvm/CMakeLists.txt
+++ llvm/CMakeLists.txt
@@ -649,12 +649,6 @@
   endforeach()
 endif()
 
-include(CheckSymbolExists)
-check_symbol_exists(proc_pid_rusage "libproc.h" HAVE_PROC_PID_RUSAGE)
-if(HAVE_PROC_PID_RUSAGE)
-  list(APPEND CMAKE_REQUIRED_LIBRARIES proc)
-endif()
-
 # Use libtool instead of ar if you are both on an Apple host, and targeting Apple.
 if(CMAKE_HOST_APPLE AND APPLE)
   include(UseLibtool)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D96713.323757.patch
Type: text/x-patch
Size: 1050 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210215/95e10de3/attachment.bin>


More information about the llvm-commits mailing list