1# Copyright (c) 2021 HiSilicon (Shanghai) Technologies CO., LIMITED. 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("//drivers/adapter/khdf/liteos/hdf.gni") 15 16group("drivers") { 17 deps = [ 18 "adc", 19 "dmac", 20 "gpio", 21 "hieth-sf", 22 "hisi_sdk", 23 "i2c", 24 "i2s", 25 "mipi_csi", 26 "mipi_dsi", 27 "mmc", 28 "mtd", 29 "pin", 30 "pwm", 31 "rtc", 32 "spi", 33 "timer", 34 "uart", 35 "watchdog", 36 ] 37} 38 39config("public") { 40 include_dirs = [] 41 if (defined(LOSCFG_COMPILER_CLANG_LLVM)) { 42 cur_compiler = "llvm" 43 } else { 44 cur_compiler = "gcc" 45 } 46 lib_dirs = [ "libs/ohos/$cur_compiler/$LOSCFG_PLATFORM" ] 47 ldflags = [ "-Wl,--push-state,--whole-archive" ] 48 if (defined(LOSCFG_DRIVERS_HIEDMAC)) { 49 ldflags += [ "-lhiedmac" ] 50 } 51 52 if (!defined(LOSCFG_DRIVERS_HDF_STORAGE_MTD)) { 53 if (defined(LOSCFG_DRIVERS_MTD)) { 54 include_dirs += [ "include/mtd/common/include" ] 55 ldflags += [ "-lmtd_common" ] 56 } 57 if (defined(LOSCFG_DRIVERS_MTD_SPI_NOR)) { 58 if (!defined(LOSCFG_SHELL)) { 59 ldflags += [ "-lspinor_flash_noshell" ] 60 } else { 61 ldflags += [ "-lspinor_flash" ] 62 } 63 } 64 if (defined(LOSCFG_DRIVERS_MTD_NAND)) { 65 ldflags += [ "-lnand_flash" ] 66 } 67 } 68 69 if (defined(LOSCFG_DRIVERS_MMC)) { 70 ldflags += [ "-lmmc" ] 71 } 72 if (defined(LOSCFG_DRIVERS_HDF_WIFI)) { 73 ldflags += [ "-lhdf_vendor_wifi" ] 74 } 75 if (defined(LOSCFG_DRIVERS_HDF_WIFI) && defined(LOSCFG_DRIVERS_HI3881)) { 76 ldflags += [ "-lhi3881" ] 77 } 78 ldflags += [ "-Wl,--pop-state" ] 79 if (defined(LOSCFG_DRIVERS_HDF_USB)) { 80 if (LOSCFG_PLATFORM == "hi3516dv300") { 81 ldflags += [ "-lusb_dwc3" ] 82 } 83 } 84} 85