Skip to content

Commit

Permalink
getdeps: add thrift built-in includes to THRIFT_INCLUDE_PATH
Browse files Browse the repository at this point in the history
Summary:
X-link: facebookincubator/zstrong#709

The thrift compiler includes some additional thrift files for built-in features, e.g. annotations.  Unlike other thrift libraries, these thrift files are installed directly to `include` instead of `include/thrift-files`.

If we detect `include/thrift`, then consider that to be an indication that we should add `include` to the `THRIFT_INCLUDE_PATH`, so that these can be picked up by things that depend on the built-in thrift files.

Reviewed By: mitrandir77

Differential Revision:
D53943880

Privacy Context Container: L1122763

fbshipit-source-id: d30c3e2598ca8904c1b054965aca2057733ecd20
  • Loading branch information
markbt authored and facebook-github-bot committed Feb 22, 2024
1 parent 8d7d3b8 commit 7573b8b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions build/fbcode_builder/getdeps/buildopts.py
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,11 @@ def add_prefix_to_env(
elif "/bz2-" in d:
add_flag(env, "CPPFLAGS", f"-I{includedir}", append=append)

# The thrift compiler's built-in includes are installed directly to the include dir
includethriftdir = os.path.join(d, "include", "thrift")
if os.path.exists(includethriftdir):
add_path_entry(env, "THRIFT_INCLUDE_PATH", includedir, append=append)

# Map from FB python manifests to PYTHONPATH
pydir = os.path.join(d, "lib", "fb-py-libs")
if os.path.exists(pydir):
Expand Down

0 comments on commit 7573b8b

Please sign in to comment.