diff options
author | brettw <brettw@chromium.org> | 2016-09-01 14:24:39 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-09-01 14:24:39 -0700 |
commit | b944728b93a1623d73be31413a6798e0b7dddc16 (patch) | |
tree | 51918dbc3a20860fb52b44454de248550ec3ec5b | |
parent | 59be20c8d532a81992a9ec73b6a39265a479fce5 (diff) |
Move Skia GN sources to a separate .gni file.
This file will be imported by Chrome to access the sources lists.
Once Chrome is updated to use this file, changes to the skia .gypi layout can
be done entirely within the skia repository as long as the resulting lists
produced by the new .gni file have the same name.
Marks skia_for_chromium_defines as obsolete and moves the definition into the new .gni file. We can remove the .gypi file when Chrome is updated.
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2302803005
Review-Url: https://codereview.chromium.org/2302803005
-rw-r--r-- | BUILD.gn | 110 | ||||
-rw-r--r-- | gn/shared_sources.gni | 96 | ||||
-rw-r--r-- | gyp/skia_for_chromium_defines.gypi | 3 |
3 files changed, 126 insertions, 83 deletions
@@ -3,6 +3,8 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. +import("//gn/shared_sources.gni") + declare_args() { skia_enable_tools = !is_fuchsia && !is_component_build @@ -90,69 +92,6 @@ skia_library_configs = [ ":skia_library", ] -core_gypi = exec_script("gn/gypi_to_gn.py", - [ - rebase_path("gyp/core.gypi"), - "--replace=<(skia_include_path)=include", - "--replace=<(skia_src_path)=src", - ], - "scope", - [ "gyp/core.gypi" ]) - -effects_gypi = exec_script("gn/gypi_to_gn.py", - [ - rebase_path("gyp/effects.gypi"), - "--replace=<(skia_include_path)=include", - "--replace=<(skia_src_path)=src", - ], - "scope", - [ "gyp/effects.gypi" ]) - -gpu_gypi = exec_script("gn/gypi_to_gn.py", - [ - rebase_path("gyp/gpu.gypi"), - "--replace=<(skia_include_path)=include", - "--replace=<(skia_src_path)=src", - ], - "scope", - [ "gyp/gpu.gypi" ]) - -opts_gypi = exec_script("gn/gypi_to_gn.py", - [ - rebase_path("gyp/opts.gypi"), - "--replace=<(skia_include_path)=include", - "--replace=<(skia_src_path)=src", - ], - "scope", - [ "gyp/opts.gypi" ]) - -pdf_gypi = exec_script("gn/gypi_to_gn.py", - [ - rebase_path("gyp/pdf.gypi"), - "--replace=<(skia_include_path)=include", - "--replace=<(skia_src_path)=src", - ], - "scope", - [ "gyp/pdf.gypi" ]) - -sksl_gypi = exec_script("gn/gypi_to_gn.py", - [ - rebase_path("gyp/sksl.gypi"), - "--replace=<(skia_include_path)=include", - "--replace=<(skia_src_path)=src", - ], - "scope", - [ "gyp/sksl.gypi" ]) - -utils_gypi = exec_script("gn/gypi_to_gn.py", - [ - rebase_path("gyp/utils.gypi"), - "--replace=<(skia_include_path)=include", - "--replace=<(skia_src_path)=src", - ], - "scope", - [ "gyp/utils.gypi" ]) - # Use for CPU-specific Skia code that needs particular compiler flags. template("opts") { if (invoker.enabled) { @@ -177,61 +116,61 @@ is_x86 = current_cpu == "x64" || current_cpu == "x86" opts("none") { enabled = !is_x86 && current_cpu != "arm" && current_cpu != "arm64" - sources = opts_gypi.none_sources + sources = skia_opts.none_sources cflags = [] } opts("armv7") { enabled = current_cpu == "arm" - sources = opts_gypi.armv7_sources + opts_gypi.neon_sources + sources = skia_opts.armv7_sources + skia_opts.neon_sources cflags = [] } opts("arm64") { enabled = current_cpu == "arm64" - sources = opts_gypi.arm64_sources + sources = skia_opts.arm64_sources cflags = [] } opts("crc32") { enabled = current_cpu == "arm64" - sources = opts_gypi.crc32_sources + sources = skia_opts.crc32_sources cflags = [ "-march=armv8-a+crc" ] } opts("sse2") { enabled = is_x86 - sources = opts_gypi.sse2_sources + sources = skia_opts.sse2_sources cflags = [ "-msse2" ] } opts("ssse3") { enabled = is_x86 - sources = opts_gypi.ssse3_sources + sources = skia_opts.ssse3_sources cflags = [ "-mssse3" ] } opts("sse41") { enabled = is_x86 - sources = opts_gypi.sse41_sources + sources = skia_opts.sse41_sources cflags = [ "-msse4.1" ] } opts("sse42") { enabled = is_x86 - sources = opts_gypi.sse42_sources + sources = skia_opts.sse42_sources cflags = [ "-msse4.2" ] } opts("avx") { enabled = is_x86 - sources = opts_gypi.avx_sources + sources = skia_opts.avx_sources cflags = [ "-mavx" ] } opts("dsp") { enabled = current_cpu == "mipsel" - sources = opts_gypi.mips_dsp_sources + sources = skia_opts.mips_dsp_sources cflags = [] } @@ -335,7 +274,7 @@ optional("pdf") { deps = [ "//third_party/zlib", ] - sources = pdf_gypi.sources + sources = skia_pdf_sources sources_when_disabled = [ "src/pdf/SkDocument_PDF_None.cpp" ] if (skia_use_sfntly) { @@ -424,11 +363,11 @@ component("skia") { ] sources = [] - sources += core_gypi.sources - sources += effects_gypi.sources - sources += gpu_gypi.skgpu_sources - sources += sksl_gypi.sources - sources += utils_gypi.sources + sources += skia_core_sources + sources += skia_effects_sources + sources += skia_gpu_sources + sources += skia_sksl_sources + sources += skia_utils_sources sources += [ "src/android/SkBitmapRegionCodec.cpp", "src/android/SkBitmapRegionDecoder.cpp", @@ -462,10 +401,15 @@ component("skia") { "third_party/etc1/etc1.cpp", "third_party/ktx/ktx.cpp", ] - sources -= [ - "src/gpu/gl/GrGLCreateNativeInterface_none.cpp", - "src/gpu/gl/GrGLDefaultInterface_none.cpp", - ] + + # These paths need to be absolute to match the ones produced by + # shared_sources.gni, but this file may be used from different directory + # locations. + sources -= get_path_info([ + "src/gpu/gl/GrGLCreateNativeInterface_none.cpp", + "src/gpu/gl/GrGLDefaultInterface_none.cpp", + ], + "abspath") libs = [] diff --git a/gn/shared_sources.gni b/gn/shared_sources.gni new file mode 100644 index 0000000000..8525883e7c --- /dev/null +++ b/gn/shared_sources.gni @@ -0,0 +1,96 @@ +# Copyright 2016 Google Inc. +# +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +# This file is used to shared GN source lists between the standalone Skia +# and Chrome skia build. All paths produced by this header must be +# source-absolute since it will be included in different contexts in each +# checkout. +_path_to_include = get_path_info("../include", "abspath") +_path_to_src = get_path_info("../src", "abspath") + +# Core. +_core_gypi = exec_script("gypi_to_gn.py", + [ + rebase_path("../gyp/core.gypi"), + "--replace=<(skia_include_path)=$_path_to_include", + "--replace=<(skia_src_path)=$_path_to_src", + ], + "scope", + [ "../gyp/core.gypi" ]) +skia_core_sources = _core_gypi.sources + +# Effects. +_effects_gypi = + exec_script("gypi_to_gn.py", + [ + rebase_path("../gyp/effects.gypi"), + "--replace=<(skia_include_path)=$_path_to_include", + "--replace=<(skia_src_path)=$_path_to_src", + ], + "scope", + [ "../gyp/effects.gypi" ]) +skia_effects_sources = _effects_gypi.sources + +# GPU. +_gpu_gypi = exec_script("gypi_to_gn.py", + [ + rebase_path("../gyp/gpu.gypi"), + "--replace=<(skia_include_path)=$_path_to_include", + "--replace=<(skia_src_path)=$_path_to_src", + ], + "scope", + [ "../gyp/gpu.gypi" ]) +skia_gpu_sources = _gpu_gypi.skgpu_sources +skia_null_gpu_sources = _gpu_gypi.skgpu_null_gl_sources + +# Opts. +# +# Unlike the other variables here, this is a "scope" consisting of many +# sub-lists. +skia_opts = exec_script("gypi_to_gn.py", + [ + rebase_path("../gyp/opts.gypi"), + "--replace=<(skia_include_path)=$_path_to_include", + "--replace=<(skia_src_path)=$_path_to_src", + ], + "scope", + [ "../gyp/opts.gypi" ]) + +# PDF. +_pdf_gypi = exec_script("gypi_to_gn.py", + [ + rebase_path("../gyp/pdf.gypi"), + "--replace=<(skia_include_path)=$_path_to_include", + "--replace=<(skia_src_path)=$_path_to_src", + ], + "scope", + [ "../gyp/pdf.gypi" ]) +skia_pdf_sources = _pdf_gypi.sources + +# SKSL. +_sksl_gypi = exec_script("gypi_to_gn.py", + [ + rebase_path("../gyp/sksl.gypi"), + "--replace=<(skia_include_path)=$_path_to_include", + "--replace=<(skia_src_path)=$_path_to_src", + ], + "scope", + [ "../gyp/sksl.gypi" ]) +skia_sksl_sources = _sksl_gypi.sources + +# Utils. +_utils_gypi = exec_script("gypi_to_gn.py", + [ + rebase_path("../gyp/utils.gypi"), + "--replace=<(skia_include_path)=$_path_to_include", + "--replace=<(skia_src_path)=$_path_to_src", + ], + "scope", + [ "../gyp/utils.gypi" ]) +skia_utils_sources = _utils_gypi.sources + +# Skia Chromium defines. These flags will be defined in chromium If these +# become 'permanent', they should be moved into Chrome's skia build file. +skia_for_chromium_defines = [ "SK_IGNORE_LINEONLY_AA_CONVEX_PATH_OPTS" ] diff --git a/gyp/skia_for_chromium_defines.gypi b/gyp/skia_for_chromium_defines.gypi index a148a83a01..6ab5cc8e79 100644 --- a/gyp/skia_for_chromium_defines.gypi +++ b/gyp/skia_for_chromium_defines.gypi @@ -2,6 +2,9 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. +# THIS FILE IS OBSOLETE. It will be deleted pending a two-sided update to +# Chromium. Please update the new list in gn/shared_sources.gni. + # This file is included by chrome's skia/skia_common.gypi, and is intended to # augment the skia flags that are set there. |