tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

moz.build (7549B)


      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 with Files("*Text*"):
      8     BUG_COMPONENT = ("Core", "Graphics: Text")
      9 
     10 with Files("*DWrite*"):
     11     BUG_COMPONENT = ("Core", "Graphics: Text")
     12 
     13 XPIDL_SOURCES += [
     14     "nsIFontLoadCompleteCallback.idl",
     15 ]
     16 
     17 XPIDL_MODULE = "gfx"
     18 
     19 EXPORTS += [
     20     "COLRFonts.h",
     21     "DrawMode.h",
     22     "gfx2DGlue.h",
     23     "gfxAlphaRecovery.h",
     24     "gfxASurface.h",
     25     "gfxBaseSharedMemorySurface.h",
     26     "gfxBlur.h",
     27     "gfxColor.h",
     28     "gfxContext.h",
     29     "gfxDrawable.h",
     30     "gfxEnv.h",
     31     "gfxFailure.h",
     32     "gfxFont.h",
     33     "gfxFontConstants.h",
     34     "gfxFontEntry.h",
     35     "gfxFontFeatures.h",
     36     "gfxFontInfoLoader.h",
     37     "gfxFontPrefLangList.h",
     38     "gfxFontSrcPrincipal.h",
     39     "gfxFontSrcURI.h",
     40     "gfxFontUtils.h",
     41     "gfxFontVariations.h",
     42     "gfxGradientCache.h",
     43     "gfxImageSurface.h",
     44     "gfxLineSegment.h",
     45     "gfxMathTable.h",
     46     "gfxMatrix.h",
     47     "gfxOTSUtils.h",
     48     "gfxPattern.h",
     49     "gfxPlatform.h",
     50     "gfxPlatformFontList.h",
     51     "gfxPlatformWorker.h",
     52     "gfxPoint.h",
     53     "gfxQuad.h",
     54     "gfxQuaternion.h",
     55     "gfxRect.h",
     56     "gfxSharedImageSurface.h",
     57     "gfxSkipChars.h",
     58     "gfxSVGGlyphs.h",
     59     "gfxTextRun.h",
     60     "gfxTypes.h",
     61     "gfxUserFontSet.h",
     62     "gfxUtils.h",
     63     "SharedFontList.h",
     64     "SoftwareVsyncSource.h",
     65     "ThebesRLBoxTypes.h",
     66     "VsyncSource.h",
     67 ]
     68 
     69 EXPORTS.mozilla.gfx += [
     70     "D3D11Checks.h",
     71     "DeviceManagerDx.h",
     72     "DisplayConfigWindows.h",
     73     "FontPaletteCache.h",
     74     "PrintPromise.h",
     75     "PrintTarget.h",
     76     "PrintTargetThebes.h",
     77     "ThebesRLBox.h",
     78 ]
     79 
     80 EXPORTS.mozilla.gfx += ["SkMemoryReporter.h"]
     81 
     82 if CONFIG["MOZ_WIDGET_TOOLKIT"] == "android":
     83     EXPORTS += [
     84         "gfxAndroidPlatform.h",
     85         "gfxFT2FontBase.h",
     86         "gfxFT2Fonts.h",
     87     ]
     88     EXPORTS.mozilla.gfx += [
     89         "PrintTargetPDF.h",
     90     ]
     91     SOURCES += [
     92         "gfxAndroidPlatform.cpp",
     93         "gfxFT2FontBase.cpp",
     94         "gfxFT2FontList.cpp",
     95         "gfxFT2Fonts.cpp",
     96         "gfxFT2Utils.cpp",
     97         "PrintTargetPDF.cpp",
     98     ]
     99     UNIFIED_SOURCES += [
    100         "AndroidSystemFontIterator.cpp",
    101     ]
    102 elif CONFIG["MOZ_WIDGET_TOOLKIT"] in ("cocoa", "uikit"):
    103     EXPORTS += [
    104         "gfxMacUtils.h",
    105         "gfxPlatformMac.h",
    106         "gfxQuartzNativeDrawing.h",
    107         "gfxQuartzSurface.h",
    108     ]
    109     SOURCES += [
    110         "CoreTextFontList.cpp",
    111         "gfxCoreTextShaper.cpp",
    112         "gfxMacFont.cpp",
    113         "gfxMacUtils.cpp",
    114         "gfxPlatformMac.cpp",
    115         "gfxQuartzNativeDrawing.cpp",
    116         "gfxQuartzSurface.cpp",
    117     ]
    118     if CONFIG["MOZ_WIDGET_TOOLKIT"] == "cocoa":
    119         EXPORTS.mozilla.gfx += [
    120             "PrintTargetCG.h",
    121         ]
    122         SOURCES += [
    123             "PrintTargetCG.mm",
    124         ]
    125 elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk":
    126     EXPORTS += [
    127         "gfxFT2FontBase.h",
    128         "gfxPlatformGtk.h",
    129     ]
    130     EXPORTS.mozilla.gfx += [
    131         "PrintTargetPDF.h",
    132     ]
    133     SOURCES += [
    134         "gfxFcPlatformFontList.cpp",
    135         "gfxFT2FontBase.cpp",
    136         "gfxFT2Utils.cpp",
    137         "gfxPlatformGtk.cpp",
    138         "PrintTargetPDF.cpp",
    139     ]
    140 
    141     if CONFIG["MOZ_X11"]:
    142         EXPORTS += [
    143             "gfxXlibSurface.h",
    144         ]
    145         EXPORTS.mozilla.gfx += [
    146             "XlibDisplay.h",
    147         ]
    148         SOURCES += [
    149             "gfxXlibSurface.cpp",
    150             "XlibDisplay.cpp",
    151         ]
    152 
    153 elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "windows":
    154     EXPORTS += [
    155         "gfxDWriteCommon.h",
    156         "gfxDWriteFonts.h",
    157         "gfxWindowsNativeDrawing.h",
    158         "gfxWindowsPlatform.h",
    159         "gfxWindowsSurface.h",
    160     ]
    161     EXPORTS.mozilla.gfx += [
    162         "PrintTargetPDF.h",
    163         "PrintTargetWindows.h",
    164     ]
    165     SOURCES += [
    166         "DisplayConfigWindows.cpp",
    167         "gfxDWriteCommon.cpp",
    168         "gfxDWriteFonts.cpp",
    169         "gfxWindowsNativeDrawing.cpp",
    170         "gfxWindowsPlatform.cpp",
    171         "gfxWindowsSurface.cpp",
    172         "PrintTargetPDF.cpp",
    173         "PrintTargetWindows.cpp",
    174     ]
    175     UNIFIED_SOURCES += [
    176         "gfxDWriteFontList.cpp",
    177     ]
    178 
    179 # Are we targeting x86 or x64?  If so, build gfxAlphaRecoverySSE2.cpp.
    180 if CONFIG["INTEL_ARCHITECTURE"]:
    181     SOURCES += ["gfxAlphaRecoverySSE2.cpp"]
    182     # The file uses SSE2 intrinsics, so it needs special compile flags on some
    183     # compilers.
    184     SOURCES["gfxAlphaRecoverySSE2.cpp"].flags += CONFIG["SSE2_FLAGS"]
    185 
    186 SOURCES += [
    187     # Includes mac system header conflicting with point/size,
    188     # and includes glxXlibSurface.h which drags in Xrender.h
    189     "gfxASurface.cpp",
    190     # on X11, gfxDrawable.cpp includes X headers for an old workaround which
    191     # we could consider removing soon (affects Ubuntus older than 10.04 LTS)
    192     # which currently prevent it from joining UNIFIED_SOURCES.
    193     "gfxDrawable.cpp",
    194     # gfxFontUtils.cpp and gfxPlatform.cpp include mac system header conflicting with point/size
    195     "gfxFontUtils.cpp",
    196     "gfxPlatform.cpp",
    197     "PrintTarget.cpp",
    198     "PrintTargetThebes.cpp",
    199 ]
    200 
    201 UNIFIED_SOURCES += [
    202     "CJKCompatSVS.cpp",
    203     "COLRFonts.cpp",
    204     "FontPaletteCache.cpp",
    205     "gfxAlphaRecovery.cpp",
    206     "gfxBaseSharedMemorySurface.cpp",
    207     "gfxBlur.cpp",
    208     "gfxContext.cpp",
    209     "gfxFont.cpp",
    210     "gfxFontEntry.cpp",
    211     "gfxFontFeatures.cpp",
    212     "gfxFontInfoLoader.cpp",
    213     "gfxFontMissingGlyphs.cpp",
    214     "gfxFontSrcPrincipal.cpp",
    215     "gfxFontSrcURI.cpp",
    216     "gfxGlyphExtents.cpp",
    217     "gfxGradientCache.cpp",
    218     "gfxGraphiteShaper.cpp",
    219     "gfxHarfBuzzShaper.cpp",
    220     "gfxImageSurface.cpp",
    221     "gfxMathTable.cpp",
    222     "gfxPattern.cpp",
    223     "gfxPlatformFontList.cpp",
    224     "gfxPlatformWorker.cpp",
    225     "gfxScriptItemizer.cpp",
    226     "gfxSkipChars.cpp",
    227     "gfxSVGGlyphs.cpp",
    228     "gfxTextRun.cpp",
    229     "gfxUserFontSet.cpp",
    230     "gfxUtils.cpp",
    231     "SharedFontList.cpp",
    232     "SoftwareVsyncSource.cpp",
    233     "VsyncSource.cpp",
    234 ]
    235 
    236 UNIFIED_SOURCES += [
    237     "SkMemoryReporter.cpp",
    238 ]
    239 
    240 if CONFIG["MOZ_WIDGET_TOOLKIT"] == "cocoa":
    241     UNIFIED_SOURCES += [
    242         "gfxMacPlatformFontList.mm",
    243     ]
    244 elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "uikit":
    245     UNIFIED_SOURCES += [
    246         "IOSPlatformFontList.mm",
    247     ]
    248 elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "windows":
    249     UNIFIED_SOURCES += [
    250         "D3D11Checks.cpp",
    251         "DeviceManagerDx.cpp",
    252     ]
    253 
    254 if CONFIG["MOZ_ENABLE_SKIA_PDF"]:
    255     EXPORTS.mozilla.gfx += [
    256         "PrintTargetSkPDF.h",
    257     ]
    258     SOURCES += [
    259         "PrintTargetSkPDF.cpp",
    260     ]
    261 
    262 # We use ICU for normalization functions:
    263 USE_LIBS += [
    264     "icu",
    265 ]
    266 
    267 include("/ipc/chromium/chromium-config.mozbuild")
    268 
    269 FINAL_LIBRARY = "xul"
    270 
    271 LOCAL_INCLUDES += [
    272     "!/security/rlbox",
    273     "/dom/base",
    274     "/dom/media/platforms/apple",
    275     "/dom/xml",
    276     "/gfx/cairo/cairo/src",
    277     "/third_party/xsimd/include",
    278     "/widget/gtk",
    279 ]
    280 
    281 if CONFIG["MOZ_WIDGET_TOOLKIT"] in ("android", "gtk"):
    282     DEFINES["MOZ_ENABLE_FREETYPE"] = True
    283 
    284 if CONFIG["MOZ_WIDGET_TOOLKIT"] in ("android"):
    285     CXXFLAGS += CONFIG["CAIRO_FT_CFLAGS"]
    286 
    287 if CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk":
    288     CXXFLAGS += CONFIG["MOZ_GTK3_CFLAGS"]
    289     CFLAGS += CONFIG["MOZ_GTK3_CFLAGS"]
    290     CXXFLAGS += CONFIG["MOZ_PANGO_CFLAGS"]
    291 
    292 if CONFIG["MOZ_WAYLAND"]:
    293     CXXFLAGS += CONFIG["MOZ_WAYLAND_CFLAGS"]
    294 
    295 LOCAL_INCLUDES += CONFIG["SKIA_INCLUDES"]
    296 
    297 DEFINES["GRAPHITE2_STATIC"] = True
    298 
    299 CXXFLAGS += ["-Werror=switch"]
    300 
    301 include("/tools/fuzzing/libfuzzer-config.mozbuild")