michael@0: # -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*- michael@0: # vim: set filetype=python: michael@0: # This Source Code Form is subject to the terms of the Mozilla Public michael@0: # License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: # file, You can obtain one at http://mozilla.org/MPL/2.0/. michael@0: michael@0: gl_provider = 'Null' michael@0: michael@0: if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows': michael@0: gl_provider = 'WGL' michael@0: elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa': michael@0: gl_provider = 'CGL' michael@0: elif CONFIG['MOZ_WIDGET_GTK']: michael@0: if CONFIG['MOZ_EGL_XRENDER_COMPOSITE']: michael@0: gl_provider = 'EGL' michael@0: else: michael@0: gl_provider = 'GLX' michael@0: elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'qt': michael@0: gl_provider = 'GLX' michael@0: elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android': michael@0: gl_provider = 'EGL' michael@0: elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk': michael@0: gl_provider = 'EGL' michael@0: michael@0: if CONFIG['MOZ_GL_PROVIDER']: michael@0: gl_provider = CONFIG['MOZ_GL_PROVIDER'] michael@0: michael@0: EXPORTS += [ michael@0: 'DecomposeIntoNoRepeatTriangles.h', michael@0: 'ForceDiscreteGPUHelperCGL.h', michael@0: 'GfxTexturesReporter.h', michael@0: 'GLBlitTextureImageHelper.h', michael@0: 'GLConsts.h', michael@0: 'GLContext.h', michael@0: 'GLContextEGL.h', michael@0: 'GLContextProvider.h', michael@0: 'GLContextProviderImpl.h', michael@0: 'GLContextSymbols.h', michael@0: 'GLContextTypes.h', michael@0: 'GLDefs.h', michael@0: 'GLLibraryEGL.h', michael@0: 'GLLibraryLoader.h', michael@0: 'GLReadTexImageHelper.h', michael@0: 'GLScreenBuffer.h', michael@0: 'GLSharedHandleHelpers.h', michael@0: 'GLTextureImage.h', michael@0: 'GLTypes.h', michael@0: 'GLUploadHelpers.h', michael@0: 'ScopedGLHelpers.h', michael@0: 'SharedSurface.h', michael@0: 'SharedSurfaceEGL.h', michael@0: 'SharedSurfaceGL.h', michael@0: 'SurfaceFactory.h', michael@0: 'SurfaceStream.h', michael@0: 'SurfaceTypes.h', michael@0: 'TextureGarbageBin.h', michael@0: 'VBOArena.h', michael@0: ] michael@0: michael@0: if CONFIG['MOZ_X11']: michael@0: EXPORTS += [ michael@0: 'GLContextGLX.h', michael@0: 'GLXLibrary.h', michael@0: ] michael@0: michael@0: # Win32 is a special snowflake, for ANGLE michael@0: if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows': michael@0: EXPORTS += [ michael@0: 'GLContextWGL.h', michael@0: 'SharedSurfaceANGLE.h', michael@0: 'WGLLibrary.h', michael@0: ] michael@0: UNIFIED_SOURCES += [ michael@0: 'GLContextProviderEGL.cpp', michael@0: 'SharedSurfaceANGLE.cpp', michael@0: ] michael@0: if CONFIG['MOZ_ENABLE_SKIA_GPU']: michael@0: EXPORTS += ['SkiaGLGlue.h'] michael@0: UNIFIED_SOURCES += [ michael@0: 'SkiaGLGlue.cpp', michael@0: ] michael@0: michael@0: if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk': michael@0: UNIFIED_SOURCES += ['SharedSurfaceGralloc.cpp'] michael@0: EXPORTS += ['SharedSurfaceGralloc.h'] michael@0: LOCAL_INCLUDES += ['/widget/gonk'] michael@0: CXXFLAGS += ['-I%s/%s' % (CONFIG['ANDROID_SOURCE'], 'hardware/libhardware/include')] michael@0: michael@0: if gl_provider == 'CGL': michael@0: # These files include Mac headers that are unfriendly to unified builds michael@0: SOURCES += [ michael@0: "GLContextProviderCGL.mm", michael@0: "TextureImageCGL.mm" michael@0: ] michael@0: EXPORTS += [ michael@0: 'GLContextCGL.h', michael@0: 'SharedSurfaceIO.h', michael@0: ] michael@0: # SharedSurfaceIO.cpp includes MacIOSurface.h which include Mac headers michael@0: # which define Size and Point types in root namespace with often conflict with michael@0: # our own types. While I haven't actually hit this issue in the present case, michael@0: # it's been an issue in gfx/layers so let's not risk it. michael@0: SOURCES += [ michael@0: 'SharedSurfaceIO.cpp', michael@0: ] michael@0: elif gl_provider == 'GLX': michael@0: # GLContextProviderGLX.cpp needs to be kept out of UNIFIED_SOURCES michael@0: # as it includes X11 headers which cause conflicts. michael@0: SOURCES += [ michael@0: 'GLContextProviderGLX.cpp', michael@0: ] michael@0: else: michael@0: UNIFIED_SOURCES += [ michael@0: 'GLContextProvider%s.cpp' % gl_provider, michael@0: ] michael@0: michael@0: UNIFIED_SOURCES += [ michael@0: 'DecomposeIntoNoRepeatTriangles.cpp', michael@0: 'GfxTexturesReporter.cpp', michael@0: 'GLBlitHelper.cpp', michael@0: 'GLBlitTextureImageHelper.cpp', michael@0: 'GLContext.cpp', michael@0: 'GLContextFeatures.cpp', michael@0: 'GLContextTypes.cpp', michael@0: 'GLDebugUtils.cpp', michael@0: 'GLLibraryEGL.cpp', michael@0: 'GLLibraryLoader.cpp', michael@0: 'GLReadTexImageHelper.cpp', michael@0: 'GLScreenBuffer.cpp', michael@0: 'GLSharedHandleHelpers.cpp', michael@0: 'GLTextureImage.cpp', michael@0: 'GLUploadHelpers.cpp', michael@0: 'ScopedGLHelpers.cpp', michael@0: 'SharedSurface.cpp', michael@0: 'SharedSurfaceEGL.cpp', michael@0: 'SharedSurfaceGL.cpp', michael@0: 'SurfaceFactory.cpp', michael@0: 'SurfaceStream.cpp', michael@0: 'SurfaceTypes.cpp', michael@0: 'TextureGarbageBin.cpp', michael@0: 'TextureImageEGL.cpp', michael@0: 'VBOArena.cpp', michael@0: ] michael@0: michael@0: FAIL_ON_WARNINGS = True michael@0: michael@0: MSVC_ENABLE_PGO = True michael@0: michael@0: include('/ipc/chromium/chromium-config.mozbuild') michael@0: michael@0: FINAL_LIBRARY = 'xul' michael@0: michael@0: if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows' and CONFIG['MOZ_WEBGL']: michael@0: DEFINES['MOZ_D3DCOMPILER_DLL'] = CONFIG['MOZ_D3DCOMPILER_DLL'] michael@0: michael@0: if CONFIG['MOZ_ANDROID_OMTC']: michael@0: DEFINES['MOZ_ANDROID_OMTC'] = True