1# Copyright (c) 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 14is_cross_platform_build = 15 defined(build_cross_platform_version) && build_cross_platform_version 16 17if (is_cross_platform_build) { 18 import("//build/config/config.gni") 19 if (is_android) { 20 ndk = aosp_ndk_root 21 ndk_host = "" 22 ndk_target = "" 23 ndk_gdbserver = "" 24 25 if (host_os == "linux") { 26 ndk_host = "linux-x86_64" 27 } else if (host_os == "mac") { 28 ndk_host = "darwin-x86_64" 29 } else if (host_os == "win") { 30 ndk_host = "windows-x86_64" 31 } 32 33 if (target_cpu == "arm64") { 34 ndk_target = "aarch64-linux-android" 35 ndk_gdbserver = "prebuilt/android-arm64/gdbserver/gdbserver" 36 } else if (target_cpu == "arm") { 37 ndk_target = "armv7a-linux-androideabi" 38 ndk_gdbserver = "prebuilt/android-arm/gdbserver/gdbserver" 39 } else if (target_cpu == "x64") { 40 ndk_target = "x86_64-linux-android" 41 ndk_gdbserver = "prebuilt/android-x86_64/gdbserver/gdbserver" 42 } else if (target_cpu == "x86") { 43 ndk_target = "i686-linux-android" 44 ndk_gdbserver = "prebuilt/android-x86/gdbserver/gdbserver" 45 } 46 } else if (is_ios) { 47 ios_min_target = "10.0" 48 ar = "ar" 49 cc = "clang" 50 cxx = "clang++" 51 win_vc = "" 52 win_toolchain_version = "" 53 clang_win = "" 54 cc_wrapper = "" 55 } 56} else { 57 is_android = host_os == "android" 58 is_mingw = current_os == "mingw" 59 is_ios = current_os == "ios" || current_os == "tvos" 60 is_ohos = current_os == "ohos" 61 is_tvos = current_os == "tvos" 62 is_linux = current_os == "linux" 63 is_mac = host_os == "mac" 64 65 if (!defined(is_win)) { 66 is_win = is_mingw 67 } 68} 69 70is_fuchsia = host_os == "fuchsia" 71sanitize_skia = "" 72