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

Commit 09b2553

Browse files
authored
[fuchsia] add support for api level when calling fidlc (#583)
1 parent c1724ec commit 09b2553

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

build/fuchsia/fidl_gen_cpp.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ def main():
4242
parser.add_argument('--json', dest='json', action='store', required=True)
4343
parser.add_argument('--fidlgen-output-root', dest='fidlgen_output_root', action='store', required=False)
4444
parser.add_argument('--output-c-tables', dest='output_c_tables', action='store', required=True)
45+
parser.add_argument('--target-api-level', dest='target_api_level', action='store', required=False)
4546

4647
args = parser.parse_args()
4748

@@ -59,6 +60,12 @@ def main():
5960
args.json
6061
]
6162

63+
if args.target_api_level:
64+
fidlc_command += [
65+
'--available',
66+
'fuchsia:{api_level}'.format(api_level=args.target_api_level),
67+
]
68+
6269
# Create an iterator that works on both python3 and python2
6370
try:
6471
fidl_files_by_name_iter = list(fidl_files_by_name.items())

build/fuchsia/sdk.gni

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
# Use of this source code is governed by a BSD-style license that can be
33
# found in the LICENSE file.
44

5+
import("//build/fuchsia/config.gni")
6+
57
declare_args() {
68
# The path to where GN targets derived from the Fuchsia SDK are instantiated.
79
fuchsia_sdk_root = "//build/fuchsia"
@@ -113,6 +115,13 @@ template("_fuchsia_fidl_library") {
113115
rebase_path("$target_gen_dir/$library_name_slashes/cpp/tables.c"),
114116
]
115117

118+
if (fuchsia_target_api_level != -1) {
119+
args += [
120+
"--target-api-level",
121+
"${fuchsia_target_api_level}",
122+
]
123+
}
124+
116125
if (!defined(invoker.only_generate_tables) ||
117126
!invoker.only_generate_tables) {
118127
outputs += [

0 commit comments

Comments
 (0)