[PATCH] D81265: [CMake] Do not append -lm to CMAKE_REQUIRED_LIBRARIES on Apple

Louis Dionne via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 5 08:19:05 PDT 2020


ldionne created this revision.
ldionne added a reviewer: smeenai.
Herald added subscribers: llvm-commits, dexonsmith, jkorous, mgorny.
Herald added a project: LLVM.

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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D81265

Files:
  llvm/cmake/config-ix.cmake


Index: llvm/cmake/config-ix.cmake
===================================================================
--- llvm/cmake/config-ix.cmake
+++ llvm/cmake/config-ix.cmake
@@ -13,7 +13,7 @@
 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()


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D81265.268805.patch
Type: text/x-patch
Size: 411 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200605/0b7a5746/attachment.bin>


More information about the llvm-commits mailing list