-
Notifications
You must be signed in to change notification settings - Fork 238
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add
cxx_binary
support for boilerplate
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
1 parent
6ad6133
commit 92eb1bd
Showing
1 changed file
with
15 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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) | ||
|
||
|
@@ -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 | ||
|
@@ -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,), | ||
|