From c8a1407b1dc9e2a9e4fa92fefb6ae9924c4c5af6 Mon Sep 17 00:00:00 2001 From: Gavriloaie Eugen-Andrei Date: Thu, 14 Jan 2021 19:44:26 +0200 Subject: [PATCH] -- bitcode fix --- config/ios/BUILD.gn | 86 ++++++++++++++++++++++++--------------------- 1 file changed, 46 insertions(+), 40 deletions(-) diff --git a/config/ios/BUILD.gn b/config/ios/BUILD.gn index 374018e37..ba8114dfc 100644 --- a/config/ios/BUILD.gn +++ b/config/ios/BUILD.gn @@ -24,49 +24,48 @@ declare_args() { enable_ios_bitcode = false } +# CPU architecture. +if (current_cpu == "x64") { + triplet_cpu = "x86_64" +} else if (current_cpu == "x86") { + triplet_cpu = "i386" +} else if (current_cpu == "arm" || current_cpu == "armv7") { + triplet_cpu = "armv7" +} else if (current_cpu == "arm64") { + triplet_cpu = "arm64" +} else { + assert(false, "unsupported cpu: $current_cpu") +} + +# Environment. +if (ios_device_name == "macosx") { + target_environment = "catalyst" +} +if (target_environment == "simulator") { + triplet_environment = "-simulator" +} else if (target_environment == "device") { + triplet_environment = "" +} else if (target_environment == "catalyst") { + triplet_environment = "-macabi" +} else { + assert(false, "unsupported environment: $target_environment") +} + +# OS. +triplet_os = "" +if ((ios_device_name == "iphone") || (ios_device_name == "macosx")) { + triplet_os = "apple-ios" +} else if (ios_device_name == "appletv") { + triplet_os = "apple-tvos" +} else { + assert(false, "unsupported device: $ios_device_name") +} + # This is included by reference in the //build/config/compiler config that # is applied to all targets. It is here to separate out the logic. config("compiler") { # These flags are shared between the C compiler and linker. - common_flags = [] - - # CPU architecture. - if (current_cpu == "x64") { - triplet_cpu = "x86_64" - } else if (current_cpu == "x86") { - triplet_cpu = "i386" - } else if (current_cpu == "arm" || current_cpu == "armv7") { - triplet_cpu = "armv7" - } else if (current_cpu == "arm64") { - triplet_cpu = "arm64" - } else { - assert(false, "unsupported cpu: $current_cpu") - } - - # Environment. - if (ios_device_name == "macosx") { - target_environment = "catalyst" - } - if (target_environment == "simulator") { - triplet_environment = "-simulator" - } else if (target_environment == "device") { - triplet_environment = "" - } else if (target_environment == "catalyst") { - triplet_environment = "-macabi" - } else { - assert(false, "unsupported environment: $target_environment") - } - - # OS. - triplet_os = "" - if ((ios_device_name == "iphone") || (ios_device_name == "macosx")) { - triplet_os = "apple-ios" - } else if (ios_device_name == "appletv") { - triplet_os = "apple-tvos" - } else { - assert(false, "unsupported device: $ios_device_name") - } - + common_flags = [] # Set target. common_flags = [ @@ -127,7 +126,14 @@ config("runtime_library") { ] } - if (use_xcode_clang && enable_ios_bitcode && target_environment == "device") { + # print("use_xcode_clang: ${use_xcode_clang}") + # print("enable_ios_bitcode: ${enable_ios_bitcode}") + # print("target_environment: ${target_environment}") + + if (use_xcode_clang + && enable_ios_bitcode + && ((target_environment == "device") || (target_environment == "catalyst")) + ) { if (is_debug) { common_flags += [ "-fembed-bitcode-marker" ] } else {