diff --git a/ohos/taihe_idl/taihe.gni b/ohos/taihe_idl/taihe.gni index df1bae47934ac6e43b0d737ca22aafb798b8e451..2c6e8a7c136cebecaaa368118ca3e3f47e07884d 100644 --- a/ohos/taihe_idl/taihe.gni +++ b/ohos/taihe_idl/taihe.gni @@ -12,6 +12,8 @@ # limitations under the License. import("//build/ohos.gni") +taihe_copy_array = [] + declare_args() { taihe_file_path = "$root_out_dir/taihe" taihe_toolchain_path = "//prebuilts/taihe/ohos/linux-x86_64/taihe" @@ -25,7 +27,8 @@ template("ohos_taihe") { action(target_name) { script = "${taihe_toolchain_path}/bin/taihec" args = [ - rebase_path("${taihe_toolchain_path}/lib/taihe/stdlib/taihe.platform.ani.taihe"), + rebase_path( + "${taihe_toolchain_path}/lib/taihe/stdlib/taihe.platform.ani.taihe"), "-I", rebase_path("$taihe_file_path", root_build_dir), "-O", @@ -34,9 +37,24 @@ template("ohos_taihe") { "cpp-author", "ani-bridge", ] - deps = invoker.deps + + if (defined(invoker.module_prefix)) { + args += [ "-Carkts:module-prefix=${invoker.module_prefix}" ] + } + + if (defined(invoker.path_prefix)) { + args += [ "-Carkts:path-prefix=${invoker.path_prefix}" ] + } + + deps = taihe_copy_array + if (defined(invoker.deps)) { + deps += invoker.deps + } + outputs = [ "$taihe_generated_file_path/src/taihe.platform.ani.abi.c" ] - outputs += invoker.outputs + if (defined(invoker.outputs)) { + outputs += invoker.outputs + } } }