[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
This commit is contained in:
Louis Dionne 2020-06-05 11:12:47 -04:00
parent 11d06b9511
commit f57dd41562
1 changed files with 1 additions and 1 deletions

View File

@ -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()