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