1# Copyright (c) 2022 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("//foundation/filemanagement/file_api/file_api.gni") 16 17config("libn_public_config") { 18 visibility = [ ":*" ] 19 20 include_dirs = [ 21 "include", 22 "include/n_async", 23 "${utils_path}/common/include", 24 ] 25} 26 27ohos_shared_library("filemgmt_libn") { 28 if (!use_mingw_win && !use_mac) { 29 stack_protector_ret = true 30 sanitize = { 31 integer_overflow = true 32 ubsan = true 33 boundary_sanitize = true 34 cfi = true 35 cfi_cross_dso = true 36 debug = false 37 } 38 } 39 40 sources = [ 41 "src/n_async/n_async_work_callback.cpp", 42 "src/n_async/n_async_work_promise.cpp", 43 "src/n_async/n_ref.cpp", 44 "src/n_class.cpp", 45 "src/n_error.cpp", 46 "src/n_func_arg.cpp", 47 "src/n_val.cpp", 48 ] 49 50 cflags_cc = [ "-std=c++17" ] 51 if (use_mingw_win) { 52 defines = [ "WIN_PLATFORM" ] 53 } 54 if (use_mac) { 55 defines = [ "IOS_PLATFORM" ] 56 } 57 58 public_configs = [ ":libn_public_config" ] 59 60 deps = [ "${utils_path}/filemgmt_libhilog:filemgmt_libhilog" ] 61 62 external_deps = [ 63 "hilog:libhilog", 64 "napi:ace_napi", 65 ] 66 67 use_exceptions = true 68 69 subsystem_name = "filemanagement" 70 innerapi_tags = [ "platformsdk" ] 71 part_name = "file_api" 72} 73