1# Copyright (c) 2020 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/lite/config/component/lite_component.gni")
15
16declare_args() {
17  enable_timertask = false
18}
19
20if (ohos_kernel_type == "liteos_a" || ohos_kernel_type == "linux") {
21  lite_component("safwk_lite") {
22    features = [ ":foundation" ]
23  }
24
25  # feature: foundation
26  executable("foundation") {
27    cflags = [ "-Wall" ]
28    cflags_cc = cflags
29
30    sources = [ "src/main.c" ]
31
32    include_dirs = [
33      "//commonlibrary/utils_lite/include",
34      "//foundation/systemabilitymgr/samgr_lite/interfaces/kits/samgr",
35    ]
36
37    ldflags = [
38      "-lstdc++",
39      "-Wl,-Map=foundation.map",
40    ]
41
42    deps = [
43      "${aafwk_lite_path}/services/abilitymgr_lite:abilityms",
44      "${appexecfwk_lite_path}/services/bundlemgr_lite:bundlems",
45      "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared",
46      "//base/security/permission_lite/services/ipc_auth:ipc_auth_target",
47      "//base/security/permission_lite/services/pms:pms_target",
48      "//foundation/systemabilitymgr/samgr_lite/samgr_server:server",
49    ]
50    if (enable_timertask == true) {
51      deps += [ "//base/update/dupdate/services/timertask_lite:timertask" ]
52    }
53    if (board_name != "hispark_aries") {
54      deps += [ "//foundation/ability/dmsfwk_lite:dtbschedmgr" ]
55    }
56  }
57}
58