• Home
  • Raw
  • Download

Lines Matching +full:build +full:- +full:and +full:- +full:deploy

1 ---
2 title: 'How to build Skia'
3 linkTitle: 'How to build Skia'
6 ---
14 ## `is_official_build` and Third-party Dependencies
16 Most users of Skia should set `is_official_build=true`, and most developers
19 This mode configures Skia in a way that's suitable to ship: an optimized build
20 with no debug symbols, dynamically linked against its third-party dependencies
23 In contrast, the developer-oriented default is an unoptimized build with full
24 debug symbols and all third-party dependencies built from source and embedded
25 into libskia. This is how we do all our manual and automated testing.
27 Skia offers several features that make use of third-party libraries, like
28 libpng, libwebp, or libjpeg-turbo to decode images, or ICU and sftnly to subset
29 fonts. All these third-party dependencies are optional and can be controlled by
32 If `skia_use_foo` is enabled, enabling `skia_use_system_foo` will build and link
33 Skia against the headers and libraries found on the system paths.
35 use `extra_cflags` and `extra_ldflags` to add include or library paths if
38 ## Supported and Preferred Compilers
40 While Skia should compile with GCC, MSVC, and other compilers, a number of
43 color space conversion and compile Skia with a compiler other than Clang, you
45 prioritization; there is nothing fundamentally wrong with non-Clang compilers.
48 Skia makes use of C++17 language features (compiles with `-std=c++17` flag) and
49 thus requires a C++17 compatible compiler. Clang 5 and later implement all of
51 produce non-obvious compilation errors. You can configure your build to use
52 specific executables for `cc` and `cxx` invocations using e.g.
53 `--args='cc="clang-6.0" cxx="clang++6.0"'` GN build arguments, as illustrated in
59 Run `gn gen` to generate your build files. As arguments to `gn gen`, pass a name
60 for your build directory, and optionally `--args=` to configure the build type.
62 To build Skia as a static library in a build directory named `out/Static`:
65 bin/gn gen out/Static --args='is_official_build=true'
68 To build Skia as a shared library (DLL) in a build directory named `out/Shared`:
71 bin/gn gen out/Shared --args='is_official_build=true is_component_build=true'
77 python2 tools/git-sync-deps
80 For a list of available build arguments, take a look at `gn/skia.gni`, or run:
83 bin/gn args out/Debug --list
86 GN allows multiple build folders to coexist; each build can be configured
91 bin/gn gen out/Release --args='is_debug=false'
92 bin/gn gen out/Clang --args='cc="clang" cxx="clang++"'
93 bin/gn gen out/Cached --args='cc_wrapper="ccache"'
94 bin/gn gen out/RTTI --args='extra_cflags_cc=["-frtti"]'
97 Once you have generated your build files, run Ninja to compile and link Skia:
100 ninja -C out/Static
109 To pull new changes and rebuild:
113 python tools/git-sync-deps
114 ninja -C out/Static
119 To build Skia for Android you need an
122 If you do not have an NDK and have access to CIPD, you can use one of these
131 When generating your GN build files, pass the path to your `ndk` and your
135 bin/gn gen out/arm --args='ndk="/tmp/ndk" target_cpu="arm"'
136 bin/gn gen out/arm64 --args='ndk="/tmp/ndk" target_cpu="arm64"'
137 bin/gn gen out/x64 --args='ndk="/tmp/ndk" target_cpu="x64"'
138 bin/gn gen out/x86 --args='ndk="/tmp/ndk" target_cpu="x86"'
141 Other arguments like `is_debug` and `is_component_build` continue to work.
144 To test on an Android device, push the binary and `resources` over, and run it
148 ninja -C out/arm64
151 adb shell "cd /data/local/tmp; ./dm --src gm --config gl"
156 To cross-compile Skia for arm ChromeOS devices the following is needed:
158 - Clang 4 or newer
159 - An armhf sysroot
160 - The (E)GL lib files on the arm chromebook to link against.
162 To compile Skia for an x86 ChromeOS device, one only needs Clang and the lib
178 and
190 "--target=armv7a-linux-gnueabihf",
191 "--sysroot=/opt/armhf_sysroot/",
192 "-march=armv7-a",
193 "-mfpu=neon",
194 "-mthumb",
197 "--target=armv7a-linux-gnueabihf",
198 "--sysroot=/opt/armhf_sysroot",
199 "-I/opt/chromebook_arm_gles/include",
200 "-I/opt/armhf_sysroot/include/",
201 "-I/opt/armhf_sysroot/include/c++/4.8.4/",
202 "-I/opt/armhf_sysroot/include/c++/4.8.4/arm-linux-gnueabihf/",
203 "-DMESA_EGL_NO_X11_HEADERS",
204 "-funwind-tables",
207 "--sysroot=/opt/armhf_sysroot",
208 "-B/opt/armhf_sysroot/bin",
209 "-B/opt/armhf_sysroot/gcc-cross",
210 "-L/opt/armhf_sysroot/gcc-cross",
211 "-L/opt/armhf_sysroot/lib",
212 "-L/opt/chromebook_arm_gles/lib",
213 "--target=armv7a-linux-gnueabihf",
225 "-I/opt/clang/include/c++/v1/",
226 "-I/opt/chromebook_x86_64_gles/include",
227 "-DMESA_EGL_NO_X11_HEADERS",
228 "-DEGL_NO_IMAGE_EXTERNAL",
231 "-stdlib=libc++",
232 "-fuse-ld=lld",
233 "-L/opt/chromebook_x86_64_gles/lib",
243 Push the binary to a chromebook via ssh and
250 sudo mount -i -o remount,exec /home/chronos
255 Mac users may want to pass `--ide=xcode` to `bin/gn gen` to generate an Xcode
260 Run GN to generate your build files. Set `target_os="ios"` to build for iOS.
264 bin/gn gen out/ios64 --args='target_os="ios"'
265 bin/gn gen out/ios32 --args='target_os="ios" target_cpu="arm"'
266 bin/gn gen out/iossim --args='target_os="ios" target_cpu="x64"'
269 This will also package (and for devices, sign) iOS test binaries. This defaults
270 to a Google signing identity and provisioning profile. To use a different one
271 set the GN args `skia_ios_identity` to match your code signing identity and
279 A list of identities can be found by typing `security find-identity` on the
287 For signed packages `ios-deploy` makes installing and running them on a device
291 ios-deploy -b out/Debug/dm.app -d --args "--match foo"
294 Alternatively you can generate an Xcode project by passing `--ide=xcode` to
296 `Project Settings...` and verify that `Build System:` is set to
297 `Legacy Build System`.
310 Skia can build on Windows with Visual Studio 2017 or 2019. If GN is unable to
315 [Build Tools for Visual Studio 2017 or 2019](https://www.visualstudio.com/downloads/#build-tools-fo…
323 You can then pass the VC and SDK paths to GN by setting your GN args:
330 This toolchain is the only way we support 32-bit builds, by also setting
333 The Skia build assumes that the PATHEXT environment variable contains ".EXE".
335 ### **Highly Recommended**: Build with clang-cl
340 Setting the `cc` and `cxx` gn args is _not_ sufficient to build with clang-cl.
350 Follow the standard Windows path specification and not MinGW convention (e.g.
355 If you use Visual Studio, you may want to pass `--ide=vs` to `bin/gn gen` to
357 specific configuration, and will only build/run that configuration.
362 `--ide=vs` when running `bin/gn gen` for each one. Then:
368 This creates a new dedicated output directory and solution file
370 and supports building and running any of them. It also adjusts syntax
377 [Windows 10 on ARM](https://docs.microsoft.com/en-us/windows/arm/). This
378 currently requires (a recent version of) MSVC, and the
379 `Visual C++ compilers and libraries for ARM64` individual component in the
385 out, and will not work. ANGLE is supported:
388 bin/gn gen out/win-arm64 --args='target_cpu="arm64" skia_use_angle=true'
391 This will produce a build of Skia that can use the software or ANGLE backends,
392 in DM. Viewer only works when launched with `--backend angle`, because the
397 We have added a GN-to-CMake translator mainly for use with IDEs that like CMake
401 bin/gn gen out/config --ide=json --json-ide-script=../../gn/gn_to_cmake.py