1# Copyright (c) 2021 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/ohos.gni") 15import("//foundation/ace/ace_engine/ace_config.gni") 16 17# Common config for Ability Cross-platform Environment(ACE) source 18config("ace_config") { 19 visibility = [ ":*" ] 20 include_dirs = [ 21 "$ace_root", 22 "$ace_root/frameworks", 23 "$root_out_dir/ace/framework", 24 "//third_party/zlib", 25 ] 26 27 # TODO: should not add here 28 if (is_standard_system && !use_mingw_win && !use_mac) { 29 include_dirs += [ 30 "//base/global/resmgr_standard/frameworks/resmgr/include", 31 "//base/global/resmgr_standard/interfaces/innerkits/include", 32 "$ace_root/adapter/ohos/services/uiservice/include", 33 ] 34 } 35 defines = ace_common_defines 36 37 if (is_wearable_product) { 38 defines += ace_wearable_defines 39 } 40 41 if (is_ivi_product) { 42 defines += ace_ivi_defines 43 } 44 45 if (defined(product_name) && 46 (product_name == "rk3566" || product_name == "rk3568")) { 47 defines += [ "PRODUCT_RK" ] 48 } 49 50 cflags = [ 51 "-fvisibility=hidden", 52 "-fdata-sections", 53 "-ffunction-sections", 54 "-Os", 55 ] 56 57 cflags_cc = [ 58 "-fvisibility-inlines-hidden", 59 "-Os", 60 ] 61 62 if (use_mingw_win) { 63 cflags += [ "-std=c++17" ] 64 defines += [ "_USE_MATH_DEFINES" ] 65 } 66} 67 68config("ace_test_config") { 69 visibility = [ ":*" ] 70 include_dirs = [ 71 "$ace_root", 72 "$ace_root/frameworks", 73 "$root_out_dir/ace/framework", 74 ] 75 cflags_cc = [] 76 defines = ace_common_defines 77 78 # TODO: should not add here 79 if (is_standard_system && !use_mingw_win && !use_mac) { 80 include_dirs += [ 81 "//base/global/resmgr_standard/frameworks/resmgr/include", 82 "//base/global/resmgr_standard/interfaces/innerkits/include", 83 ] 84 85 cflags_cc += [ 86 "-Wno-thread-safety-attributes", 87 "-Wno-thread-safety-analysis", 88 ] 89 defines += [ "OHOS_STANDARD_SYSTEM" ] 90 } 91 92 if (!is_standard_system) { 93 defines += [ "ENABLE_NATIVE_VIEW" ] 94 } 95 96 defines += [ "OHOS_PLATFORM" ] 97 98 if (is_wearable_product) { 99 defines += ace_wearable_defines 100 } 101 102 cflags = [ 103 "-fvisibility=hidden", 104 "-fdata-sections", 105 "-ffunction-sections", 106 ] 107 108 cflags_cc += [ "-fvisibility-inlines-hidden" ] 109} 110