moz.build (4419B)
1 # -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*- 2 # vim: set filetype=python: 3 # This Source Code Form is subject to the terms of the Mozilla Public 4 # License, v. 2.0. If a copy of the MPL was not distributed with this 5 # file, You can obtain one at http://mozilla.org/MPL/2.0/. 6 7 gl_provider = "Null" 8 9 if CONFIG["MOZ_WIDGET_TOOLKIT"] == "windows": 10 gl_provider = "WGL" 11 elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "cocoa": 12 gl_provider = "CGL" 13 elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "uikit": 14 gl_provider = "EAGL" 15 DEFINES["GLES_SILENCE_DEPRECATION"] = 1 16 elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk": 17 gl_provider = "Linux" 18 elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "android": 19 gl_provider = "EGL" 20 21 if CONFIG["MOZ_GL_PROVIDER"]: 22 gl_provider = CONFIG["MOZ_GL_PROVIDER"] 23 24 EXPORTS += [ 25 "AndroidSurfaceTexture.h", 26 "AutoMappable.h", 27 "Colorspaces.h", 28 "ForceDiscreteGPUHelperCGL.h", 29 "GfxTexturesReporter.h", 30 "GLBlitHelper.h", 31 "GLConsts.h", 32 "GLContext.h", 33 "GLContextEGL.h", 34 "GLContextProvider.h", 35 "GLContextProviderImpl.h", 36 "GLContextSymbols.h", 37 "GLContextTypes.h", 38 "GLDefs.h", 39 "GLLibraryEGL.h", 40 "GLLibraryLoader.h", 41 "GLReadTexImageHelper.h", 42 "GLScreenBuffer.h", 43 "GLTextureImage.h", 44 "GLTypes.h", 45 "GLUploadHelpers.h", 46 "HeapCopyOfStackArray.h", 47 "MozFramebuffer.h", 48 "ScopedGLHelpers.h", 49 "SharedSurface.h", 50 "SharedSurfaceEGL.h", 51 "SharedSurfaceGL.h", 52 "SurfaceTypes.h", 53 ] 54 55 # Win32 is a special snowflake, for ANGLE 56 if CONFIG["MOZ_WIDGET_TOOLKIT"] == "windows": 57 EXPORTS += [ 58 "GLContextWGL.h", 59 "SharedSurfaceANGLE.h", # Needs <windows.h> for `HANDLE`. 60 "SharedSurfaceD3D11Interop.h", 61 "WGLLibrary.h", 62 ] 63 UNIFIED_SOURCES += [ 64 "GLBlitHelperD3D.cpp", 65 "GLContextProviderWGL.cpp", 66 "SharedSurfaceANGLE.cpp", 67 "SharedSurfaceD3D11Interop.cpp", 68 ] 69 70 if CONFIG["MOZ_WIDGET_TOOLKIT"] == "android": 71 EXPORTS += [ 72 "AndroidNativeWindow.h", 73 "SharedSurfaceAndroidHardwareBuffer.h", 74 ] 75 UNIFIED_SOURCES += [ 76 "SharedSurfaceAndroidHardwareBuffer.cpp", 77 ] 78 79 if gl_provider == "CGL": 80 # These files include Mac headers that are unfriendly to unified builds 81 SOURCES += [ 82 "GLContextProviderCGL.mm", 83 ] 84 EXPORTS += [ 85 "GLContextCGL.h", 86 "SharedSurfaceIO.h", 87 ] 88 # SharedSurfaceIO.cpp includes MacIOSurface.h which include Mac headers 89 # which define Size and Point types in root namespace with often conflict with 90 # our own types. While I haven't actually hit this issue in the present case, 91 # it's been an issue in gfx/layers so let's not risk it. 92 SOURCES += [ 93 "SharedSurfaceIO.cpp", 94 ] 95 OS_LIBS += [ 96 "-framework IOSurface", 97 ] 98 99 elif gl_provider == "EAGL": 100 # These files include ObjC headers that are unfriendly to unified builds 101 SOURCES += [ 102 "GLContextProviderEAGL.mm", 103 ] 104 EXPORTS += [ 105 "GLContextEAGL.h", 106 ] 107 108 elif gl_provider == "Linux": 109 # GLContextProviderGLX.cpp needs to be kept out of UNIFIED_SOURCES 110 # as it includes X11 headers which cause conflicts. 111 SOURCES += [ 112 "GLContextProviderLinux.cpp", 113 "SharedSurfaceDMABUF.cpp", 114 ] 115 EXPORTS += ["GLContextGLX.h", "GLXLibrary.h"] 116 if CONFIG["MOZ_X11"]: 117 SOURCES += ["GLContextProviderGLX.cpp"] 118 119 UNIFIED_SOURCES += [ 120 "AndroidSurfaceTexture.cpp", 121 "Colorspaces.cpp", 122 "GfxTexturesReporter.cpp", 123 "GLBlitHelper.cpp", 124 "GLContext.cpp", 125 "GLContextFeatures.cpp", 126 "GLContextProviderEGL.cpp", 127 "GLDebugUtils.cpp", 128 "GLLibraryEGL.cpp", 129 "GLLibraryLoader.cpp", 130 "GLReadTexImageHelper.cpp", 131 "GLTextureImage.cpp", 132 "GLUploadHelpers.cpp", 133 "MozFramebuffer.cpp", 134 "ScopedGLHelpers.cpp", 135 "SharedSurface.cpp", 136 "SharedSurfaceEGL.cpp", 137 "SharedSurfaceGL.cpp", 138 ] 139 SOURCES += [ 140 "GLScreenBuffer.cpp", 141 ] 142 143 TEST_DIRS += [ 144 "gtest", 145 ] 146 147 include("/ipc/chromium/chromium-config.mozbuild") 148 149 FINAL_LIBRARY = "xul" 150 151 if CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk": 152 CXXFLAGS += CONFIG["MOZ_GTK3_CFLAGS"] 153 CFLAGS += CONFIG["MOZ_GTK3_CFLAGS"] 154 155 CXXFLAGS += ["-Werror=switch"] 156 157 if CONFIG["MOZ_WAYLAND"]: 158 CXXFLAGS += CONFIG["MOZ_WAYLAND_CFLAGS"] 159 CFLAGS += CONFIG["MOZ_WAYLAND_CFLAGS"] 160 161 LOCAL_INCLUDES += CONFIG["SKIA_INCLUDES"] 162 LOCAL_INCLUDES += [ 163 "/gfx/cairo/cairo/src", 164 ]