Skip to content
This repository was archived by the owner on Apr 21, 2025. It is now read-only.

Add FIDL HLCPP tables.c file to the build #798

Merged
merged 1 commit into from
Dec 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions build/fuchsia/fidl_gen_cpp.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ def main():
parser.add_argument('--fidlgen-output-root', dest='fidlgen_output_root', action='store', required=False)
parser.add_argument('--output-c-tables', dest='output_c_tables', action='store', required=True)
parser.add_argument('--target-api-level', dest='target_api_level', action='store', required=False)
# TODO(fxbug.dev/39388): Remove after https://fxrev.dev/953989 rolls into flutter.
parser.add_argument('--new-tables-path', dest='new_tables_path', action='store', required=False)

args = parser.parse_args()

Expand Down Expand Up @@ -78,6 +80,13 @@ def main():

subprocess.check_call(fidlc_command)

# TODO(fxbug.dev/39388): Remove after https://fxrev.dev/953989 rolls into flutter.
if args.fidlgen_bin:
# Write tables.c so that GN doesn't complain about a missing output before the roll.
assert args.new_tables_path
with open(args.new_tables_path, "w") as f:
print("// This will contain coding tables once https://fxbug.dev/39388 is done.", file=f)

if args.fidlgen_output_root:
assert os.path.exists(args.json)
for fidlgen_bin in args.fidlgen_bin:
Expand Down
4 changes: 4 additions & 0 deletions build/fuchsia/sdk.gni
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ template("fuchsia_fidl_library") {
"$target_gen_dir/$library_name_slashes/cpp/fidl.cc",
"$target_gen_dir/$library_name_slashes/cpp/fidl.h",
"$target_gen_dir/$library_name_slashes/cpp/fidl_test_base.h",
"$target_gen_dir/$library_name_slashes/cpp/tables.c",

"$target_gen_dir/fidl/$library_name/cpp/common_types.cc",
"$target_gen_dir/fidl/$library_name/cpp/common_types.h",
Expand Down Expand Up @@ -165,6 +166,9 @@ template("fuchsia_fidl_library") {
rebase_path("${_fuchsia_tools_path}/fidlgen_hlcpp"),
"--fidlgen-output-root",
rebase_path("$target_gen_dir"),
# TODO(fxbug.dev/39388): Remove after https://fxrev.dev/953989 rolls into flutter.
"--new-tables-path",
rebase_path("$target_gen_dir/$library_name_slashes/cpp/tables.c"),
]
}
}
Expand Down