Skip to content

Commit

Permalink
Split boost shims into library and header only versions
Browse files Browse the repository at this point in the history
Summary:
Some boost libraries have no libs to link against, and are header
only. In this case, we don't want to add the linker flags.

I audited the boost code, identified all these libraries as being affected, and
split them, sorting the entries at the same time.

Reviewed By: bigfootjon

Differential Revision: D62516927

fbshipit-source-id: e8b941de34372a2df348919a84a764f93641c3b4
  • Loading branch information
ckwalsh authored and facebook-github-bot committed Sep 12, 2024
1 parent 57875bf commit c0e691d
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 22 deletions.
37 changes: 15 additions & 22 deletions shim/third-party/boost/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -5,34 +5,27 @@
# License, Version 2.0 found in the LICENSE-APACHE file in the root directory
# of this source tree.

load("@shim//third-party:third_party.bzl", "third_party_library")
load("@shim//third-party/boost:boost.bzl", "boost_libs")
load("@shim//third-party/boost:boost.bzl", "boost_header_only", "boost_libs")

oncall("open_source")

boost_libs([
"container",
"range",
"algorithm",
"regex",
"program_options",
"filesystem",
"multi_index",
"context",
"variant",
"lexical_cast",
"filesystem",
"program_options",
"random",
"sort",
"interprocess",
"regex",
])

# Empty target to satisfy some build rules:
third_party_library(
name = "boost_preprocessor",
homebrew_package_name = "boost",
)

third_party_library(
name = "boost_thread",
homebrew_package_name = "boost",
)
boost_header_only([
"algorithm",
"interprocess",
"lexical_cast",
"multi_index",
"preprocessor",
"range",
"sort",
"thread",
"variant",
])
7 changes: 7 additions & 0 deletions shim/third-party/boost/boost.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,10 @@ def boost_libs(xs):
homebrew_package_name = "boost",
homebrew_linker_flags = ["-lboost_{}".format(x)],
)

def boost_header_only(xs):
for x in xs:
third_party_library(
name = "boost_{}".format(x),
homebrew_package_name = "boost",
)

0 comments on commit c0e691d

Please sign in to comment.