diff --git a/engine/src/flutter/build/copy_info_plist.py b/engine/src/flutter/build/copy_info_plist.py index 63c9ac2614..a87e1a8c98 100644 --- a/engine/src/flutter/build/copy_info_plist.py +++ b/engine/src/flutter/build/copy_info_plist.py @@ -10,22 +10,32 @@ engine. Precondition: $CWD/../../flutter is the path to the flutter engine repo. -usage: copy_info_plist.py +usage: copy_info_plist.py --bitcode= """ from __future__ import absolute_import from __future__ import division from __future__ import print_function +import subprocess import sys import git_revision import os +def GetClangVersion(bitcode) : + clang_executable = str(os.path.join("..", "..", "buildtools", "mac-x64", "clang", "bin", "clang++")) + if bitcode: + clang_executable = "clang++" + version = subprocess.check_output([clang_executable, "--version"]) + return version.splitlines()[0] + def main(): text = open(sys.argv[1]).read() engine_path = os.path.join(os.getcwd(), "..", "..", "flutter") revision = git_revision.GetRepositoryVersion(engine_path) - text = text.format(revision) + clang_version = GetClangVersion(sys.argv[3] == "--bitcode=true") + text = text.format(revision, clang_version) + with open(sys.argv[2], "w") as outfile: outfile.write(text) diff --git a/engine/src/flutter/shell/platform/darwin/ios/BUILD.gn b/engine/src/flutter/shell/platform/darwin/ios/BUILD.gn index e9c7489d06..1416bd34e9 100644 --- a/engine/src/flutter/shell/platform/darwin/ios/BUILD.gn +++ b/engine/src/flutter/shell/platform/darwin/ios/BUILD.gn @@ -5,6 +5,7 @@ assert(is_ios) import("//build/config/ios/ios_sdk.gni") +import("//build/toolchain/clang.gni") import("$flutter_root/common/config.gni") import("$flutter_root/shell/gpu/gpu.gni") import("$flutter_root/shell/platform/darwin/common/framework_shared.gni") @@ -189,6 +190,7 @@ action("copy_framework_info_plist") { args = [ rebase_path(sources[0]), rebase_path(outputs[0]), + "--bitcode=$enable_bitcode", ] } diff --git a/engine/src/flutter/shell/platform/darwin/ios/framework/Info.plist b/engine/src/flutter/shell/platform/darwin/ios/framework/Info.plist index 88f5dc4dfa..420e8034b9 100644 --- a/engine/src/flutter/shell/platform/darwin/ios/framework/Info.plist +++ b/engine/src/flutter/shell/platform/darwin/ios/framework/Info.plist @@ -24,5 +24,7 @@ 8.0 FlutterEngine {0} + ClangVersion + {1} diff --git a/engine/src/flutter/shell/platform/embedder/BUILD.gn b/engine/src/flutter/shell/platform/embedder/BUILD.gn index 2ccdb119b3..5efec1fb63 100644 --- a/engine/src/flutter/shell/platform/embedder/BUILD.gn +++ b/engine/src/flutter/shell/platform/embedder/BUILD.gn @@ -2,6 +2,7 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. +import("//build/toolchain/clang.gni") import("$flutter_root/common/config.gni") import("$flutter_root/shell/gpu/gpu.gni") import("$flutter_root/shell/platform/embedder/embedder.gni") @@ -165,6 +166,7 @@ if (is_mac && !embedder_for_target) { args = [ rebase_path(sources[0]), rebase_path(outputs[0]), + "--bitcode=$enable_bitcode", ] } diff --git a/engine/src/flutter/shell/platform/embedder/assets/EmbedderInfo.plist b/engine/src/flutter/shell/platform/embedder/assets/EmbedderInfo.plist index cde28b62c0..f7b28cbbcb 100644 --- a/engine/src/flutter/shell/platform/embedder/assets/EmbedderInfo.plist +++ b/engine/src/flutter/shell/platform/embedder/assets/EmbedderInfo.plist @@ -26,5 +26,7 @@ Copyright 2013 The Flutter Authors. All rights reserved. FlutterEngine {0} + ClangVersion + {1}