Split SkSL and utils apart again into .gni files.
Also extend GN format presubmit check to .gni files. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=3976 Change-Id: I292f3136437101e3e2c3271e260536ab7a24b192 Reviewed-on: https://skia-review.googlesource.com/3976 Reviewed-by: Ben Wagner <bungeman@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org>
This commit is contained in:
parent
4974c8e434
commit
a5fb6157e5
@ -187,7 +187,8 @@ def _CheckGNFormatted(input_api, output_api):
|
||||
"""Make sure any .gn files we're changing have been formatted."""
|
||||
results = []
|
||||
for f in input_api.AffectedFiles():
|
||||
if not f.LocalPath().endswith('.gn'):
|
||||
if (not f.LocalPath().endswith('.gn') and
|
||||
not f.LocalPath().endswith('.gni')):
|
||||
continue
|
||||
|
||||
gn = 'gn.bat' if 'win32' in sys.platform else 'gn'
|
||||
|
@ -59,15 +59,9 @@ skia_opts = exec_script("gypi_to_gn.py",
|
||||
"scope",
|
||||
[ "../gyp/opts.gypi" ])
|
||||
|
||||
# PDF.
|
||||
import("pdf.gni")
|
||||
|
||||
_sources_gypi = exec_script("gypi_to_gn.py",
|
||||
[ rebase_path("../gyp/skia_sources.gypi") ],
|
||||
"scope",
|
||||
[ "../gyp/skia_sources.gypi" ])
|
||||
skia_sksl_sources = get_path_info(_sources_gypi.sksl_sources, "abspath")
|
||||
skia_utils_sources = get_path_info(_sources_gypi.utils_sources, "abspath")
|
||||
import("sksl.gni")
|
||||
import("utils.gni")
|
||||
|
||||
# Skia Chromium defines. These flags will be defined in chromium If these
|
||||
# become 'permanent', they should be moved into Chrome's skia build file.
|
||||
|
19
gn/sksl.gni
Normal file
19
gn/sksl.gni
Normal file
@ -0,0 +1,19 @@
|
||||
# Copyright 2016 Google Inc.
|
||||
#
|
||||
# Use of this source code is governed by a BSD-style license that can be
|
||||
# found in the LICENSE file.
|
||||
|
||||
# Things are easiest for everyone if these source paths are absolute.
|
||||
_src = get_path_info("../src", "abspath")
|
||||
|
||||
skia_sksl_sources = [
|
||||
"$_src/sksl/SkSLCFGGenerator.cpp",
|
||||
"$_src/sksl/SkSLCompiler.cpp",
|
||||
"$_src/sksl/SkSLIRGenerator.cpp",
|
||||
"$_src/sksl/SkSLParser.cpp",
|
||||
"$_src/sksl/SkSLGLSLCodeGenerator.cpp",
|
||||
"$_src/sksl/SkSLSPIRVCodeGenerator.cpp",
|
||||
"$_src/sksl/SkSLUtil.cpp",
|
||||
"$_src/sksl/ir/SkSLSymbolTable.cpp",
|
||||
"$_src/sksl/ir/SkSLType.cpp",
|
||||
]
|
116
gn/utils.gni
Normal file
116
gn/utils.gni
Normal file
@ -0,0 +1,116 @@
|
||||
# Copyright 2016 Google Inc.
|
||||
#
|
||||
# Use of this source code is governed by a BSD-style license that can be
|
||||
# found in the LICENSE file.
|
||||
|
||||
# Things are easiest for everyone if these source paths are absolute.
|
||||
_src = get_path_info("../src", "abspath")
|
||||
_include = get_path_info("../include", "abspath")
|
||||
|
||||
skia_utils_sources = [
|
||||
"$_include/utils/SkBoundaryPatch.h",
|
||||
"$_include/utils/SkFrontBufferedStream.h",
|
||||
"$_include/utils/SkCamera.h",
|
||||
"$_include/utils/SkCanvasStateUtils.h",
|
||||
"$_include/utils/SkDumpCanvas.h",
|
||||
"$_include/utils/SkEventTracer.h",
|
||||
"$_include/utils/SkInterpolator.h",
|
||||
"$_include/utils/SkLayer.h",
|
||||
"$_include/utils/SkMeshUtils.h",
|
||||
"$_include/utils/SkNoSaveLayerCanvas.h",
|
||||
"$_include/utils/SkNWayCanvas.h",
|
||||
"$_include/utils/SkNullCanvas.h",
|
||||
"$_include/utils/SkPaintFilterCanvas.h",
|
||||
"$_include/utils/SkParse.h",
|
||||
"$_include/utils/SkParsePath.h",
|
||||
"$_include/utils/SkPictureUtils.h",
|
||||
"$_include/utils/SkRandom.h",
|
||||
"$_include/utils/SkTextBox.h",
|
||||
|
||||
"$_src/utils/SkBase64.cpp",
|
||||
"$_src/utils/SkBase64.h",
|
||||
"$_src/utils/SkBitmapSourceDeserializer.cpp",
|
||||
"$_src/utils/SkBitmapSourceDeserializer.h",
|
||||
"$_src/utils/SkBitSet.h",
|
||||
"$_src/utils/SkBoundaryPatch.cpp",
|
||||
"$_src/utils/SkFrontBufferedStream.cpp",
|
||||
"$_src/utils/SkCamera.cpp",
|
||||
"$_src/utils/SkCanvasStack.h",
|
||||
"$_src/utils/SkCanvasStack.cpp",
|
||||
"$_src/utils/SkCanvasStateUtils.cpp",
|
||||
"$_src/utils/SkCurveMeasure.cpp",
|
||||
"$_src/utils/SkCurveMeasure.h",
|
||||
"$_src/utils/SkDashPath.cpp",
|
||||
"$_src/utils/SkDashPathPriv.h",
|
||||
"$_src/utils/SkDeferredCanvas.cpp",
|
||||
"$_src/utils/SkDumpCanvas.cpp",
|
||||
"$_src/utils/SkEventTracer.cpp",
|
||||
"$_src/utils/SkFloatUtils.h",
|
||||
"$_src/utils/SkInterpolator.cpp",
|
||||
"$_src/utils/SkLayer.cpp",
|
||||
"$_src/utils/SkMatrix22.cpp",
|
||||
"$_src/utils/SkMatrix22.h",
|
||||
"$_src/utils/SkMeshUtils.cpp",
|
||||
"$_src/utils/SkMultiPictureDocument.cpp",
|
||||
"$_src/utils/SkNWayCanvas.cpp",
|
||||
"$_src/utils/SkNullCanvas.cpp",
|
||||
"$_src/utils/SkOSFile.cpp",
|
||||
"$_src/utils/SkPaintFilterCanvas.cpp",
|
||||
"$_src/utils/SkParse.cpp",
|
||||
"$_src/utils/SkParseColor.cpp",
|
||||
"$_src/utils/SkParsePath.cpp",
|
||||
"$_src/utils/SkPatchGrid.cpp",
|
||||
"$_src/utils/SkPatchGrid.h",
|
||||
"$_src/utils/SkPatchUtils.cpp",
|
||||
"$_src/utils/SkPatchUtils.h",
|
||||
"$_src/utils/SkRGBAToYUV.cpp",
|
||||
"$_src/utils/SkRGBAToYUV.h",
|
||||
"$_src/utils/SkShadowPaintFilterCanvas.cpp",
|
||||
"$_src/utils/SkShadowPaintFilterCanvas.h",
|
||||
"$_src/utils/SkTextBox.cpp",
|
||||
"$_src/utils/SkTextureCompressor.cpp",
|
||||
"$_src/utils/SkTextureCompressor.h",
|
||||
"$_src/utils/SkTextureCompressor_Utils.h",
|
||||
"$_src/utils/SkTextureCompressor_ASTC.cpp",
|
||||
"$_src/utils/SkTextureCompressor_ASTC.h",
|
||||
"$_src/utils/SkTextureCompressor_Blitter.h",
|
||||
"$_src/utils/SkTextureCompressor_R11EAC.cpp",
|
||||
"$_src/utils/SkTextureCompressor_R11EAC.h",
|
||||
"$_src/utils/SkTextureCompressor_LATC.cpp",
|
||||
"$_src/utils/SkTextureCompressor_LATC.h",
|
||||
"$_src/utils/SkThreadUtils.h",
|
||||
"$_src/utils/SkThreadUtils_pthread.cpp",
|
||||
"$_src/utils/SkThreadUtils_pthread.h",
|
||||
"$_src/utils/SkThreadUtils_win.cpp",
|
||||
"$_src/utils/SkThreadUtils_win.h",
|
||||
"$_src/utils/SkWhitelistTypefaces.cpp",
|
||||
|
||||
#mac
|
||||
"$_include/utils/mac/SkCGUtils.h",
|
||||
"$_src/utils/mac/SkCreateCGImageRef.cpp",
|
||||
|
||||
#windows
|
||||
"$_src/utils/win/SkAutoCoInitialize.h",
|
||||
"$_src/utils/win/SkAutoCoInitialize.cpp",
|
||||
"$_src/utils/win/SkDWrite.h",
|
||||
"$_src/utils/win/SkDWrite.cpp",
|
||||
"$_src/utils/win/SkDWriteFontFileStream.cpp",
|
||||
"$_src/utils/win/SkDWriteFontFileStream.h",
|
||||
"$_src/utils/win/SkDWriteGeometrySink.cpp",
|
||||
"$_src/utils/win/SkDWriteGeometrySink.h",
|
||||
"$_src/utils/win/SkHRESULT.h",
|
||||
"$_src/utils/win/SkHRESULT.cpp",
|
||||
"$_src/utils/win/SkIStream.h",
|
||||
"$_src/utils/win/SkIStream.cpp",
|
||||
"$_src/utils/win/SkTScopedComPtr.h",
|
||||
"$_src/utils/win/SkWGL.h",
|
||||
"$_src/utils/win/SkWGL_win.cpp",
|
||||
|
||||
#testing
|
||||
"$_src/fonts/SkGScalerContext.cpp",
|
||||
"$_src/fonts/SkGScalerContext.h",
|
||||
"$_src/fonts/SkRandomScalerContext.cpp",
|
||||
"$_src/fonts/SkRandomScalerContext.h",
|
||||
"$_src/fonts/SkTestScalerContext.cpp",
|
||||
"$_src/fonts/SkTestScalerContext.h",
|
||||
]
|
@ -1,137 +0,0 @@
|
||||
# Copyright 2015 Google Inc.
|
||||
#
|
||||
# Use of this source code is governed by a BSD-style license that can be
|
||||
# found in the LICENSE file.
|
||||
# Include this gypi to include all 'utils' files
|
||||
# The parent gyp/gypi file must define
|
||||
# 'skia_src_path' e.g. skia/trunk/src
|
||||
# 'skia_include_path' e.g. skia/trunk/include
|
||||
#
|
||||
# The skia build defines these in common_variables.gypi
|
||||
#
|
||||
{
|
||||
'utils_sources': [
|
||||
'../include/utils/SkBoundaryPatch.h',
|
||||
'../include/utils/SkFrontBufferedStream.h',
|
||||
'../include/utils/SkCamera.h',
|
||||
'../include/utils/SkCanvasStateUtils.h',
|
||||
'../include/utils/SkDumpCanvas.h',
|
||||
'../include/utils/SkEventTracer.h',
|
||||
'../include/utils/SkInterpolator.h',
|
||||
'../include/utils/SkLayer.h',
|
||||
'../include/utils/SkMeshUtils.h',
|
||||
'../include/utils/SkNoSaveLayerCanvas.h',
|
||||
'../include/utils/SkNWayCanvas.h',
|
||||
'../include/utils/SkNullCanvas.h',
|
||||
'../include/utils/SkPaintFilterCanvas.h',
|
||||
'../include/utils/SkParse.h',
|
||||
'../include/utils/SkParsePath.h',
|
||||
'../include/utils/SkPictureUtils.h',
|
||||
'../include/utils/SkRandom.h',
|
||||
'../include/utils/SkTextBox.h',
|
||||
|
||||
'../src/utils/SkBase64.cpp',
|
||||
'../src/utils/SkBase64.h',
|
||||
'../src/utils/SkBitmapSourceDeserializer.cpp',
|
||||
'../src/utils/SkBitmapSourceDeserializer.h',
|
||||
'../src/utils/SkBitSet.h',
|
||||
'../src/utils/SkBoundaryPatch.cpp',
|
||||
'../src/utils/SkFrontBufferedStream.cpp',
|
||||
'../src/utils/SkCamera.cpp',
|
||||
'../src/utils/SkCanvasStack.h',
|
||||
'../src/utils/SkCanvasStack.cpp',
|
||||
'../src/utils/SkCanvasStateUtils.cpp',
|
||||
'../src/utils/SkCurveMeasure.cpp',
|
||||
'../src/utils/SkCurveMeasure.h',
|
||||
'../src/utils/SkDashPath.cpp',
|
||||
'../src/utils/SkDashPathPriv.h',
|
||||
'../src/utils/SkDeferredCanvas.cpp',
|
||||
'../src/utils/SkDumpCanvas.cpp',
|
||||
'../src/utils/SkEventTracer.cpp',
|
||||
'../src/utils/SkFloatUtils.h',
|
||||
'../src/utils/SkInterpolator.cpp',
|
||||
'../src/utils/SkLayer.cpp',
|
||||
'../src/utils/SkMatrix22.cpp',
|
||||
'../src/utils/SkMatrix22.h',
|
||||
'../src/utils/SkMeshUtils.cpp',
|
||||
'../src/utils/SkMultiPictureDocument.cpp',
|
||||
'../src/utils/SkNWayCanvas.cpp',
|
||||
'../src/utils/SkNullCanvas.cpp',
|
||||
'../src/utils/SkOSFile.cpp',
|
||||
'../src/utils/SkPaintFilterCanvas.cpp',
|
||||
'../src/utils/SkParse.cpp',
|
||||
'../src/utils/SkParseColor.cpp',
|
||||
'../src/utils/SkParsePath.cpp',
|
||||
'../src/utils/SkPatchGrid.cpp',
|
||||
'../src/utils/SkPatchGrid.h',
|
||||
'../src/utils/SkPatchUtils.cpp',
|
||||
'../src/utils/SkPatchUtils.h',
|
||||
'../src/utils/SkRGBAToYUV.cpp',
|
||||
'../src/utils/SkRGBAToYUV.h',
|
||||
'../src/utils/SkShadowPaintFilterCanvas.cpp',
|
||||
'../src/utils/SkShadowPaintFilterCanvas.h',
|
||||
'../src/utils/SkTextBox.cpp',
|
||||
'../src/utils/SkTextureCompressor.cpp',
|
||||
'../src/utils/SkTextureCompressor.h',
|
||||
'../src/utils/SkTextureCompressor_Utils.h',
|
||||
'../src/utils/SkTextureCompressor_ASTC.cpp',
|
||||
'../src/utils/SkTextureCompressor_ASTC.h',
|
||||
'../src/utils/SkTextureCompressor_Blitter.h',
|
||||
'../src/utils/SkTextureCompressor_R11EAC.cpp',
|
||||
'../src/utils/SkTextureCompressor_R11EAC.h',
|
||||
'../src/utils/SkTextureCompressor_LATC.cpp',
|
||||
'../src/utils/SkTextureCompressor_LATC.h',
|
||||
'../src/utils/SkThreadUtils.h',
|
||||
'../src/utils/SkThreadUtils_pthread.cpp',
|
||||
'../src/utils/SkThreadUtils_pthread.h',
|
||||
'../src/utils/SkThreadUtils_win.cpp',
|
||||
'../src/utils/SkThreadUtils_win.h',
|
||||
'../src/utils/SkWhitelistTypefaces.cpp',
|
||||
|
||||
#mac
|
||||
'../include/utils/mac/SkCGUtils.h',
|
||||
'../src/utils/mac/SkCreateCGImageRef.cpp',
|
||||
|
||||
#windows
|
||||
'../src/utils/win/SkAutoCoInitialize.h',
|
||||
'../src/utils/win/SkAutoCoInitialize.cpp',
|
||||
'../src/utils/win/SkDWrite.h',
|
||||
'../src/utils/win/SkDWrite.cpp',
|
||||
'../src/utils/win/SkDWriteFontFileStream.cpp',
|
||||
'../src/utils/win/SkDWriteFontFileStream.h',
|
||||
'../src/utils/win/SkDWriteGeometrySink.cpp',
|
||||
'../src/utils/win/SkDWriteGeometrySink.h',
|
||||
'../src/utils/win/SkHRESULT.h',
|
||||
'../src/utils/win/SkHRESULT.cpp',
|
||||
'../src/utils/win/SkIStream.h',
|
||||
'../src/utils/win/SkIStream.cpp',
|
||||
'../src/utils/win/SkTScopedComPtr.h',
|
||||
'../src/utils/win/SkWGL.h',
|
||||
'../src/utils/win/SkWGL_win.cpp',
|
||||
|
||||
#testing
|
||||
'../src/fonts/SkGScalerContext.cpp',
|
||||
'../src/fonts/SkGScalerContext.h',
|
||||
'../src/fonts/SkRandomScalerContext.cpp',
|
||||
'../src/fonts/SkRandomScalerContext.h',
|
||||
'../src/fonts/SkTestScalerContext.cpp',
|
||||
'../src/fonts/SkTestScalerContext.h',
|
||||
],
|
||||
'sksl_include_dirs': [
|
||||
'../include/config',
|
||||
'../include/core',
|
||||
'../include/private',
|
||||
'../src/sksl',
|
||||
],
|
||||
'sksl_sources': [
|
||||
'../src/sksl/SkSLCFGGenerator.cpp',
|
||||
'../src/sksl/SkSLCompiler.cpp',
|
||||
'../src/sksl/SkSLIRGenerator.cpp',
|
||||
'../src/sksl/SkSLParser.cpp',
|
||||
'../src/sksl/SkSLGLSLCodeGenerator.cpp',
|
||||
'../src/sksl/SkSLSPIRVCodeGenerator.cpp',
|
||||
'../src/sksl/SkSLUtil.cpp',
|
||||
'../src/sksl/ir/SkSLSymbolTable.cpp',
|
||||
'../src/sksl/ir/SkSLType.cpp',
|
||||
],
|
||||
}
|
12
gyp/sksl.gyp
12
gyp/sksl.gyp
@ -3,16 +3,18 @@
|
||||
# Use of this source code is governed by a BSD-style license that can be
|
||||
# found in the LICENSE file.
|
||||
{
|
||||
'variables': {
|
||||
'includes': [ 'skia_sources.gypi' ]
|
||||
},
|
||||
'targets': [
|
||||
{
|
||||
'target_name': 'sksl',
|
||||
'type': 'static_library',
|
||||
'standalone_static_library': 1,
|
||||
'sources': [ '<@(sksl_sources)' ],
|
||||
'include_dirs': [ '<@(sksl_include_dirs)' ],
|
||||
'sources': [ '<!@(python read_gni.py ../gn/sksl.gni skia_sksl_sources)' ],
|
||||
'include_dirs': [
|
||||
'../include/config',
|
||||
'../include/core',
|
||||
'../include/private',
|
||||
'../src/sksl',
|
||||
],
|
||||
'defines': [
|
||||
'SKIA'
|
||||
],
|
||||
|
@ -6,16 +6,18 @@
|
||||
'includes': [
|
||||
'apptype_console.gypi',
|
||||
],
|
||||
'variables': {
|
||||
'includes': [ 'skia_sources.gypi' ],
|
||||
},
|
||||
'targets': [
|
||||
{
|
||||
'target_name': 'skslc',
|
||||
'type': 'executable',
|
||||
'include_dirs': [ '<@(sksl_include_dirs)' ],
|
||||
'include_dirs': [
|
||||
'../include/config',
|
||||
'../include/core',
|
||||
'../include/private',
|
||||
'../src/sksl',
|
||||
],
|
||||
'sources': [
|
||||
'<@(sksl_sources)',
|
||||
'<!@(python read_gni.py ../gn/sksl.gni skia_sksl_sources)',
|
||||
'../src/sksl/SkSLMain.cpp',
|
||||
],
|
||||
'configurations': {
|
||||
|
@ -4,9 +4,6 @@
|
||||
# found in the LICENSE file.
|
||||
# Gyp for utils.
|
||||
{
|
||||
'variables': {
|
||||
'includes': [ 'skia_sources.gypi' ],
|
||||
},
|
||||
'targets': [
|
||||
{
|
||||
'target_name': 'utils',
|
||||
@ -33,7 +30,7 @@
|
||||
'../src/utils/win',
|
||||
],
|
||||
'sources': [
|
||||
'<@(utils_sources)', # Makes the sources appear in IDEs (but does not modify the build).
|
||||
'<!@(python read_gni.py ../gn/utils.gni skia_utils_sources)',
|
||||
],
|
||||
'conditions': [
|
||||
[ 'skia_os == "mac"', {
|
||||
|
Loading…
Reference in New Issue
Block a user