blob: 57292c750d9f4f6d28fa1083e20894bae2da2921 [file] [log] [blame]
# Copyright 2013 The Flutter Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
if (is_android) {
import("//build/config/android/config.gni")
}
if (target_cpu == "arm" || target_cpu == "arm64") {
import("//build/config/arm.gni")
}
declare_args() {
# The runtime mode ("debug", "profile", "release", or "jit_release")
flutter_runtime_mode = "debug"
# Whether to link the Skia text shaper module into the engine
flutter_enable_skshaper = false
# Whether to use the Skia text shaper module for all text rendering
flutter_always_use_skshaper = false
# Whether to use a prebuilt Dart SDK instead of building one.
flutter_prebuilt_dart_sdk = false
}
# feature_defines_list ---------------------------------------------------------
feature_defines_list = [
"FLUTTER_RUNTIME_MODE_DEBUG=1",
"FLUTTER_RUNTIME_MODE_PROFILE=2",
"FLUTTER_RUNTIME_MODE_RELEASE=3",
"FLUTTER_RUNTIME_MODE_JIT_RELEASE=4",
"DART_LEGACY_API=[[deprecated]]",
]
if (flutter_runtime_mode == "debug") {
feature_defines_list += [
"FLUTTER_RUNTIME_MODE=1",
"FLUTTER_JIT_RUNTIME=1",
]
} else if (flutter_runtime_mode == "profile") {
feature_defines_list += [ "FLUTTER_RUNTIME_MODE=2" ]
} else if (flutter_runtime_mode == "release") {
feature_defines_list += [
"FLUTTER_RUNTIME_MODE=3",
"FLUTTER_RELEASE=1",
]
} else if (flutter_runtime_mode == "jit_release") {
feature_defines_list += [
"FLUTTER_RUNTIME_MODE=4",
"FLUTTER_RELEASE=1",
"FLUTTER_JIT_RUNTIME=1",
]
} else {
feature_defines_list += [ "FLUTTER_RUNTIME_MODE=0" ]
}
if (is_ios || is_mac) {
flutter_cflags_objc = [
"-Werror=overriding-method-mismatch",
"-Werror=undeclared-selector",
]
flutter_cflags_objcc = flutter_cflags_objc
flutter_cflags_objc_arc = flutter_cflags_objc + [ "-fobjc-arc" ]
flutter_cflags_objcc_arc = flutter_cflags_objc_arc
}
# prebuilt Dart SDK location
if (flutter_prebuilt_dart_sdk) {
_target_os_name = target_os
if (_target_os_name == "mac") {
_target_os_name = "macos"
} else if (_target_os_name == "win" || _target_os_name == "winuwp") {
_target_os_name = "windows"
}
_host_os_name = host_os
if (_host_os_name == "mac") {
_host_os_name = "macos"
} else if (_host_os_name == "win" || _host_os_name == "winuwp") {
_host_os_name = "windows"
}
target_prebuilt_dart_sdk =
"//flutter/prebuilts/$_target_os_name-$target_cpu/dart-sdk"
host_prebuilt_dart_sdk =
"//flutter/prebuilts/$_host_os_name-$host_cpu/dart-sdk"
}