-
Notifications
You must be signed in to change notification settings - Fork 425
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[executorch][flat_tensor] Generate flatc files
1. Move schema files under flat_tensor/serialize 2. Add targets to generate schema files Differential Revision: [D66903492](https://our.internmc.facebook.com/intern/diff/D66903492/) ghstack-source-id: 257299448 Pull Request resolved: #7255
- Loading branch information
Showing
5 changed files
with
52 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") | ||
load(":targets.bzl", "define_common_targets") | ||
|
||
oncall("executorch") | ||
|
||
define_common_targets() | ||
|
||
runtime.python_library( | ||
name = "schema", | ||
srcs = [ | ||
"flat_tensor_schema.py", | ||
], | ||
visibility = [ | ||
"//executorch/...", | ||
], | ||
) |
File renamed without changes.
File renamed without changes.
File renamed without changes.
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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") | ||
|
||
def define_common_targets(): | ||
runtime.genrule( | ||
name = "gen_schema", | ||
srcs = [ | ||
"flat_tensor.fbs", | ||
"scalar_type.fbs", | ||
], | ||
outs = { | ||
"schema_generated.h": ["flat_tensor_generated.h"], | ||
"scalar_type_generated.h": ["scalar_type_generated.h"] | ||
}, | ||
cmd = " ".join([ | ||
"$(exe {})".format(runtime.external_dep_location("flatc")), | ||
"--cpp", | ||
"--cpp-std c++11", | ||
"--scoped-enums", | ||
"-o ${OUT}", | ||
"${SRCS}", | ||
]), | ||
default_outs = ["."], | ||
) | ||
|
||
runtime.cxx_library( | ||
name = "generated_headers", | ||
srcs = [], | ||
visibility = [ | ||
"//executorch/...", | ||
], | ||
exported_headers = { | ||
"schema_generated.h": ":gen_schema[schema_generated.h]", | ||
"scalar_type_generated.h": ":gen_schema[scalar_type_generated.h]", | ||
}, | ||
exported_external_deps = ["flatbuffers-api"], | ||
) |