You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add CMake option to prefer static deps rather than dynamic deps
Summary:
We would like to build a version of torchcomms that has minimal dependencies on dynamic libraries. I saw that there is an option `USE_STATIC_DEPS_ON_UNIX` introduced in D17228181. However, currently when we enable `USE_STATIC_DEPS_ON_UNIX=ON` to build folly, it will fail by
```
-- Could NOT find LIBUNWIND (missing: LIBUNWIND_LIBRARY)
CMake Error at build/fbcode_builder/CMake/FindLibEvent.cmake:68 (message):
Could NOT find libevent.
Call Stack (most recent call first):
CMake/folly-deps.cmake:73 (find_package)
CMakeLists.txt:145 (include)
-- Configuring incomplete, errors occurred!
```
That is because we only set ".a" to `CMAKE_FIND_LIBRARY_SUFFIXES` and there exists a special library libunwind that does not provide static linking library.
To set `CMAKE_FIND_LIBRARY_SUFFIXES = ".a" ".so"`, we can let cmake first look for `libname.a` and then `libname.so` if `.a` is not found.
Reviewed By: d4l3k
Differential Revision: D81062853
fbshipit-source-id: ce901b03473c82032c75742302ee3ed875d6af49
0 commit comments