facebook / facebook/folly

CMake fails to detect weak symbol support on Mac OS X

Open
#1,060 4 comments 1 reaction 0 assignees View on GitHub
Dominant language
C++
Stars
30.5k
Forks
5.9k
PR merge metrics
No merged PRs in 30d

Description

During the CMake `configure` step, on Mac OS X 10.14, weak symbol support is not found:

```
-- Performing Test FOLLY_HAVE_WEAK_SYMBOLS
-- Performing Test FOLLY_HAVE_WEAK_SYMBOLS - Failed
```

The detection at https://github.com/facebook/folly/blob/master/CMake/FollyConfigChecks.cmake#L112 doesn't quite work for Mac OS X, using Clang 7.0.1 or AppleClang. Changing `weak` to `weak_import` as suggested by [Apple's docs](https://developer.apple.com/library/archive/documentation/MacOSX/Conceptual/BPFrameworks/Concepts/WeakLinking.html#//apple_ref/doc/uid/20002378-106633) still fails.

Original CMake forum post when Folly got ported from Autotools to CMake to support this functionality: http://cmake.3232098.n2.nabble.com/detecting-attribute-weak-support-td7589507.html

CC: @calebmarchent

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.