• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 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
14import("//build/lite/config/component/lite_component.gni")
15import("//third_party/jerryscript/engine.gni")
16
17lite_component("jerry-libm") {
18  if (ohos_kernel_type == "liteos_m") {
19    features = [ ":jerry-libm_static" ]
20  } else {
21    features = [ ":jerry-libm_shared" ]
22  }
23}
24
25jerry_libm_sources = [
26  "acos.c",
27  "acosh.c",
28  "asin.c",
29  "asinh.c",
30  "atan.c",
31  "atan2.c",
32  "atanh.c",
33  "cbrt.c",
34  "ceil.c",
35  "copysign.c",
36  "cosh.c",
37  "exp.c",
38  "expm1.c",
39  "fabs.c",
40  "finite.c",
41  "floor.c",
42  "fmod.c",
43  "isnan.c",
44  "log.c",
45  "log10.c",
46  "log1p.c",
47  "log2.c",
48  "nextafter.c",
49  "pow.c",
50  "scalbn.c",
51  "sinh.c",
52  "sqrt.c",
53  "tanh.c",
54  "trig.c",
55]
56
57jerry_libm_include_dirs = [ "include" ]
58
59config("jerry_libm_config") {
60  if (board_toolchain_type == "iccarm") {
61    cflags = [
62      "--diag_suppress",
63      "Pe039,Pa089,Pe222",
64    ]
65  }
66}
67
68if (ohos_kernel_type == "liteos_m") {
69  lite_library("jerry-libm_static") {
70    target_type = "static_library"
71    public_configs = [ ":jerry_libm_config" ]
72    sources = jerry_libm_sources
73    include_dirs = jerry_libm_include_dirs
74  }
75} else {
76  lite_library("jerry-libm_shared") {
77    target_type = "shared_library"
78    public_configs = [ ":jerry_libm_config" ]
79    sources = jerry_libm_sources
80    include_dirs = jerry_libm_include_dirs
81  }
82}
83