skia2/experimental/minimal_ios_mtl_skia_app/BUILD.gn
Hal Canary c2dc9c8648 experimental/minimal_ios_mtl_skia_app
Change-Id: Iec5b9d9b930cb8b2b97ce92c828ccba0a9e2a94d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/238757
Auto-Submit: Hal Canary <halcanary@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2019-09-04 14:44:02 +00:00

97 lines
2.6 KiB
Plaintext

# Copyright 2019 Google LLC.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("../../gn/skia.gni")
if (is_ios) {
template("ios_app") {
app_name = target_name
gen_path = target_gen_dir
executable("${app_name}_generate_executable") {
forward_variables_from(invoker,
"*",
[
"output_name",
"visibility",
"is_shared_library",
])
output_name = rebase_path("$gen_path/$app_name", root_build_dir)
}
action("${app_name}_generate_info_plist") {
script = "//gn/gen_plist_ios.py"
outputs = [
"$gen_path/${app_name}_Info.plist",
]
args = [ rebase_path("$gen_path/$app_name", root_build_dir) ]
}
bundle_data("${app_name}_bundle_info_plist") {
public_deps = [
":${app_name}_generate_info_plist",
]
sources = [
"$gen_path/${app_name}_Info.plist",
]
outputs = [
"{{bundle_root_dir}}/Info.plist",
]
}
bundle_data("${app_name}_bundle_executable") {
public_deps = [
":${app_name}_generate_executable",
]
sources = [
"$gen_path/$app_name",
]
outputs = [
"{{bundle_executable_dir}}/$app_name",
]
}
create_bundle("$app_name") {
product_type = "com.apple.product-type.application"
bundle_root_dir = "${root_build_dir}/${target_name}.app"
bundle_resources_dir = bundle_root_dir
bundle_executable_dir = bundle_root_dir
deps = [
":${app_name}_bundle_executable",
":${app_name}_bundle_info_plist",
]
# should only code sign when running on a device, not the simulator
if (target_cpu != "x64") {
code_signing_script = "//gn/codesign_ios.py"
code_signing_sources = [ "$target_gen_dir/$app_name" ]
code_signing_outputs = [
"$bundle_root_dir/_CodeSignature/CodeResources",
"$bundle_root_dir/embedded.mobileprovision",
]
code_signing_args = [
rebase_path("$bundle_root_dir", root_build_dir),
skia_ios_identity,
skia_ios_profile,
]
}
}
}
}
if (is_ios && skia_use_metal) {
ios_app("minimal_ios_mtl_skia_app") {
sources = [
"main.mm",
]
deps = [
"../..:skia",
]
cflags_objcc = [
"-std=c++14",
"-w",
]
libs = [
"Metal.framework",
"MetalKit.framework",
"UIKit.framework",
]
}
}