This is an archive of the discontinued LLVM Phabricator instance.

[CMake] Do not append -lm to CMAKE_REQUIRED_LIBRARIES on Apple
ClosedPublic

Authored by ldionne on Jun 5 2020, 8:14 AM.

Details

Summary

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.

Diff Detail

Event Timeline

ldionne created this revision.Jun 5 2020, 8:14 AM
smeenai accepted this revision.Jun 5 2020, 9:44 AM

LGTM

This revision is now accepted and ready to land.Jun 5 2020, 9:44 AM
This revision was automatically updated to reflect the committed changes.