diff --git a/build/templates/cxx/external_deps_handler.py b/build/templates/cxx/external_deps_handler.py index 82107af743099cb05a511846ed371f86396e46bf..cf11bacae2434e853b05e985f296bef1364f7724 100755 --- a/build/templates/cxx/external_deps_handler.py +++ b/build/templates/cxx/external_deps_handler.py @@ -1,7 +1,7 @@ #!/usr/bin/env python3 # -*- coding: utf-8 -*- # -# Copyright (c) 2022 Huawei Device Co., Ltd. +# Copyright (c) 2022-2024 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 @@ -139,6 +139,15 @@ def main(): "json/dummy_bundle.json".format(args.root_src_dir)) target_name = dep.split(":")[1] deps.append(get_full_path_from_target_name(config_info, target_name)) + elif dep.startswith("node"): + config_info = read_json_file("{}arkcompiler/toolchain/build/third_party_gn/" \ + "node/dummy_bundle.json".format(args.root_src_dir)) + target_name = dep.split(":")[1] + deps.append(get_full_path_from_target_name(config_info, target_name)) + elif dep.startswith("napi"): + config_info = read_json_file("{}foundation/arkui/napi/bundle.json".format(args.root_src_dir)) + target_name = dep.split(":")[1] + deps.append(get_full_path_from_target_name(config_info, target_name)) else: print("Component in which the external_dep defined is ommited in the logic of {}!".format(__file__)) sys.exit(1) diff --git a/build/third_party_gn/node/BUILD.gn b/build/third_party_gn/node/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..3af9c5c4236ddd4526992fc3378e2bdbf11d36ea --- /dev/null +++ b/build/third_party_gn/node/BUILD.gn @@ -0,0 +1,31 @@ +#Copyright (c) 2024 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 +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +#Unless required by applicable law or agreed to in writing, software +#distributed under the License is distributed on an "AS IS" BASIS, +#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +#See the License for the specific language governing permissions and +#limitations under the License. + +import("$build_root/ark.gni") + +config("node_header_config") { + include_dirs = [ "//third_party/node/src" ] +} + +ohos_static_library("node_header_notice") { + public_configs = [ ":node_header_config" ] + sources = [ + "//third_party/node/jsvm.h", + "//third_party/node/src/js_native_api.h", + "//third_party/node/src/js_native_api_types.h", + "//third_party/node/src/node_api.h", + "//third_party/node/src/node_api_types.h", + ] + part_name = "node" + subsystem_name = "thirdparty" +} diff --git a/build/third_party_gn/node/dummy_bundle.json b/build/third_party_gn/node/dummy_bundle.json new file mode 100644 index 0000000000000000000000000000000000000000..be34ad76aa02e10bf413d6ab05c3a510cb1ebbf5 --- /dev/null +++ b/build/third_party_gn/node/dummy_bundle.json @@ -0,0 +1,15 @@ +{ + "component": { + "build": { + "inner_kits": [ + { + "name": "//arkcompiler/toolchain/build/third_party_gn/node:node_header_notice", + "header": { + "header_files": [], + "header_base": "//third_party/node/src" + } + } + ] + } + } +}