summaryrefslogtreecommitdiffstats
path: root/accessible/ipc/win/handler/moz.build
blob: 46f3cb95a469917847b56c8818753b8e3645ceca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
# -*- Mode: python; 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/.

SharedLibrary("AccessibleHandler")

EXPORTS.mozilla.a11y += [
    "AccessibleHandler.h",
    "HandlerDataCleanup.h",
]

LOCAL_INCLUDES += [
    "/accessible/interfaces/ia2",
    "/ipc/mscom/oop",
]

# We want to generate distinct UUIDs on a per-channel basis, so we need
# finer granularity than the standard preprocessor definitions offer.
# These defines allow us to separate local builds from automated builds,
# as well as separate beta from release.
flags = []
if CONFIG["MOZ_UPDATE_CHANNEL"] == "default":
    flags += ["-DUSE_LOCAL_UUID"]
elif CONFIG["MOZ_UPDATE_CHANNEL"] == "beta":
    flags += ["-DUSE_BETA_UUID"]

GeneratedFile(
    "HandlerData.h",
    "HandlerData_p.c",
    "HandlerData_i.c",
    "HandlerData_c.c",
    "HandlerData_dlldata.c",
    "HandlerData.tlb",
    inputs=["HandlerData.idl"],
    script="/build/midl.py",
    entry_point="midl",
    flags=flags
    + [
        "-I",
        TOPOBJDIR,
        "-I",
        TOPOBJDIR + "/dist/include",
        "-I",
        TOPSRCDIR + "/other-licenses/ia2",
        "-I",
        SRCDIR,
        "-acf",
        SRCDIR + "/HandlerData.acf",
        "-dlldata",
        OBJDIR + "/HandlerData_dlldata.c",
    ],
)

SOURCES += [
    "!HandlerData_c.c",
    "!HandlerData_dlldata.c",
    "!HandlerData_i.c",
    "!HandlerData_p.c",
    "AccessibleHandler.cpp",
    "AccessibleHandlerControl.cpp",
    "HandlerChildEnumerator.cpp",
    "HandlerRelation.cpp",
    "HandlerTextLeaf.cpp",
]

EXPORTS += [
    "!HandlerData.h",
    "!HandlerData_i.c",
]

# Give some symbols a unique name in each translation unit, to avoid
# collisions caused by https://llvm.org/pr41817.
if CONFIG["CC_TYPE"] == "clang-cl":
    SOURCES["!HandlerData_p.c"].flags += [
        "-DHandlerData__MIDL_ProcFormatString=HandlerData__MIDL_ProcFormatString__HandlerData_p"
    ]
    SOURCES["!HandlerData_p.c"].flags += [
        "-DHandlerData__MIDL_TypeFormatString=HandlerData__MIDL_TypeFormatString__HandlerData_p"
    ]
    for p in ("dlldata", "c", "i", "p"):
        SOURCES["!HandlerData_%s.c" % p].flags += [
            "-DUserMarshalRoutines=UserMarshalRoutines__HandlerData_%s" % p
        ]

DEFFILE = "AccessibleHandler.def"

USE_LIBS += [
    "mscom_oop",
]

OS_LIBS += [
    "rpcrt4",
    "oleacc",
]

RCINCLUDE = "AccessibleHandler.rc"

# Suppress warnings from the MIDL generated code.
if CONFIG["CC_TYPE"] == "clang-cl":
    CFLAGS += [
        "-Wno-extern-initializer",
        "-Wno-incompatible-pointer-types",
        "-Wno-missing-braces",
        "-Wno-unused-const-variable",
    ]

# Since we are defining our own COM entry points (DllRegisterServer et al),
# but we still want to be able to delegate some work to the generated code,
# we add the prefix "Proxy" to all of the generated counterparts.
DEFINES["ENTRY_PREFIX"] = "Proxy"
DEFINES["REGISTER_PROXY_DLL"] = True
LIBRARY_DEFINES["MOZ_MSCOM_REMARSHAL_NO_HANDLER"] = True

# This DLL may be loaded into other processes, so we need static libs for
# Windows 7 and Windows 8.
USE_STATIC_LIBS = True

LIBRARY_DEFINES["UNICODE"] = True
LIBRARY_DEFINES["_UNICODE"] = True
LIBRARY_DEFINES["MOZ_NO_MOZALLOC"] = True
DisableStlWrapping()

DELAYLOAD_DLLS += [
    "advapi32.dll",
    "ktmw32.dll",
]