[llvm] 55d8f0d - [cmake] Move check for libproc to config-ix.cmake

Raphael Isemann via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 18 01:55:17 PST 2021


Author: Alex Hoppen
Date: 2021-02-18T10:54:27+01:00
New Revision: 55d8f0d03b31e1a85b40eb95705ec4c220d80fd4

URL: https://github.com/llvm/llvm-project/commit/55d8f0d03b31e1a85b40eb95705ec4c220d80fd4
DIFF: https://github.com/llvm/llvm-project/commit/55d8f0d03b31e1a85b40eb95705ec4c220d80fd4.diff

LOG: [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.

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/llvm/CMakeLists.txt b/llvm/CMakeLists.txt
index 5d705b17f6f1..f5298de9f7ca 100644
--- a/llvm/CMakeLists.txt
+++ b/llvm/CMakeLists.txt
@@ -649,12 +649,6 @@ if (LLVM_BUILD_STATIC)
   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/llvm/cmake/config-ix.cmake b/llvm/cmake/config-ix.cmake
index cf593c9b40aa..7473599f7513 100644
--- a/llvm/cmake/config-ix.cmake
+++ b/llvm/cmake/config-ix.cmake
@@ -352,6 +352,8 @@ else()
   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>


        


More information about the llvm-commits mailing list