# Copyright (c) 2021 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/ohos_var.gni") # ndk library, ndk header configuration _ndk_library_targets = [ "//third_party/zlib:libz_ndk", "//third_party/zlib:zlib_header", "//base/global/resource_management/interfaces/native/resource:librawfile_ndk", "//base/global/resource_management/interfaces/native/resource:rawfile_header", "//base/hiviewdfx/hiappevent/interfaces/native/kits:libhiappevent_header", "//base/hiviewdfx/hiappevent/interfaces/native/kits:libhiappevent_ndk", "//base/hiviewdfx/hilog/interfaces/native/kits:hilog_header", "//base/hiviewdfx/hilog/interfaces/native/kits:libhilog_ndk", "//base/hiviewdfx/hitrace/interfaces/native/kits:hitrace_header", "//base/hiviewdfx/hitrace/interfaces/native/kits:libhitrace_ndk", "//base/security/huks/interfaces/kits/c:libhuks_ndk", "//base/security/huks/interfaces/kits/c:huks_header", "//base/startup/init/interfaces/kits/syscap:libdeviceinfo_ndk", "//base/startup/init/interfaces/kits/syscap:deviceinfo_header", "//third_party/mindspore/interfaces/kits/c:mindspore_header", "//third_party/mindspore/interfaces/kits/c:mindspore_lib", "//foundation/arkui/ace_engine/interfaces/native:ace_header", "//foundation/arkui/ace_engine/interfaces/native:libace_ndk", "//foundation/arkui/napi:libnapi_ndk", "//foundation/arkui/napi:napi_header", "//foundation/bundlemanager/bundle_framework/interfaces/kits/native/bundle:bundle_header", "//foundation/bundlemanager/bundle_framework/interfaces/kits/native/bundle:libbundle_ndk", "//third_party/node:node_header", "//foundation/graphic/graphic_2d/interfaces/kits/ndk/EGL:libEGL_ndk", "//foundation/graphic/graphic_2d/interfaces/kits/ndk/EGL:EGL_header", "//foundation/graphic/graphic_2d/interfaces/kits/ndk/GLES3:libGLESv3_ndk", "//foundation/graphic/graphic_2d/interfaces/kits/ndk/GLES3:GLES3_header", "//foundation/graphic/graphic_2d/interfaces/kits/ndk/KHR:KHR_header", "//foundation/graphic/graphic_2d/interfaces/kits/ndk/native_window:libnative_window_ndk", "//foundation/graphic/graphic_2d/interfaces/kits/ndk/native_window:native_window_header", "//foundation/graphic/graphic_2d/interfaces/kits/ndk/native_buffer:libnative_buffer_ndk", "//foundation/graphic/graphic_2d/interfaces/kits/ndk/native_buffer:native_buffer_header", "//foundation/graphic/graphic_2d/interfaces/kits/ndk/native_image:libnative_image_ndk", "//foundation/graphic/graphic_2d/interfaces/kits/ndk/native_image:native_image_header", "//foundation/graphic/graphic_2d/interfaces/kits/ndk/native_vsync:libnative_vsync_ndk", "//foundation/graphic/graphic_2d/interfaces/kits/ndk/native_vsync:native_vsync_header", "//foundation/graphic/graphic_2d/interfaces/kits/ndk/native_drawing:libnative_drawing_ndk", "//foundation/graphic/graphic_2d/interfaces/kits/ndk/native_drawing:native_drawing_header", "//third_party/libuv:libuv_ndk", "//third_party/libuv:libuv_header", "//third_party/libuv:libuv_uv_header", "//foundation/multimedia/av_codec/interfaces/kits/c/audio_decoder:libnative_media_adec", "//foundation/multimedia/av_codec/interfaces/kits/c/audio_decoder:native_media_adec_header", "//foundation/multimedia/av_codec/interfaces/kits/c/audio_encoder:libnative_media_aenc", "//foundation/multimedia/av_codec/interfaces/kits/c/audio_encoder:native_media_aenc_header", "//foundation/multimedia/av_codec/interfaces/kits/c/core:libnative_media_core", "//foundation/multimedia/av_codec/interfaces/kits/c/core:native_media_core_header", "//foundation/multimedia/av_codec/interfaces/kits/c/video_decoder:libnative_media_vdec", "//foundation/multimedia/av_codec/interfaces/kits/c/video_decoder:native_media_vdec_header", "//foundation/multimedia/av_codec/interfaces/kits/c/video_encoder:libnative_media_venc", "//foundation/multimedia/av_codec/interfaces/kits/c/video_encoder:native_media_venc_header", "//foundation/multimedia/av_codec/interfaces/kits/c/codec_base:libnative_media_codecbase", "//foundation/multimedia/av_codec/interfaces/kits/c/codec_base:native_media_codecbase_header", "//foundation/multimedia/av_codec/interfaces/kits/c/avmuxer:libnative_media_avmuxer", "//foundation/multimedia/av_codec/interfaces/kits/c/avmuxer:native_media_avmuxer_header", "//foundation/multimedia/av_codec/interfaces/kits/c/avdemuxer:libnative_media_avdemuxer", "//foundation/multimedia/av_codec/interfaces/kits/c/avdemuxer:native_media_avdemuxer_header", "//foundation/multimedia/av_codec/interfaces/kits/c/avsource:libnative_media_avsource", "//foundation/multimedia/av_codec/interfaces/kits/c/avsource:native_media_avsource_header", "//foundation/multimedia/player_framework/interfaces/kits/c/avscreen_capture:libnative_avscreen_capture", "//foundation/multimedia/player_framework/interfaces/kits/c/avscreen_capture:native_avscreen_capture_header", "//foundation/multimedia/audio_framework/interfaces/kits/c:libohaudio_ndk", "//foundation/multimedia/audio_framework/interfaces/kits/c:ohaudio_header", "//foundation/multimedia/image_framework/interfaces/kits/native:libpixelmap_ndk", "//foundation/multimedia/image_framework/interfaces/kits/native:image_header", "//foundation/multimedia/image_framework/interfaces/kits/native:libimage_ndk", "//foundation/multimedia/image_framework/interfaces/kits/native:image_ndk_header", "//foundation/multimedia/image_framework/interfaces/kits/native:libimage_receiver_ndk", "//foundation/multimedia/image_framework/interfaces/kits/native:image_receiver_ndk_header", "//foundation/multimedia/image_framework/interfaces/kits/native:libimage_source_ndk", "//foundation/multimedia/image_framework/interfaces/kits/native:image_source_ndk_header", "//third_party/openSLES:sles_header", "//third_party/openSLES:libOpenSLES_ndk", "//foundation/ai/neural_network_runtime/interfaces/kits/c:libneural_network_runtime_ndk", "//foundation/ai/neural_network_runtime/interfaces/kits/c:libneural_network_runtime_header", "//commonlibrary/memory_utils/libpurgeablemem/interfaces/kits/c:libpurgeable_memory_ndk", "//commonlibrary/memory_utils/libpurgeablemem/interfaces/kits/c:purgeable_memory_header", "//foundation/distributeddatamgr/relational_store/interfaces/ndk:native_rdb_ndk_header", "//foundation/distributeddatamgr/relational_store/interfaces/ndk:libnative_rdb_ndk", "//drivers/external_device_manager/interfaces/ddk/usb:libusb_ndk", "//drivers/external_device_manager/interfaces/ddk/usb:usb_header", "//foundation/graphic/graphic_2d/interfaces/kits/ndk/vulkan:libvulkan_ndk", "//foundation/graphic/graphic_2d/interfaces/kits/ndk/vulkan:vulkan_header", "//foundation/resourceschedule/ffrt/interfaces/kits:libffrt_ndk", "//foundation/resourceschedule/ffrt/interfaces/kits:ffrt_header", ] _ndk_base_libs = [ "//third_party/musl/ndk_script/adapter:libc_ndk", "//third_party/musl/ndk_script:musl_ndk_libs_arm32", "//third_party/musl/ndk_script:musl_ndk_libs_aarch64", "//third_party/musl/ndk_script:musl_ndk_libs_x86_64", "//third_party/musl/ndk_script:ndk_toolchain", ] _ndk_sysroot_uapi = [ "//third_party/musl/ndk_script:musl_sysroot" ] _ndk_cmake = [ "//prebuilts/cmake/darwin-x86:darwin_cmake_copy", "//prebuilts/cmake/linux-x86:linux_cmake_copy", "//prebuilts/cmake/windows-x86:windows_cmake_copy", "//build/ohos/ndk:ndk_cmake_files", "//build/ohos/ndk:cmake_patch", ] _ndk_targets_list = _ndk_library_targets + _ndk_base_libs + _ndk_sysroot_uapi + _ndk_cmake _parse_script = "//build/ohos/ndk/parse_ndk_targets.py" _parse_args = [ "--source-root-dir", rebase_path("//", root_build_dir), "--ndk-lib-target-list", ] _parse_args += _ndk_targets_list all_ndk_targets_list = exec_script(_parse_script, _parse_args, "list lines") if (ndk_platform == "win") { all_ndk_targets_list += [ "//third_party/musl/ndk_script:windows_x86_64" ] } else if (ndk_platform == "mac") { if (host_cpu == "arm64") { all_ndk_targets_list += [ "//third_party/musl/ndk_script:darwin_arm64" ] } else { all_ndk_targets_list += [ "//third_party/musl/ndk_script:darwin_x86_64" ] } } else if (ndk_platform == "linux") { all_ndk_targets_list += [ "//third_party/musl/ndk_script:linux_x86_64" ] } else if (ndk_platform == "default") { if (host_os == "mac") { if (host_cpu == "arm64") { all_ndk_targets_list += [ "//third_party/musl/ndk_script:darwin_arm64" ] } else { all_ndk_targets_list += [ "//third_party/musl/ndk_script:darwin_x86_64" ] } } else { all_ndk_targets_list += [ "//third_party/musl/ndk_script:windows_x86_64", "//third_party/musl/ndk_script:linux_x86_64", ] } }