gfx/webrender_bindings/moz.build
author Emilio Cobos Álvarez <emilio@crisal.io>
Sun, 13 Jan 2019 00:43:00 +0100
changeset 453708 e3d38e17dec86ebe0321d4eb4d49c3ec8d2bf85b
parent 446618 b5ebe325c20d5e747953a9cec13e00d1e81fa79c
child 458645 19ccde31eaaaf38e29bedf3bf7d3c5f11a47a0da
permissions -rw-r--r--
Bug 1519501 - Generate webrender_ffi_generated.h at build time. r=kats Differential Revision: https://phabricator.services.mozilla.com/D16400

# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
# vim: set filetype=python:
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

with Files('**'):
    BUG_COMPONENT = ('Core', 'Graphics: WebRender')

EXPORTS.mozilla.webrender += [
    'RenderBufferTextureHost.h',
    'RenderCompositor.h',
    'RenderCompositorOGL.h',
    'RendererOGL.h',
    'RenderSharedSurfaceTextureHost.h',
    'RenderTextureHost.h',
    'RenderTextureHostOGL.h',
    'RenderTextureHostWrapper.h',
    'RenderThread.h',
    'webrender_ffi.h',
    'WebRenderAPI.h',
    'WebRenderTypes.h',
]

UNIFIED_SOURCES += [
    'Moz2DImageRenderer.cpp',
    'RenderBufferTextureHost.cpp',
    'RenderCompositor.cpp',
    'RenderCompositorOGL.cpp',
    'RendererOGL.cpp',
    'RenderSharedSurfaceTextureHost.cpp',
    'RenderTextureHost.cpp',
    'RenderTextureHostOGL.cpp',
    'RenderTextureHostWrapper.cpp',
    'RenderThread.cpp',
    'WebRenderAPI.cpp',
    'WebRenderTypes.cpp',
]

if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
    EXPORTS.mozilla.webrender += [
        'RenderMacIOSurfaceTextureHostOGL.h',
    ]
    UNIFIED_SOURCES += [
        'RenderMacIOSurfaceTextureHostOGL.cpp',
    ]

if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android':
    EXPORTS.mozilla.webrender += [
        'RenderAndroidSurfaceTextureHostOGL.h',
    ]
    UNIFIED_SOURCES += [
        'RenderAndroidSurfaceTextureHostOGL.cpp',
    ]

if CONFIG['MOZ_ENABLE_D3D10_LAYER']:
    DEFINES['MOZ_ENABLE_D3D10_LAYER'] = True
    EXPORTS.mozilla.webrender += [
        'RenderCompositorANGLE.h',
        'RenderD3D11TextureHostOGL.h',
    ]
    UNIFIED_SOURCES += [
        'RenderD3D11TextureHostOGL.cpp',
    ]
    SOURCES += [
        'RenderCompositorANGLE.cpp',
    ]

if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('android', 'gtk3'):
    CXXFLAGS += CONFIG['MOZ_CAIRO_CFLAGS']
    CXXFLAGS += CONFIG['CAIRO_FT_CFLAGS']

if CONFIG['COMPILE_ENVIRONMENT']:
    GENERATED_FILES += [
        'webrender_ffi_generated.h',
    ]

    EXPORTS.mozilla.webrender += [
        '!webrender_ffi_generated.h',
    ]

    ffi_generated = GENERATED_FILES['webrender_ffi_generated.h']
    ffi_generated.script = '/layout/style/RunCbindgen.py:generate'
    ffi_generated.inputs = [
        '/gfx/webrender_bindings',
        '/gfx/wr/webrender',
        '/gfx/wr/webrender_api',
    ]


include('/ipc/chromium/chromium-config.mozbuild')

FINAL_LIBRARY = 'xul'

if CONFIG['CC_TYPE'] == 'clang-cl':
    AllowCompilerWarnings()  # workaround for bug 1090497