Skip to content
This repository was archived by the owner on Apr 21, 2025. It is now read-only.
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
7 changes: 7 additions & 0 deletions build/fuchsia/fidl_gen_cpp.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ def main():
parser.add_argument('--json', dest='json', action='store', required=True)
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)

args = parser.parse_args()

Expand All @@ -59,6 +60,12 @@ def main():
args.json
]

if args.target_api_level:
fidlc_command += [
'--available',
'fuchsia:{api_level}'.format(api_level=args.target_api_level),
]

# Create an iterator that works on both python3 and python2
try:
fidl_files_by_name_iter = list(fidl_files_by_name.items())
Expand Down
9 changes: 9 additions & 0 deletions build/fuchsia/sdk.gni
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import("//build/fuchsia/config.gni")

declare_args() {
# The path to where GN targets derived from the Fuchsia SDK are instantiated.
fuchsia_sdk_root = "//build/fuchsia"
Expand Down Expand Up @@ -113,6 +115,13 @@ template("_fuchsia_fidl_library") {
rebase_path("$target_gen_dir/$library_name_slashes/cpp/tables.c"),
]

if (fuchsia_target_api_level != -1) {
args += [
"--target-api-level",
"${fuchsia_target_api_level}",
]
}

if (!defined(invoker.only_generate_tables) ||
!invoker.only_generate_tables) {
outputs += [
Expand Down