1# Copyright (C) 2024 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  sources = [ "./environment.c" ]
39  deps = [ "${file_api_path}/interfaces/kits/native:environment_native" ]
40  external_deps = []
41
42  output_name = "ohenvironment"
43  output_extension = "so"
44  relative_install_dir = "ndk"
45  part_name = "file_api"
46  subsystem_name = "filemanagement"
47}
48
49ohos_ndk_headers("oh_environment_header") {
50  dest_dir = "$ndk_headers_out_dir/filemanagement/environment/"
51  sources = [ "./environment.h" ]
52}
53
54ohos_ndk_library("libohenvironment") {
55  output_name = "ohenvironment"
56  output_extension = "so"
57  ndk_description_file = "./libenvironment.ndk.json"
58  system_capability =
59      "SystemCapability.FileManagement.File.Environment.FolderObtain"
60}
61