[llvm] f57dd41 - [CMake] Do not append -lm to CMAKE_REQUIRED_LIBRARIES on Apple
Louis Dionne via llvm-commits
llvm-commits at lists.llvm.org
Fri Jun 5 09:45:40 PDT 2020
Author: Louis Dionne
Date: 2020-06-05T12:45:30-04:00
New Revision: f57dd41562340b0d5d9931b3f1becca761a54d26
URL: https://github.com/llvm/llvm-project/commit/f57dd41562340b0d5d9931b3f1becca761a54d26
DIFF: https://github.com/llvm/llvm-project/commit/f57dd41562340b0d5d9931b3f1becca761a54d26.diff
LOG: [CMake] Do not append -lm to CMAKE_REQUIRED_LIBRARIES on Apple
On Apple platforms, linking against libSystem.dylib is sufficient, and
some Apple platforms don't provide libm.dylib. On those platforms, adding
-lm to CMAKE_REQUIRED_LIBRARIES causes all subsequent compile-flag checks
to fail due to the missing library.
Differential Revision: https://reviews.llvm.org/D81265
Added:
Modified:
llvm/cmake/config-ix.cmake
Removed:
################################################################################
diff --git a/llvm/cmake/config-ix.cmake b/llvm/cmake/config-ix.cmake
index 777cfd628a84..90e5d327c757 100644
--- a/llvm/cmake/config-ix.cmake
+++ b/llvm/cmake/config-ix.cmake
@@ -13,7 +13,7 @@ include(CheckCCompilerFlag)
include(CheckCompilerVersion)
include(HandleLLVMStdlib)
-if( UNIX AND NOT (BEOS OR HAIKU) )
+if( UNIX AND NOT (APPLE OR BEOS OR HAIKU) )
# Used by check_symbol_exists:
list(APPEND CMAKE_REQUIRED_LIBRARIES "m")
endif()
More information about the llvm-commits
mailing list