mirror of
https://github.com/facebook/proxygen.git
synced 2025-08-08 18:02:05 +03:00
Add argument to pass extra arguments to boost b2 build tool (#28)
Summary: X-link: https://github.com/facebook/fb303/pull/28 X-link: https://github.com/facebook/fboss/pull/115 X-link: https://github.com/facebook/folly/pull/1736 Pull Request resolved: https://github.com/facebook/proxygen/pull/403 X-link: https://github.com/facebook/fbthrift/pull/488 This adds a way to pass arguments to the `b2` build tool, used by Boost. This is needed in order to link a getdeps built boost into an relocatable `.so`. The motivating use case is that we need to statically link Boost into a native library used by a python wheel, which must be relocatable. This functionality already exists for CMake-based projects. Reviewed By: mackorone Differential Revision: D34796774 fbshipit-source-id: 0d6a9f4703865dc02048b87e77394c44ef646af6
This commit is contained in:
committed by
Facebook GitHub Bot
parent
3d5f4f15ee
commit
e6abe0844b
@@ -595,6 +595,8 @@ class BuildCmd(ProjectCmdBase):
|
||||
else {}
|
||||
)
|
||||
|
||||
extra_b2_args = args.extra_b2_args or []
|
||||
|
||||
if sources_changed or reconfigure or not os.path.exists(built_marker):
|
||||
if os.path.exists(built_marker):
|
||||
os.unlink(built_marker)
|
||||
@@ -620,6 +622,7 @@ class BuildCmd(ProjectCmdBase):
|
||||
loader,
|
||||
final_install_prefix=loader.get_project_install_prefix(m),
|
||||
extra_cmake_defines=extra_cmake_defines,
|
||||
extra_b2_args=extra_b2_args,
|
||||
)
|
||||
builder.build(install_dirs, reconfigure=reconfigure)
|
||||
|
||||
@@ -760,6 +763,15 @@ class BuildCmd(ProjectCmdBase):
|
||||
'e.g: \'{"CMAKE_CXX_FLAGS": "--bla"}\''
|
||||
),
|
||||
)
|
||||
parser.add_argument(
|
||||
"--extra-b2-args",
|
||||
help=(
|
||||
"Repeatable argument that contains extra arguments to pass "
|
||||
"to b2, which compiles boost. "
|
||||
"e.g.: 'cxxflags=-fPIC' 'cflags=-fPIC'"
|
||||
),
|
||||
action="append",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--shared-libs",
|
||||
help="Build shared libraries if possible",
|
||||
|
Reference in New Issue
Block a user