import("gn/android_framework_defines.gni")
import("gn/shared_sources.gni")
-if (!defined(is_skia_standalone)) {
- is_skia_standalone = false
-}
-
declare_args() {
skia_use_angle = false
skia_use_expat = true
skia_enable_android_framework_defines = false
skia_enable_discrete_gpu = true
skia_enable_effects = true
- skia_enable_jumper = is_skia_standalone
+ skia_enable_jumper = !is_official_build
skia_enable_gpu = true
skia_enable_pdf = true
- skia_enable_tools = is_skia_standalone
- skia_enable_vulkan_debug_layers = is_skia_standalone && is_debug
+ skia_enable_tools = !is_official_build
+ skia_enable_vulkan_debug_layers = !is_official_build && is_debug
skia_vulkan_sdk = getenv("VULKAN_SDK")
}
declare_args() {
if (is_android) {
deps += [ "//third_party/expat" ]
- if (is_skia_standalone && ndk != "") {
+ if (defined(ndk) && ndk != "") {
deps += [ "//third_party/cpu-features" ]
}
sources += [ "src/ports/SkDebug_android.cpp" ]
}
}
- if (is_android && is_skia_standalone && ndk != "") {
+ if (is_android && defined(ndk) && ndk != "") {
copy("gdbserver") {
sources = [
"$ndk/$ndk_gdbserver",
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-is_skia_standalone = true
-
# It's best to keep the names and defaults of is_foo flags consistent with Chrome.
declare_args() {
# We'll run GN to get the main source lists and include directories for Skia.
gn_args = {
- 'skia_enable_vulkan_debug_layers': 'false',
- 'skia_use_system_expat': 'true',
- 'skia_use_system_jsoncpp': 'true',
- 'skia_use_system_libpng': 'true',
- 'skia_use_system_zlib': 'true',
- 'skia_use_vulkan': 'true',
- 'target_cpu': '"none"',
- 'target_os': '"android"',
+ 'is_official_build': 'true',
+ 'skia_enable_jumper': 'true',
+ 'skia_enable_tools': 'true',
+ 'skia_use_vulkan': 'true',
+ 'target_cpu': '"none"',
+ 'target_os': '"android"',
}
gn_args = ' '.join(sorted('%s=%s' % (k,v) for (k,v) in gn_args.iteritems()))
# Most defines go into SkUserConfig.h, where they're seen by Skia and its users.
# Start with the defines :skia uses, minus a couple. We'll add more in a bit.
defines = [str(d) for d in js['targets']['//:skia']['defines']]
+defines.remove('NDEBUG') # Let the Android build control this.
defines.remove('SKIA_IMPLEMENTATION=1') # Only libskia should have this define.
# For architecture specific files, it's easier to just read the same source
"[CUSTOM_/_B_WORK]/skia/bin/gn",
"gen",
"[CUSTOM_/_B_WORK]/skia/out/Build-Ubuntu-Clang-x86_64-Release-Mini/Release",
- "--args=cc=\"[START_DIR]/clang_linux/bin/clang\" cxx=\"[START_DIR]/clang_linux/bin/clang++\" extra_ldflags=[\"-fuse-ld=lld\"] is_component_build=true is_debug=false is_official_build=true skia_enable_effects=false skia_enable_gpu=false skia_enable_pdf=false skia_enable_tools=false skia_use_expat=false skia_use_libjpeg_turbo=false skia_use_libpng=false skia_use_libwebp=false skia_use_zlib=false target_cpu=\"x86_64\""
+ "--args=cc=\"[START_DIR]/clang_linux/bin/clang\" cxx=\"[START_DIR]/clang_linux/bin/clang++\" extra_ldflags=[\"-fuse-ld=lld\"] is_component_build=true is_debug=false is_official_build=true skia_enable_effects=false skia_enable_gpu=false skia_enable_pdf=false skia_use_expat=false skia_use_libjpeg_turbo=false skia_use_libpng=false skia_use_libwebp=false skia_use_zlib=false target_cpu=\"x86_64\""
],
"cwd": "[CUSTOM_/_B_WORK]/skia",
"env": {
if extra_config == 'Mini':
args.update({
'is_component_build': 'true', # Proves we can link a coherent .so.
- 'is_official_build': 'true', # No debug symbols.
+ 'is_official_build': 'true', # No debug symbols, no tools.
'skia_enable_effects': 'false',
'skia_enable_gpu': 'false',
'skia_enable_pdf': 'false',
- 'skia_enable_tools': 'false', # Some tools need GPU or effects.
'skia_use_expat': 'false',
'skia_use_libjpeg_turbo': 'false',
'skia_use_libpng': 'false',
Skia uses [GN](https://chromium.googlesource.com/chromium/src/tools/gn/) to
configure its builds.
+`is_official_build` and Third-party Dependencies
+------------------------------------------------
+
+Most users of Skia should set `is_official_build=true`, and most developers
+should leave it to its `false` default.
+
+This mode configures Skia in a way that's suitable to ship: an optimized build
+with no debug symbols, dynamically linked against its third-party dependencies
+using the ordinary library search path.
+
+In contrast, the developer-oriented default is an unoptimized build with full
+debug symbols and all third-party dependencies built from source and embedded
+into libskia. This is how do all our manual and automated testing.
+
+Skia offers several features that make use of third-party libraries, like
+libpng, libwebp, or libjpeg-turbo to decode images, or ICU and sftnly to subset
+fonts. All these third-party dependencies are optional and can be controlled
+by a GN argument that looks something like `skia_use_foo` for appropriate
+`foo`.
+
+If `skia_use_foo` is enabled, enabling `skia_use_system_foo` will build and
+link Skia against the headers and libaries found on the system paths.
+`is_official_build=true` enables all `skia_use_system_foo` by default. You can
+use `extra_cflags` and `extra_ldflags` to add include or library paths if
+needed.
+
Quickstart
----------
project descriptions. This is not meant for any purpose beyond development.
bin/gn gen out/config --ide=json --json-ide-script=../../gn/gn_to_cmake.py
-
-Third-party Dependencies
-------------------------
-
-Skia offers several features that make use of third-party libraries, like
-libpng, libwebp, or libjpeg-turbo to decode images, or ICU and sftnly to subset
-fonts. All these third-party dependencies are optional, and can be controlled
-by a GN argument that looks something like `skia_use_foo` for appropriate
-`foo`.
-
-Most of these third-party dependencies can also be satisfied by pre-built
-system libraries. If `skia_use_foo` is enabled, turn on `skia_use_system_foo`
-to build and link Skia against the headers and libaries found on the system
-paths. You can use `extra_cflags` and `extra_ldflags` to add include or
-library paths if needed.
-
-By default Skia will build and embed its own copies of these third-party
-libraries. This configuration is for development only. We do not recommend
-shipping Skia this way. However, this is the only configuration of Skia that
-receives significant testing.
# found in the LICENSE file.
declare_args() {
- skia_use_system_expat = false
+ skia_use_system_expat = is_official_build
}
import("../third_party.gni")
# found in the LICENSE file.
declare_args() {
- # TODO: false? i.e. build from source all the time for testing?
- skia_use_system_freetype2 = !(is_android || sanitize == "MSAN")
+ # TODO: build from source all the time for testing?
+ skia_use_system_freetype2 =
+ is_official_build || !(is_android || sanitize == "MSAN")
}
import("../third_party.gni")
# found in the LICENSE file.
declare_args() {
- skia_use_system_icu = false
+ skia_use_system_icu = is_official_build
}
import("../third_party.gni")
# found in the LICENSE file.
declare_args() {
- skia_use_system_jsoncpp = false
+ skia_use_system_jsoncpp = is_official_build
}
import("../third_party.gni")
# found in the LICENSE file.
declare_args() {
- skia_use_system_libjpeg_turbo = false
+ skia_use_system_libjpeg_turbo = is_official_build
}
import("../third_party.gni")
# found in the LICENSE file.
declare_args() {
- skia_use_system_libpng = false
+ skia_use_system_libpng = is_official_build
}
import("../third_party.gni")
# found in the LICENSE file.
declare_args() {
- skia_use_system_libwebp = false
+ skia_use_system_libwebp = is_official_build
}
import("../third_party.gni")
# found in the LICENSE file.
declare_args() {
- skia_use_system_lua = false
+ skia_use_system_lua = is_official_build
}
import("../third_party.gni")
# found in the LICENSE file.
declare_args() {
- skia_use_system_zlib = false
+ skia_use_system_zlib = is_official_build
}
import("../third_party.gni")