1# Copyright (c) 2021-2023 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") 15 16rosen_is_ohos = current_os == "ohos" 17rosen_is_android = current_os == "android" 18rosen_is_ios = current_os == "ios" || current_os == "tvos" 19rosen_is_mac = current_os == "mac" 20rosen_is_win = current_os == "win" || current_os == "mingw" 21rosen_is_linux = current_os == "linux" 22 23rs_common_define = [] 24 25rosen_cross_platform = 26 current_os == "mac" || current_os == "mingw" || current_os == "linux" || 27 current_os == "android" || current_os == "ios" 28rosen_preview = rosen_is_mac || rosen_is_win || rosen_is_linux 29 30if (rosen_cross_platform) { 31 rs_common_define += [ 32 "ROSEN_CROSS_PLATFORM", 33 "ROSEN_DISABLE_DEBUGLOG", 34 "ROSEN_TRACE_DISABLE", 35 ] 36 if (runtime_mode == "release") { 37 rs_common_define += [ "RUNTIME_MODE_RELEASE" ] 38 } 39} 40 41if (use_rosen_drawing && defined(is_arkui_x) && is_arkui_x) { 42 rs_common_define += [ "USE_ROSEN_DRAWING" ] 43} 44 45if (is_emulator) { 46 rs_common_define += [ "ROSEN_EMULATOR" ] 47} 48 49if (rosen_preview) { 50 rs_common_define += [ "ROSEN_PREVIEW" ] 51} 52 53if (rosen_is_ohos) { 54 rs_common_define += [ "ROSEN_OHOS" ] 55} 56 57if (rosen_is_android) { 58 rs_common_define += [ "ROSEN_ANDROID" ] 59 rs_common_define += [ "USE_SURFACE_TEXTURE" ] 60 rs_common_define += [ "ROSEN_ARKUI_X" ] 61} 62 63if (rosen_is_ios) { 64 rs_common_define += [ "ROSEN_IOS" ] 65 rs_common_define += [ "USE_SURFACE_TEXTURE" ] 66 rs_common_define += [ "ROSEN_ARKUI_X" ] 67} 68 69if (rosen_is_mac) { 70 rs_common_define += [ "ROSEN_MAC" ] 71} 72 73if (rosen_is_win) { 74 rs_common_define += [ "ROSEN_WIN" ] 75} 76 77if (rosen_is_linux) { 78 rs_common_define += [ "ROSEN_LINUX" ] 79} 80 81enable_export_macro = true 82enable_ipc_security = true 83enable_ipc_security_access_counter = false 84 85accessibility_root = "//foundation/barrierfree/accessibility" 86appframework_root = "//foundation/appframework" 87resourceschedule_root = "//foundation/resourceschedule/frame_aware_sched" 88rosen_root = "//foundation/graphic/graphic_2d/rosen" 89