• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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  "loop/le_epoll.c",
16  "loop/le_loop.c",
17  "signal/le_signal.c",
18  "socket/le_socket.c",
19  "task/le_asynctask.c",
20  "task/le_streamtask.c",
21  "task/le_task.c",
22  "task/le_watchtask.c",
23  "timer/le_timer.c",
24  "utils/le_utils.c",
25]
26
27common_include = [
28  "//base/startup/init/services/log",
29  "//base/startup/init/interfaces/innerkits/include",
30  "//base/startup/init/services/include",
31  "//third_party/bounds_checking_function/include",
32  "include",
33  "loop",
34  "socket",
35  "task",
36  "timer",
37  "utils",
38  "signal",
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    defines = [ "_GNU_SOURCE" ]
52    public_configs = [ ":exported_header_files" ]
53  }
54} else {
55  import("//build/ohos.gni")
56
57  ohos_static_library("loopevent") {
58    sources = common_sources
59    public_configs = [ ":exported_header_files" ]
60    include_dirs = common_include
61    defines = [ "_GNU_SOURCE" ]
62    part_name = "init"
63    subsystem_name = "startup"
64  }
65}
66
67group("loopeventgroup") {
68  if (defined(ohos_lite)) {
69    if (ohos_kernel_type == "linux") {
70      deps = [ ":loopevent" ]
71    }
72  } else {
73    deps = [ ":loopevent" ]
74  }
75}
76