1# Copyright (c) 2021-2022 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 14common_sources = [ 15 "idle/le_idle.c", 16 "loop/le_epoll.c", 17 "loop/le_loop.c", 18 "signal/le_signal.c", 19 "socket/le_socket.c", 20 "task/le_asynctask.c", 21 "task/le_streamtask.c", 22 "task/le_task.c", 23 "task/le_watchtask.c", 24 "timer/le_timer.c", 25 "utils/le_utils.c", 26] 27 28common_include = [ 29 "//base/startup/init/services/log", 30 "//base/startup/init/interfaces/innerkits/include", 31 "include", 32 "loop", 33 "socket", 34 "task", 35 "timer", 36 "utils", 37 "signal", 38 "idle", 39] 40 41config("exported_header_files") { 42 visibility = [ ":*" ] 43 include_dirs = [ "//base/startup/init/services/loopevent/include" ] 44} 45 46if (defined(ohos_lite)) { 47 static_library("loopevent") { 48 sources = common_sources 49 cflags = [ "-fPIC" ] 50 include_dirs = common_include 51 external_deps = [ "bounds_checking_function:libsec_shared" ] 52 defines = [ "_GNU_SOURCE" ] 53 public_configs = [ ":exported_header_files" ] 54 } 55} else { 56 import("//build/ohos.gni") 57 58 ohos_static_library("loopevent") { 59 sources = common_sources 60 public_configs = [ ":exported_header_files" ] 61 include_dirs = common_include 62 external_deps = [ "bounds_checking_function:libsec_static" ] 63 defines = [ "_GNU_SOURCE" ] 64 part_name = "init" 65 subsystem_name = "startup" 66 } 67} 68 69group("loopeventgroup") { 70 if (defined(ohos_lite)) { 71 if (ohos_kernel_type == "linux") { 72 deps = [ ":loopevent" ] 73 } 74 } else { 75 deps = [ ":loopevent" ] 76 } 77} 78