[cmake] Move check for libproc to config-ix.cmake
As suggested by Nico in https://reviews.llvm.org/D96049, move check for libproc
from CMakeLists to config-ix.cmake
Reviewed By: thakis
Differential Revision: https://reviews.llvm.org/D96713
Note: Also removes the CMAKE_REQUIRED_LIBRARIES which doesn't appear to
be necessary.
GitOrigin-RevId: 55d8f0d03b31e1a85b40eb95705ec4c220d80fd4
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5d705b1..f5298de 100644
--- a/CMakeLists.txt
+++ b/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)
diff --git a/cmake/config-ix.cmake b/cmake/config-ix.cmake
index cf593c9..7473599 100644
--- a/cmake/config-ix.cmake
+++ b/cmake/config-ix.cmake
@@ -352,6 +352,8 @@
unset(HAVE_FFI_CALL CACHE)
endif( LLVM_ENABLE_FFI )
+check_symbol_exists(proc_pid_rusage "libproc.h" HAVE_PROC_PID_RUSAGE)
+
# Whether we can use std::is_trivially_copyable to verify llvm::is_trivially_copyable.
CHECK_CXX_SOURCE_COMPILES("
#include <type_traits>