Skip to content

Commit

Permalink
Add cxx_binary support for boilerplate
Browse files Browse the repository at this point in the history
Summary: We need `tperf`, so add it. This is a bit tricky because some of the binaries are truly fbcode-only.

Reviewed By: kvtsoy

Differential Revision: D62874235

fbshipit-source-id: 15b769f9cedfcdd95551b665faa7060756dcb421
  • Loading branch information
mzlee authored and facebook-github-bot committed Sep 17, 2024
1 parent 6ad6133 commit 92eb1bd
Showing 1 changed file with 15 additions and 13 deletions.
28 changes: 15 additions & 13 deletions quic/defs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ def _compute_include_directories():
quic_path = base_path[6:]
return ["/".join(len(quic_path.split("/")) * [".."])]

def _compute_header_namespace():
base_path = native.package_name()
return base_path[6:]

def use_libev():
return read_bool("mvfst", "use_libev", False)

Expand Down Expand Up @@ -160,15 +164,13 @@ def mvfst_cxx_library(
def mvfst_cxx_test(
name,
srcs,
raw_headers = [],
headers = [],
deps = []):
fb_xplat_cxx_test(
name = name,
srcs = srcs,
raw_headers = raw_headers,
include_directories = [
"..",
],
headers = headers,
header_namespace = _compute_header_namespace(),
deps = deps,
# Combination of `platforms = FBCODE` and `mangled_keys = ["deps"]`
# forces the unsuffixed target into fbcode platform
Expand All @@ -180,17 +182,17 @@ def mvfst_cxx_test(
def mvfst_cxx_binary(
name,
srcs,
raw_headers = [],
deps = [],
**kwargs):
headers = [],
compatible_with = [],
compiler_flags = [],
deps = []):
fb_xplat_cxx_binary(
name = name,
srcs = srcs,
raw_headers = raw_headers,
compiler_flags = kwargs.pop("compiler_flags", []) + CXXFLAGS,
include_directories = [
"..",
],
headers = headers,
header_namespace = _compute_header_namespace(),
compatible_with = compatible_with,
compiler_flags = compiler_flags + CXXFLAGS,
deps = deps,
contacts = ["[email protected]"],
platforms = (CXX,),
Expand Down

0 comments on commit 92eb1bd

Please sign in to comment.