# Copyright (c) 2022 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import("//build/lite/config/component/lite_component.gni") import("//third_party/jerryscript/engine.gni") lite_component("jerry-libm") { if (ohos_kernel_type == "liteos_m") { features = [ ":jerry-libm_static" ] } else { features = [ ":jerry-libm_shared" ] } } jerry_libm_sources = [ "acos.c", "acosh.c", "asin.c", "asinh.c", "atan.c", "atan2.c", "atanh.c", "cbrt.c", "ceil.c", "copysign.c", "cosh.c", "exp.c", "expm1.c", "fabs.c", "finite.c", "floor.c", "fmod.c", "isnan.c", "log.c", "log10.c", "log1p.c", "log2.c", "nextafter.c", "pow.c", "scalbn.c", "sinh.c", "sqrt.c", "tanh.c", "trig.c", ] jerry_libm_include_dirs = [ "include" ] config("jerry_libm_config") { if (board_toolchain_type == "iccarm") { cflags = [ "--diag_suppress", "Pe039,Pa089,Pe222", ] } } if (ohos_kernel_type == "liteos_m") { lite_library("jerry-libm_static") { target_type = "static_library" public_configs = [ ":jerry_libm_config" ] sources = jerry_libm_sources include_dirs = jerry_libm_include_dirs } } else { lite_library("jerry-libm_shared") { target_type = "shared_library" public_configs = [ ":jerry_libm_config" ] sources = jerry_libm_sources include_dirs = jerry_libm_include_dirs } }