summaryrefslogtreecommitdiff
path: root/toolkit/xre/moz.build
blob: b717e971c30da91a32ba4effd1004e34c6195032 (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
129
130
131
132
133
134
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
# 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/.

XPIDL_SOURCES += ['nsINativeAppSupport.idl']

if CONFIG['OS_ARCH'] == 'WINNT':
    XPIDL_SOURCES += [
        'nsIWinAppHelper.idl',
    ]

XPIDL_MODULE = 'xulapp'

EXPORTS += ['nsAppRunner.h']

if CONFIG['MOZ_INSTRUMENT_EVENT_LOOP']:
    EXPORTS += ['EventTracer.h']

if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
    UNIFIED_SOURCES += ['nsNativeAppSupportWin.cpp']
elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'uikit':
    UNIFIED_SOURCES += [
        'nsNativeAppSupportDefault.cpp',
        'UIKitDirProvider.mm',
    ]
elif 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']:
    UNIFIED_SOURCES += ['nsNativeAppSupportUnix.cpp']
else:
    UNIFIED_SOURCES += ['nsNativeAppSupportDefault.cpp']

if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk3':
    UNIFIED_SOURCES += ['nsGDKErrorHandler.cpp']

if CONFIG['MOZ_X11']:
    EXPORTS += ['nsX11ErrorHandler.h']
    UNIFIED_SOURCES += ['nsX11ErrorHandler.cpp']

UNIFIED_SOURCES += [
    'CreateAppData.cpp',
    'nsConsoleWriter.cpp',
    'nsNativeAppSupportBase.cpp',
    'nsSigHandlers.cpp',
    'nsXREDirProvider.cpp',
]

# nsAppRunner.cpp and ProfileReset.cpp cannot be built in unified mode because
# they pull in OS X system headers.
# nsEmbedFunctions.cpp cannot be built in unified mode because it pulls in X11 headers.
SOURCES += [
    'nsAppRunner.cpp',
    'nsEmbedFunctions.cpp',
    'ProfileReset.cpp',
]

if CONFIG['MOZ_GL_DEFAULT_PROVIDER'] == 'GLX':
    UNIFIED_SOURCES += [
        'glxtest.cpp',
    ]

if CONFIG['MOZ_INSTRUMENT_EVENT_LOOP']:
    UNIFIED_SOURCES += [
        'EventTracer.cpp',
    ]

if CONFIG['MOZ_UPDATER']:
    DEFINES['MOZ_UPDATER'] = True
    UNIFIED_SOURCES += [
        'nsUpdateDriver.cpp',
    ]

include('/ipc/chromium/chromium-config.mozbuild')

FINAL_LIBRARY = 'xul'

if CONFIG['MOZ_GL_DEFAULT_PROVIDER'] == 'GLX':
    DEFINES['USE_GLX_TEST'] = True

for var in ('MOZ_APP_NAME',
            'MOZ_APP_BASENAME',
            'MOZ_APP_VERSION',
            'OS_TARGET',
            'MOZ_WIDGET_TOOLKIT'):
    DEFINES[var] = '"%s"' % CONFIG[var]

if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
    DEFINES['WIN32_LEAN_AND_MEAN'] = True
    DEFINES['UNICODE'] = True
    DEFINES['_UNICODE'] = True

if CONFIG['TARGET_XPCOM_ABI']:
    DEFINES['TARGET_OS_ABI'] = '"%s_%s"' % (CONFIG['OS_TARGET'],
                                            CONFIG['TARGET_XPCOM_ABI'])

if CONFIG['OS_ARCH'] == 'Linux' and 'lib64' in CONFIG['libdir']:
    DEFINES['HAVE_USR_LIB64_DIR'] = True

DEFINES['GRE_MILESTONE'] = CONFIG['GRE_MILESTONE']

for var in ('APP_VERSION', 'APP_ID'):
    DEFINES[var] = CONFIG['MOZ_%s' % var]

if CONFIG['MOZ_PHOENIX']:
    DEFINES['MOZ_BUILD_APP_IS_BROWSER'] = True

LOCAL_INCLUDES += [
    '../profile',
    '/config',
    '/dom/base',
    '/dom/ipc',
    '/testing/gtest/mozilla',
    '/xpcom/build',
]

if CONFIG['MOZ_ENABLE_XREMOTE']:
    LOCAL_INCLUDES += [
        '/widget/xremoteclient',
    ]

CXXFLAGS += CONFIG['TK_CFLAGS']
CXXFLAGS += CONFIG['MOZ_DBUS_CFLAGS']
CXXFLAGS += CONFIG['MOZ_DBUS_GLIB_CFLAGS']

if 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']:
    CXXFLAGS += CONFIG['MOZ_PANGO_CFLAGS']

DEFINES['TOPOBJDIR'] = TOPOBJDIR
FINAL_TARGET_PP_FILES += ['platform.ini']

if CONFIG['GNU_CXX']:
    CXXFLAGS += ['-Wno-error=shadow']

if CONFIG['MOZ_IPDL_TESTS']:
    DEFINES['MOZ_IPDL_TESTS'] = True