1# Copyright (c) 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("${device_path}/config.gni") 15 16config("kernel_macros") { 17 if (ohos_kernel_type == "liteos_a") { 18 defines = [ 19 "__LITEOS__", 20 "__LITEOS_A__", 21 ] 22 } else if (ohos_kernel_type == "liteos_m") { 23 defines = [ 24 "__LITEOS__", 25 "__LITEOS_M__", 26 ] 27 } else if (ohos_kernel_type == "linux") { 28 defines = [ 29 "__linux__", 30 "__LINUX__", 31 ] 32 } 33} 34 35config("release") { 36 defines = [ "OHOS_RELEASE" ] 37} 38 39config("debug") { 40 defines = [ "OHOS_DEBUG" ] 41} 42 43config("board_config") { 44 cflags = [] 45 cflags_c = [] 46 cflags_cc = [] 47 asmflags = [] 48 ldflags = [] 49 include_dirs = [] 50 defines = [] 51 if (defined(board_cflags)) { 52 cflags += board_cflags 53 } 54 if (defined(board_c_cflags)) { 55 cflags_c += board_c_cflags 56 } 57 if (defined(board_cxx_flags)) { 58 cflags_cc += board_cxx_flags 59 } 60 if (defined(board_asmflags)) { 61 asmflags += board_asmflags 62 } 63 if (defined(board_ld_flags)) { 64 ldflags += board_ld_flags 65 } 66 if (defined(board_include_dirs)) { 67 include_dirs += board_include_dirs 68 } 69 if (defined(board_macro_defines)) { 70 defines += board_macro_defines 71 } 72} 73 74config("board_exe_ld_flags") { 75 ldflags = [] 76 if (defined(board_exe_ld_flags)) { 77 ldflags += board_exe_ld_flags 78 } 79} 80