1# Copyright (C) 2024-2025 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.gni") 15import("//build/ohos/ndk/ndk.gni") 16import("//foundation/filemanagement/file_api/file_api.gni") 17 18ohos_shared_library("ohenvironment") { 19 cflags = [ 20 "-fdata-sections", 21 "-ffunction-sections", 22 "-Oz", 23 ] 24 cflags_cc = [ 25 "-fvisibility-inlines-hidden", 26 "-Oz", 27 ] 28 sanitize = { 29 integer_overflow = true 30 ubsan = true 31 boundary_sanitize = true 32 cfi = true 33 cfi_cross_dso = true 34 debug = false 35 } 36 include_dirs = [ 37 "./", 38 "../common/", 39 ] 40 41 sources = [ "./environment.c" ] 42 deps = [ "${file_api_path}/interfaces/kits/native:environment_native" ] 43 external_deps = [] 44 45 output_name = "ohenvironment" 46 output_extension = "so" 47 relative_install_dir = "ndk" 48 part_name = "file_api" 49 subsystem_name = "filemanagement" 50} 51 52ohos_ndk_headers("oh_environment_header") { 53 dest_dir = "$ndk_headers_out_dir/filemanagement/environment/" 54 sources = [ "./environment.h" ] 55} 56 57ohos_ndk_library("libohenvironment") { 58 output_name = "ohenvironment" 59 output_extension = "so" 60 ndk_description_file = "./libenvironment.ndk.json" 61 system_capability = 62 "SystemCapability.FileManagement.File.Environment.FolderObtain" 63} 64