tor-browser

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

moz.build (6602B)


      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("**"):
      8     BUG_COMPONENT = ("Core", "DOM: Bindings (WebIDL)")
      9 
     10 TEST_DIRS += ["test"]
     11 
     12 XPIDL_SOURCES += ["nsIScriptError.idl"]
     13 
     14 XPIDL_MODULE = "dom_bindings"
     15 
     16 EXPORTS.ipc += [
     17     "ErrorIPCUtils.h",
     18 ]
     19 
     20 EXPORTS.mozilla += [
     21     "ErrorResult.h",
     22     "RootedOwningNonNull.h",
     23     "RootedRefPtr.h",
     24 ]
     25 
     26 EXPORTS.mozilla.dom += [
     27     "AtomList.h",
     28     "BindingCallContext.h",
     29     "BindingDeclarations.h",
     30     "BindingIPCUtils.h",
     31     "BindingUtils.h",
     32     "CallbackFunction.h",
     33     "CallbackInterface.h",
     34     "CallbackObject.h",
     35     "DOMExceptionNames.h",
     36     "DOMJSClass.h",
     37     "DOMJSProxyHandler.h",
     38     "DOMString.h",
     39     "Errors.msg",
     40     "Exceptions.h",
     41     "FakeString.h",
     42     "IterableIterator.h",
     43     "JSSlots.h",
     44     "NonRefcountedDOMObject.h",
     45     "Nullable.h",
     46     "ObservableArrayProxyHandler.h",
     47     "PinnedStringId.h",
     48     "PrimitiveConversions.h",
     49     "ProxyHandlerUtils.h",
     50     "Record.h",
     51     "RemoteObjectProxy.h",
     52     "RootedDictionary.h",
     53     "RootedRecord.h",
     54     "RootedSequence.h",
     55     "SimpleGlobalObject.h",
     56     "SpiderMonkeyInterface.h",
     57     "ToJSValue.h",
     58     "TypedArray.h",
     59     "UnionMember.h",
     60     "WebIDLGlobalNameHash.h",
     61     "XrayExpandoClass.h",
     62 ]
     63 
     64 
     65 # Generated bindings reference *Binding.h, not mozilla/dom/*Binding.h. And,
     66 # since we generate exported bindings directly to $(DIST)/include, we need
     67 # to add that path to the search list.
     68 #
     69 # Ideally, binding generation uses the prefixed header file names.
     70 # Bug 932082 tracks.
     71 LOCAL_INCLUDES += [
     72     "!/dist/include/mozilla/dom",
     73 ]
     74 
     75 LOCAL_INCLUDES += [
     76     "/dom/base",
     77     "/dom/battery",
     78     "/dom/canvas",
     79     "/dom/geolocation",
     80     "/dom/html",
     81     "/dom/indexedDB",
     82     "/dom/media/webaudio",
     83     "/dom/media/webrtc",
     84     "/dom/media/webrtc/common/time_profiling",
     85     "/dom/media/webrtc/jsapi",
     86     "/dom/media/webrtc/libwebrtcglue",
     87     "/dom/media/webrtc/transport",
     88     "/dom/media/webspeech/recognition",
     89     "/dom/svg",
     90     "/dom/xml",
     91     "/dom/xslt/base",
     92     "/dom/xslt/xpath",
     93     "/dom/xul",
     94     "/js/xpconnect/src",
     95     "/js/xpconnect/wrappers",
     96     "/layout/generic",
     97     "/layout/style",
     98     "/layout/xul/tree",
     99     "/media/webrtc/",
    100     "/netwerk/base/",
    101     "/third_party/abseil-cpp",
    102     "/third_party/libwebrtc",
    103 ]
    104 
    105 LOCAL_INCLUDES += ["/third_party/msgpack/include"]
    106 
    107 DEFINES["GOOGLE_PROTOBUF_NO_RTTI"] = True
    108 DEFINES["GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER"] = True
    109 
    110 UNIFIED_SOURCES += [
    111     "BindingUtils.cpp",
    112     "CallbackInterface.cpp",
    113     "CallbackObject.cpp",
    114     "DOMJSProxyHandler.cpp",
    115     "Exceptions.cpp",
    116     "IterableIterator.cpp",
    117     "nsScriptError.cpp",
    118     "nsScriptErrorWithStack.cpp",
    119     "ObservableArrayProxyHandler.cpp",
    120     "RemoteObjectProxy.cpp",
    121     "SimpleGlobalObject.cpp",
    122     "ToJSValue.cpp",
    123     "WebIDLGlobalNameHash.cpp",
    124 ]
    125 
    126 # Some tests, including those for for maplike and setlike, require bindings
    127 # to be built, which means they must be included in libxul. This breaks the
    128 # "no test classes are exported" rule stated in the test/ directory, but it's
    129 # the only way this will work. Test classes are only built in debug mode, and
    130 # all tests requiring use of them are only run in debug mode.
    131 if CONFIG["MOZ_DEBUG"] and CONFIG["ENABLE_TESTS"]:
    132     EXPORTS.mozilla.dom += [
    133         "test/TestFunctions.h",
    134         "test/TestInterfaceAsyncIterableDouble.h",
    135         "test/TestInterfaceAsyncIterableDoubleUnion.h",
    136         "test/TestInterfaceAsyncIterableSingle.h",
    137         "test/TestInterfaceAsyncIterableSingleWithArgs.h",
    138         "test/TestInterfaceIterableDouble.h",
    139         "test/TestInterfaceIterableDoubleUnion.h",
    140         "test/TestInterfaceIterableSingle.h",
    141         "test/TestInterfaceLength.h",
    142         "test/TestInterfaceMaplike.h",
    143         "test/TestInterfaceMaplikeJSObject.h",
    144         "test/TestInterfaceMaplikeObject.h",
    145         "test/TestInterfaceObservableArray.h",
    146         "test/TestInterfaceSetlike.h",
    147         "test/TestInterfaceSetlikeNode.h",
    148         "test/TestReflectedHTMLAttribute.h",
    149         "test/TestTrialInterface.h",
    150         "test/WrapperCachedNonISupportsTestInterface.h",
    151     ]
    152     UNIFIED_SOURCES += [
    153         "test/TestFunctions.cpp",
    154         "test/TestInterfaceAsyncIterableDouble.cpp",
    155         "test/TestInterfaceAsyncIterableDoubleUnion.cpp",
    156         "test/TestInterfaceAsyncIterableSingle.cpp",
    157         "test/TestInterfaceAsyncIterableSingleWithArgs.cpp",
    158         "test/TestInterfaceIterableDouble.cpp",
    159         "test/TestInterfaceIterableDoubleUnion.cpp",
    160         "test/TestInterfaceIterableSingle.cpp",
    161         "test/TestInterfaceLength.cpp",
    162         "test/TestInterfaceMaplike.cpp",
    163         "test/TestInterfaceMaplikeJSObject.cpp",
    164         "test/TestInterfaceMaplikeObject.cpp",
    165         "test/TestInterfaceObservableArray.cpp",
    166         "test/TestInterfaceSetlike.cpp",
    167         "test/TestInterfaceSetlikeNode.cpp",
    168         "test/TestReflectedHTMLAttribute.cpp",
    169         "test/TestTrialInterface.cpp",
    170         "test/WrapperCachedNonISupportsTestInterface.cpp",
    171     ]
    172 
    173 include("/ipc/chromium/chromium-config.mozbuild")
    174 
    175 FINAL_LIBRARY = "xul"
    176 
    177 SPHINX_TREES["webidl"] = "docs"
    178 
    179 with Files("docs/**"):
    180     SCHEDULES.exclusive = ["docs"]
    181 
    182 SPHINX_PYTHON_PACKAGE_DIRS += ["mozwebidlcodegen"]
    183 
    184 with Files("mozwebidlcodegen/**.py"):
    185     SCHEDULES.inclusive += ["docs"]
    186 
    187 
    188 PYTHON_UNITTEST_MANIFESTS += [
    189     "mozwebidlcodegen/test/python.toml",
    190 ]
    191 
    192 if CONFIG["CC_TYPE"] == "gcc":
    193     CXXFLAGS += [
    194         "-Wno-maybe-uninitialized",
    195     ]
    196 
    197 if CONFIG["COMPILE_ENVIRONMENT"]:
    198     GeneratedFile(
    199         "CSSStyleProperties.webidl",
    200         script="GenerateCSSPropListWebIDL.py",
    201         entry_point="generateCSSStyleProperties",
    202         inputs=["!/layout/style/ServoCSSPropList.py"],
    203     )
    204     GeneratedFile(
    205         "CSSPageDescriptors.webidl",
    206         script="GenerateCSSPropListWebIDL.py",
    207         entry_point="generateCSSPageDescriptors",
    208         inputs=["!/layout/style/ServoCSSPropList.py"],
    209     )
    210     GeneratedFile(
    211         "CSSPositionTryDescriptors.webidl",
    212         script="GenerateCSSPropListWebIDL.py",
    213         entry_point="generateCSSPositionTryDescriptors",
    214         inputs=["!/layout/style/ServoCSSPropList.py"],
    215     )
    216 
    217 # Old versions of GCC issue false-positive warnings about buffer overflow.
    218 if CONFIG["CC_TYPE"] == "gcc" and 10 <= int(CONFIG["CC_VERSION"].split(".")[0]) < 12:
    219     CXXFLAGS += ["-Wno-stringop-overflow"]