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.gni") 15import("../../base/config.gni") 16 17config("shared_memory_config") { 18 include_dirs = [ 19 "include", 20 "../../base/include", 21 "${OHOS_PROFILER_DIR}/interfaces/innerkits", 22 "//third_party/bounds_checking_function/include", 23 "//commonlibrary/c_utils/base/include", 24 ] 25} 26 27ohos_source_set("shared_memory_source") { 28 sources = [ 29 "src/share_memory_allocator.cpp", 30 "src/share_memory_block.cpp", 31 ] 32 public_configs = [ 33 ":shared_memory_config", 34 "${OHOS_PROFILER_DIR}/device/base:hiprofiler_test_config", 35 ] 36 37 public_deps = [ 38 "${OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR}:protobuf_lite", 39 "//third_party/bounds_checking_function:libsec_static", 40 ] 41 42 if (current_toolchain != host_toolchain) { 43 defines = [ "HAVE_HILOG" ] 44 external_deps = [ 45 "c_utils:utils", 46 "hilog:libhilog", 47 ] 48 } 49 subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}" 50 part_name = "${OHOS_PROFILER_PART_NAME}" 51} 52 53ohos_shared_library("shared_memory") { 54 deps = [ ":shared_memory_source" ] 55 install_enable = true 56 subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}" 57 part_name = "${OHOS_PROFILER_PART_NAME}" 58} 59 60ohos_static_library("shared_memory_lite") { 61 sources = [ 62 "src/share_memory_allocator.cpp", 63 "src/share_memory_block.cpp", 64 ] 65 public_configs = [ 66 ":shared_memory_config", 67 "${OHOS_PROFILER_DIR}/device/base:hiprofiler_test_config", 68 ] 69 70 defines = [ "NO_PROTOBUF" ] 71 72 if (current_toolchain != host_toolchain) { 73 defines += [ "HAVE_HILOG" ] 74 external_deps = [ 75 "c_utils:utils", 76 "hilog:libhilog", 77 ] 78 } 79 80 subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}" 81 part_name = "${OHOS_PROFILER_PART_NAME}" 82} 83