From 894138366ab47070cd4b6d00938e86cef6aefb99 Mon Sep 17 00:00:00 2001 From: Cullen Walsh Date: Wed, 11 Sep 2024 18:01:30 -0700 Subject: [PATCH] Split boost shims into library and header only versions 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 --- shim/third-party/boost/BUCK | 37 +++++++++++++------------------- shim/third-party/boost/boost.bzl | 7 ++++++ 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/shim/third-party/boost/BUCK b/shim/third-party/boost/BUCK index c2033cba357..08a698b3811 100644 --- a/shim/third-party/boost/BUCK +++ b/shim/third-party/boost/BUCK @@ -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", +]) diff --git a/shim/third-party/boost/boost.bzl b/shim/third-party/boost/boost.bzl index 51a8aef411f..8a6d1935940 100644 --- a/shim/third-party/boost/boost.bzl +++ b/shim/third-party/boost/boost.bzl @@ -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", + )