• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2021 Huawei Device Co., Ltd.
2# Licensed under the Apache License, Version 2.0 (the "License");
3# you may not use this file except in compliance with the License.
4# You may obtain a copy of the License at
5#
6#     http://www.apache.org/licenses/LICENSE-2.0
7#
8# Unless required by applicable law or agreed to in writing, software
9# distributed under the License is distributed on an "AS IS" BASIS,
10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11# See the License for the specific language governing permissions and
12# limitations under the License.
13
14import("//build/ohos_var.gni")
15
16# ndk library, ndk header configuration
17_ndk_library_targets = [
18  "//third_party/zlib:libz_ndk",
19  "//third_party/zlib:zlib_header",
20  "//base/global/resource_management/interfaces/native/resource:librawfile_ndk",
21  "//base/global/resource_management/interfaces/native/resource:rawfile_header",
22  "//base/hiviewdfx/hiappevent/interfaces/native/kits:libhiappevent_header",
23  "//base/hiviewdfx/hiappevent/interfaces/native/kits:libhiappevent_ndk",
24  "//base/hiviewdfx/hilog/interfaces/native/kits:hilog_header",
25  "//base/hiviewdfx/hilog/interfaces/native/kits:libhilog_ndk",
26  "//base/hiviewdfx/hitrace/interfaces/native/kits:hitrace_header",
27  "//base/hiviewdfx/hitrace/interfaces/native/kits:libhitrace_ndk",
28  "//base/security/huks/interfaces/kits/c:libhuks_ndk",
29  "//base/security/huks/interfaces/kits/c:huks_header",
30  "//base/startup/init/interfaces/kits/syscap:libdeviceinfo_ndk",
31  "//base/startup/init/interfaces/kits/syscap:deviceinfo_header",
32  "//third_party/mindspore/interfaces/kits/c:mindspore_header",
33  "//third_party/mindspore/interfaces/kits/c:mindspore_lib",
34  "//foundation/arkui/ace_engine/interfaces/native:ace_header",
35  "//foundation/arkui/ace_engine/interfaces/native:libace_ndk",
36  "//foundation/arkui/napi:libnapi_ndk",
37  "//foundation/arkui/napi:napi_header",
38  "//foundation/bundlemanager/bundle_framework/interfaces/kits/native/bundle:bundle_header",
39  "//foundation/bundlemanager/bundle_framework/interfaces/kits/native/bundle:libbundle_ndk",
40  "//third_party/node:node_header",
41  "//foundation/graphic/graphic_2d/interfaces/kits/ndk/EGL:libEGL_ndk",
42  "//foundation/graphic/graphic_2d/interfaces/kits/ndk/EGL:EGL_header",
43  "//foundation/graphic/graphic_2d/interfaces/kits/ndk/GLES3:libGLESv3_ndk",
44  "//foundation/graphic/graphic_2d/interfaces/kits/ndk/GLES3:GLES3_header",
45  "//foundation/graphic/graphic_2d/interfaces/kits/ndk/KHR:KHR_header",
46  "//foundation/graphic/graphic_2d/interfaces/kits/ndk/native_window:libnative_window_ndk",
47  "//foundation/graphic/graphic_2d/interfaces/kits/ndk/native_window:native_window_header",
48  "//foundation/graphic/graphic_2d/interfaces/kits/ndk/native_buffer:libnative_buffer_ndk",
49  "//foundation/graphic/graphic_2d/interfaces/kits/ndk/native_buffer:native_buffer_header",
50  "//foundation/graphic/graphic_2d/interfaces/kits/ndk/native_image:libnative_image_ndk",
51  "//foundation/graphic/graphic_2d/interfaces/kits/ndk/native_image:native_image_header",
52  "//foundation/graphic/graphic_2d/interfaces/kits/ndk/native_vsync:libnative_vsync_ndk",
53  "//foundation/graphic/graphic_2d/interfaces/kits/ndk/native_vsync:native_vsync_header",
54  "//foundation/graphic/graphic_2d/interfaces/kits/ndk/native_drawing:libnative_drawing_ndk",
55  "//foundation/graphic/graphic_2d/interfaces/kits/ndk/native_drawing:native_drawing_header",
56  "//third_party/libuv:libuv_ndk",
57  "//third_party/libuv:libuv_header",
58  "//third_party/libuv:libuv_uv_header",
59  "//foundation/multimedia/av_codec/interfaces/kits/c/audio_decoder:libnative_media_adec",
60  "//foundation/multimedia/av_codec/interfaces/kits/c/audio_decoder:native_media_adec_header",
61  "//foundation/multimedia/av_codec/interfaces/kits/c/audio_encoder:libnative_media_aenc",
62  "//foundation/multimedia/av_codec/interfaces/kits/c/audio_encoder:native_media_aenc_header",
63  "//foundation/multimedia/av_codec/interfaces/kits/c/core:libnative_media_core",
64  "//foundation/multimedia/av_codec/interfaces/kits/c/core:native_media_core_header",
65  "//foundation/multimedia/av_codec/interfaces/kits/c/video_decoder:libnative_media_vdec",
66  "//foundation/multimedia/av_codec/interfaces/kits/c/video_decoder:native_media_vdec_header",
67  "//foundation/multimedia/av_codec/interfaces/kits/c/video_encoder:libnative_media_venc",
68  "//foundation/multimedia/av_codec/interfaces/kits/c/video_encoder:native_media_venc_header",
69  "//foundation/multimedia/av_codec/interfaces/kits/c/codec_base:libnative_media_codecbase",
70  "//foundation/multimedia/av_codec/interfaces/kits/c/codec_base:native_media_codecbase_header",
71  "//foundation/multimedia/av_codec/interfaces/kits/c/avmuxer:libnative_media_avmuxer",
72  "//foundation/multimedia/av_codec/interfaces/kits/c/avmuxer:native_media_avmuxer_header",
73  "//foundation/multimedia/av_codec/interfaces/kits/c/avdemuxer:libnative_media_avdemuxer",
74  "//foundation/multimedia/av_codec/interfaces/kits/c/avdemuxer:native_media_avdemuxer_header",
75  "//foundation/multimedia/av_codec/interfaces/kits/c/avsource:libnative_media_avsource",
76  "//foundation/multimedia/av_codec/interfaces/kits/c/avsource:native_media_avsource_header",
77  "//foundation/multimedia/player_framework/interfaces/kits/c/avscreen_capture:libnative_avscreen_capture",
78  "//foundation/multimedia/player_framework/interfaces/kits/c/avscreen_capture:native_avscreen_capture_header",
79  "//foundation/multimedia/audio_framework/interfaces/kits/c:libohaudio_ndk",
80  "//foundation/multimedia/audio_framework/interfaces/kits/c:ohaudio_header",
81  "//foundation/multimedia/image_framework/interfaces/kits/native:libpixelmap_ndk",
82  "//foundation/multimedia/image_framework/interfaces/kits/native:image_header",
83  "//foundation/multimedia/image_framework/interfaces/kits/native:libimage_ndk",
84  "//foundation/multimedia/image_framework/interfaces/kits/native:image_ndk_header",
85  "//foundation/multimedia/image_framework/interfaces/kits/native:libimage_receiver_ndk",
86  "//foundation/multimedia/image_framework/interfaces/kits/native:image_receiver_ndk_header",
87  "//foundation/multimedia/image_framework/interfaces/kits/native:libimage_source_ndk",
88  "//foundation/multimedia/image_framework/interfaces/kits/native:image_source_ndk_header",
89  "//third_party/openSLES:sles_header",
90  "//third_party/openSLES:libOpenSLES_ndk",
91  "//foundation/ai/neural_network_runtime/interfaces/kits/c:libneural_network_runtime_ndk",
92  "//foundation/ai/neural_network_runtime/interfaces/kits/c:libneural_network_runtime_header",
93  "//commonlibrary/memory_utils/libpurgeablemem/interfaces/kits/c:libpurgeable_memory_ndk",
94  "//commonlibrary/memory_utils/libpurgeablemem/interfaces/kits/c:purgeable_memory_header",
95  "//foundation/distributeddatamgr/relational_store/interfaces/ndk:native_rdb_ndk_header",
96  "//foundation/distributeddatamgr/relational_store/interfaces/ndk:libnative_rdb_ndk",
97  "//drivers/external_device_manager/interfaces/ddk/usb:libusb_ndk",
98  "//drivers/external_device_manager/interfaces/ddk/usb:usb_header",
99  "//foundation/graphic/graphic_2d/interfaces/kits/ndk/vulkan:libvulkan_ndk",
100  "//foundation/graphic/graphic_2d/interfaces/kits/ndk/vulkan:vulkan_header",
101  "//foundation/resourceschedule/ffrt/interfaces/kits:libffrt_ndk",
102  "//foundation/resourceschedule/ffrt/interfaces/kits:ffrt_header",
103]
104
105_ndk_base_libs = [
106  "//third_party/musl/ndk_script/adapter:libc_ndk",
107  "//third_party/musl/ndk_script:musl_ndk_libs_arm32",
108  "//third_party/musl/ndk_script:musl_ndk_libs_aarch64",
109  "//third_party/musl/ndk_script:musl_ndk_libs_x86_64",
110  "//third_party/musl/ndk_script:ndk_toolchain",
111]
112_ndk_sysroot_uapi = [ "//third_party/musl/ndk_script:musl_sysroot" ]
113
114_ndk_cmake = [
115  "//prebuilts/cmake/darwin-x86:darwin_cmake_copy",
116  "//prebuilts/cmake/linux-x86:linux_cmake_copy",
117  "//prebuilts/cmake/windows-x86:windows_cmake_copy",
118  "//build/ohos/ndk:ndk_cmake_files",
119  "//build/ohos/ndk:cmake_patch",
120]
121
122_ndk_targets_list =
123    _ndk_library_targets + _ndk_base_libs + _ndk_sysroot_uapi + _ndk_cmake
124
125_parse_script = "//build/ohos/ndk/parse_ndk_targets.py"
126_parse_args = [
127  "--source-root-dir",
128  rebase_path("//", root_build_dir),
129  "--ndk-lib-target-list",
130]
131_parse_args += _ndk_targets_list
132
133all_ndk_targets_list = exec_script(_parse_script, _parse_args, "list lines")
134
135if (ndk_platform == "win") {
136  all_ndk_targets_list += [ "//third_party/musl/ndk_script:windows_x86_64" ]
137} else if (ndk_platform == "mac") {
138  if (host_cpu == "arm64") {
139    all_ndk_targets_list += [ "//third_party/musl/ndk_script:darwin_arm64" ]
140  } else {
141    all_ndk_targets_list += [ "//third_party/musl/ndk_script:darwin_x86_64" ]
142  }
143} else if (ndk_platform == "linux") {
144  all_ndk_targets_list += [ "//third_party/musl/ndk_script:linux_x86_64" ]
145} else if (ndk_platform == "default") {
146  if (host_os == "mac") {
147    if (host_cpu == "arm64") {
148      all_ndk_targets_list += [ "//third_party/musl/ndk_script:darwin_arm64" ]
149    } else {
150      all_ndk_targets_list += [ "//third_party/musl/ndk_script:darwin_x86_64" ]
151    }
152  } else {
153    all_ndk_targets_list += [
154      "//third_party/musl/ndk_script:windows_x86_64",
155      "//third_party/musl/ndk_script:linux_x86_64",
156    ]
157  }
158}
159