1# Copyright (c) 2022-2023 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("./../../uhdf2/uhdf.gni") 16 17HDF_FRAMEWORK_PATH = "./../../../framework" 18 19config("hdf_test_common_pub_config") { 20 visibility = [ ":*" ] 21 22 include_dirs = [ "$HDF_FRAMEWORK_PATH/test/unittest/include" ] 23} 24if (defined(ohos_lite)) { 25 HDF_ADAPTER_PATH = "./../../../adapter" 26 ohos_shared_library("libhdf_test_common") { 27 subsystem_name = "hdf" 28 part_name = "hdf_core" 29 output_extension = "z.so" 30 sources = [ "$HDF_FRAMEWORK_PATH/test/unittest/common/hdf_common_test.c" ] 31 32 include_dirs = [ 33 "//third_party/bounds_checking_function/include", 34 "$HDF_FRAMEWORK_PATH/include/platform", 35 "$HDF_FRAMEWORK_PATH/include/core", 36 "$HDF_FRAMEWORK_PATH/include/osal", 37 "$HDF_FRAMEWORK_PATH/include/utils", 38 "$HDF_ADAPTER_PATH/uhdf/posix/include", 39 "$HDF_FRAMEWORK_PATH/test/unittest/include", 40 ] 41 42 ldflags = [ 43 "-lstdc++", 44 "-lm", 45 "-pthread", 46 ] 47 48 deps = [ 49 "$HDF_ADAPTER_PATH/uhdf/manager:hdf_core", 50 "$HDF_ADAPTER_PATH/uhdf/posix:hdf_posix_osal", 51 "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared", 52 ] 53 public_deps = [ "//third_party/bounds_checking_function:libsec_shared" ] 54 } 55} else { 56 ohos_shared_library("libhdf_test_common") { 57 public_configs = [ ":hdf_test_common_pub_config" ] 58 sources = [ "$HDF_FRAMEWORK_PATH/test/unittest/common/hdf_common_test.c" ] 59 60 include_dirs = [ "$HDF_FRAMEWORK_PATH/test/unittest/include" ] 61 62 defines = [ "__OHOS__USER__" ] 63 install_images = [ chipset_base_dir ] 64 subsystem_name = "hdf" 65 part_name = "hdf_core" 66 if (is_standard_system) { 67 deps = [ "../../uhdf2/utils:libhdf_utils" ] 68 external_deps = [ 69 "c_utils:utils", 70 "hilog:libhilog", 71 ] 72 } else { 73 external_deps = [ "hilog:libhilog" ] 74 } 75 } 76} 77