gecko/gfx/gl/moz.build

144 lines
3.9 KiB
Python

# -*- Mode: python; c-basic-offset: 4; 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/.
gl_provider = 'Null'
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
gl_provider = 'WGL'
elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
gl_provider = 'CGL'
elif CONFIG['MOZ_WIDGET_GTK']:
if CONFIG['MOZ_EGL_XRENDER_COMPOSITE']:
gl_provider = 'EGL'
else:
gl_provider = 'GLX'
elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'qt':
gl_provider = 'GLX'
elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android':
gl_provider = 'EGL'
elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk':
gl_provider = 'EGL'
if CONFIG['MOZ_GL_PROVIDER']:
gl_provider = CONFIG['MOZ_GL_PROVIDER']
EXPORTS += [
'DecomposeIntoNoRepeatTriangles.h',
'ForceDiscreteGPUHelperCGL.h',
'GfxTexturesReporter.h',
'GLBlitTextureImageHelper.h',
'GLConsts.h',
'GLContext.h',
'GLContextProvider.h',
'GLContextProviderImpl.h',
'GLContextSymbols.h',
'GLContextTypes.h',
'GLContextUtils.h',
'GLDefs.h',
'GLLibraryEGL.h',
'GLLibraryLoader.h',
'GLScreenBuffer.h',
'GLTextureImage.h',
'GLTypes.h',
'ScopedGLHelpers.h',
'SharedSurface.h',
'SharedSurfaceEGL.h',
'SharedSurfaceGL.h',
'SurfaceFactory.h',
'SurfaceStream.h',
'SurfaceTypes.h',
'TextureGarbageBin.h',
'VBOArena.h',
]
if CONFIG['MOZ_X11']:
EXPORTS += ['GLXLibrary.h']
# Win32 is a special snowflake, for ANGLE
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
EXPORTS += [
'SharedSurfaceANGLE.h',
'WGLLibrary.h',
]
UNIFIED_SOURCES += [
'GLContextProviderEGL.cpp',
'SharedSurfaceANGLE.cpp',
]
if CONFIG['MOZ_ENABLE_SKIA_GPU']:
EXPORTS += ['GLContextSkia.h']
UNIFIED_SOURCES += [
'GLContextSkia.cpp',
]
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk':
UNIFIED_SOURCES += ['SharedSurfaceGralloc.cpp']
EXPORTS += ['SharedSurfaceGralloc.h']
if gl_provider == 'CGL':
# This file includes Mac headers that are unfriendly to unified builds,
# and we have only one .mm file here anyway.
SOURCES += [
"GLContextProvider%s.mm" % (gl_provider),
]
EXPORTS += [
'SharedSurfaceIO.h',
]
# SharedSurfaceIO.cpp includes MacIOSurface.h which include Mac headers
# which define Size and Point types in root namespace with often conflict with
# our own types. While I haven't actually hit this issue in the present case,
# it's been an issue in gfx/layers so let's not risk it.
SOURCES += [
'SharedSurfaceIO.cpp',
]
elif gl_provider == 'GLX':
# GLContextProviderGLX.cpp needs to be kept out of UNIFIED_SOURCES
# as it includes X11 headers which cause conflicts.
SOURCES += [
'GLContextProviderGLX.cpp',
]
else:
UNIFIED_SOURCES += [
'GLContextProvider%s.cpp' % gl_provider,
]
UNIFIED_SOURCES += [
'DecomposeIntoNoRepeatTriangles.cpp',
'GfxTexturesReporter.cpp',
'GLBlitHelper.cpp',
'GLBlitTextureImageHelper.cpp',
'GLContext.cpp',
'GLContextFeatures.cpp',
'GLContextTypes.cpp',
'GLContextUtils.cpp',
'GLLibraryEGL.cpp',
'GLLibraryLoader.cpp',
'GLScreenBuffer.cpp',
'GLTextureImage.cpp',
'ScopedGLHelpers.cpp',
'SharedSurface.cpp',
'SharedSurfaceEGL.cpp',
'SharedSurfaceGL.cpp',
'SurfaceFactory.cpp',
'SurfaceStream.cpp',
'TextureGarbageBin.cpp',
'TextureImageEGL.cpp',
'VBOArena.cpp',
]
FAIL_ON_WARNINGS = True
MSVC_ENABLE_PGO = True
include('/ipc/chromium/chromium-config.mozbuild')
FINAL_LIBRARY = 'xul'
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows' and CONFIG['MOZ_WEBGL']:
DEFINES['MOZ_D3DCOMPILER_DLL'] = CONFIG['MOZ_D3DCOMPILER_DLL']
if CONFIG['MOZ_ANDROID_OMTC']:
DEFINES['MOZ_ANDROID_OMTC'] = True