File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -23,6 +23,9 @@ enable_tests=ON
2323[cmake.defines.any(os=windows,test=off)]
2424enable_tests=OFF
2525
26+ [cmake.defines.all(os=linux,feature_shared_libs=on)]
27+ BUILD_SHARED_LIBS=ON
28+
2629# Features. The defaults match the historical full build. Consumers that
2730# only need codegen + (de)serialization pull this dep as
2831# `fbthrift = !rpc, !benchmark` to skip both the RPC link-graph and the
@@ -31,6 +34,7 @@ enable_tests=OFF
3134default = rpc, benchmark
3235rpc =
3336benchmark =
37+ shared_libs =
3438
3539[cmake.defines.feature_rpc=off]
3640THRIFT_RPC=OFF
Original file line number Diff line number Diff line change @@ -9,10 +9,17 @@ sha256 = ea7de4299689e12b6dddd392f9896f08fb0777ac7168897a244a6d6085043fea
99builder = cmake
1010subdir = fmt-12.1.0
1111
12+ [features]
13+ default =
14+ shared_libs =
15+
1216[cmake.defines]
1317FMT_TEST = OFF
1418FMT_DOC = OFF
1519
20+ [cmake.defines.feature_shared_libs=on]
21+ BUILD_SHARED_LIBS = ON
22+
1623[homebrew]
1724fmt
1825
Original file line number Diff line number Diff line change 3535libaio
3636libiberty
3737libunwind
38+ # folly uses OpenSSL on every platform (SSL contexts, hashing, etc.).
39+ # On Linux, openssl's manifest uses builder=nop and resolves via the
40+ # distro's openssl-devel package, so listing it here only causes
41+ # install-system-deps --recursive to pick that package up. Without
42+ # this, downstream consumers that don't otherwise pull in fizz/wangle/
43+ # fbthrift have to discover this transitive system dep themselves.
44+ openssl
3845
3946# xz depends on autoconf which does not build on
4047# Windows
@@ -49,9 +56,16 @@ fbcode/folly = folly
4956^fbcode/folly/folly-config\.h$
5057^fbcode/folly/public_tld/build/facebook_.*
5158
59+ [features]
60+ default =
61+ shared_libs =
62+
5263[cmake.defines]
5364BUILD_SHARED_LIBS=OFF
5465
66+ [cmake.defines.feature_shared_libs=on]
67+ BUILD_SHARED_LIBS=ON
68+
5569[cmake.defines.not(os=windows)]
5670BOOST_LINK_STATIC=ON
5771
Original file line number Diff line number Diff line change @@ -12,7 +12,6 @@ subdir = gflags-2.3.0
1212[cmake.defines]
1313BUILD_SHARED_LIBS = ON
1414BUILD_STATIC_LIBS = ON
15- #BUILD_gflags_nothreads_LIB = OFF
1615BUILD_gflags_LIB = ON
1716
1817[homebrew]
Original file line number Diff line number Diff line change @@ -13,6 +13,12 @@ rev = 3411d58669fe07e70335b252299432a00d1e7c6c
1313
1414[build]
1515builder = cmake
16+ # The patchfile removes glog's unconditional CMAKE_CXX_VISIBILITY_PRESET=hidden
17+ # (cmake_minimum_required(VERSION 3.16) forces CMP0063=NEW, making
18+ # CMAKE_POLICY_DEFAULT_CMP0063=OLD ineffective). Applied unconditionally;
19+ # default-visibility symbols in a static archive are harmless for consumers
20+ # that don't need the shared_libs feature.
21+ patchfile = glog_default_visibility.patch
1622
1723[dependencies]
1824gflags
@@ -35,4 +41,3 @@ libgoogle-glog-dev
3541
3642[rpms.distro=fedora]
3743glog-devel
38-
Original file line number Diff line number Diff line change @@ -17,16 +17,26 @@ builder = cmake
1717[cmake.defines]
1818CMAKE_POSITION_INDEPENDENT_CODE=ON
1919
20+ # Build the example/demo executables only when getdeps is invoked with
21+ # tests enabled (test=on -- the default for `getdeps build` without
22+ # --no-tests). Wheel builds pass --no-tests so the wheel stays
23+ # data-only. CI test jobs get the examples built and link-checked
24+ # automatically without needing to thread EXAMPLES=ON through every
25+ # workflow's --extra-cmake-defines.
26+ [cmake.defines.test=on]
27+ EXAMPLES=ON
28+
2029[dependencies]
2130boost
2231# Rebalancer only uses fbthrift's codegen + (de)serialization. Skip the RPC
2332# transport stack (fizz/wangle/mvfst, none of which it links) and the
24- # benchmark executables.
25- fbthrift = !rpc, !benchmark
26- fmt
27- folly
28- gflags
29- glog
33+ # benchmark executables. shared_libs builds folly/fbthrift/fmt/gflags/glog as
34+ # shared libraries, which avoids duplicate static-initializer crashes and lets
35+ # the wheel bundler (auditwheel/delocate) reason about each dep as a single
36+ # shared object.
37+ fbthrift = !rpc, !benchmark, shared_libs
38+ fmt = shared_libs
39+ folly = shared_libs
3040googletest
3141highs-optimizer
3242xxhash
Original file line number Diff line number Diff line change 1+ diff --git a/CMakeLists.txt b/CMakeLists.txt
2+ --- a/CMakeLists.txt
3+ +++ b/CMakeLists.txt
4+ @@ -61,7 +61,4 @@ endif (NOT WITH_THREADS)
5+
6+ - set (CMAKE_C_VISIBILITY_PRESET hidden)
7+ - set (CMAKE_CXX_VISIBILITY_PRESET hidden)
8+ set (CMAKE_POSITION_INDEPENDENT_CODE ON)
9+ - set (CMAKE_VISIBILITY_INLINES_HIDDEN ON)
10+
11+ set (CMAKE_DEBUG_POSTFIX d)
You can’t perform that action at this time.
0 commit comments