diff --git a/ohos/ndk/BUILD.gn b/ohos/ndk/BUILD.gn index 7fd706e40811cc87afbd86e5d4d9dd5182152288..dbbaf9b3ba8820393da8e69e3c06458d45292460 100755 --- a/ohos/ndk/BUILD.gn +++ b/ohos/ndk/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. +# Copyright (c) 2021-2025 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -72,8 +72,29 @@ if (!use_current_sdk) { } } + if (!defined(ext_ndk_config_file) || ext_ndk_config_file == "") { + action_with_pydeps("_clean_ndk_ani") { + deps = [ ":_collect_ndk_syscap" ] + script = "//interface/sdk_c/build-tools/clean_ndk_ani.py" + outputs = [ "${ndk_os_irrelevant_out_dir}/clean_ndk_ani.json" ] + _native_syscap_config_file = + "${ndk_os_irrelevant_out_dir}/nativeapi_syscap_config.json" + args = [ + "--ndk-header-path", + rebase_path("$ndk_headers_out_dir", root_build_dir), + "--system-capability-header-config", + rebase_path(_native_syscap_config_file, root_build_dir), + ] + } + } + group("all_ndk_targets") { deps = [ ":_collect_ndk_syscap" ] + if (!defined(ext_ndk_config_file) || ext_ndk_config_file == "") { + if (!sdk_build_arkts) { + deps += [ ":_clean_ndk_ani" ] + } + } } group("ndk_notice") {