layout/xul/moz.build
author Nika Layzell <nika@thelayzells.com>
Tue, 25 Sep 2018 17:34:53 +0200
changeset 507828 5e6dae0c1e5a4939ccd406f14607f7fafffd45a7
parent 504538 4d4ab7227b767020252035e70d78d11f070c7efb
child 533465 7d383b757d50494cb68ba7b1129d6457765a3314
permissions -rw-r--r--
Bug 1448426 - Wrap windows.h to avoid problematic define statements, r=froydnj,glandium By default, windows.h exposes a large number of problematic define statements which are UpperCamelCase, such as a define from `CreateWindow` to `CreateWindow{A,W}`. As many of these names are generic (e.g. CreateFile, CreateWindow), they can mess up Gecko code that may legitimately have its own methods with the same names. The header also defines some traditional SCREAMING_SNAKE_CASE defines which can mess up our code by conflicting with local values. This patch adds a simple code generator which generates wrappers for these defines, and uses them to wrap the windows.h wrapper using the `stl_wrappers` mechanism, allowing us to use windows.h in more places. Differential Revision: https://phabricator.services.mozilla.com/D10932

# -*- 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/.

with Files('**'):
    BUG_COMPONENT = ('Core', 'XUL')

with Files('*Menu*'):
    BUG_COMPONENT = ('Core', 'XP Toolkit/Widgets: Menus')

if CONFIG['ENABLE_TESTS']:
    MOCHITEST_MANIFESTS += ['test/mochitest.ini']
    MOCHITEST_CHROME_MANIFESTS += ['test/chrome.ini']
    BROWSER_CHROME_MANIFESTS += ['test/browser.ini']

XPIDL_SOURCES += [
    'nsIBoxObject.idl',
]

XPIDL_MODULE = 'layout_xul'

EXPORTS += [
    'nsBox.h',
    'nsIScrollbarMediator.h',
    'nsPIBoxObject.h',
    'nsXULPopupManager.h',
    'nsXULTooltipListener.h',
]

EXPORTS.mozilla.dom += [
    'BoxObject.h',
]

UNIFIED_SOURCES += [
    'BoxObject.cpp',
    'nsBox.cpp',
    'nsBoxFrame.cpp',
    'nsBoxLayout.cpp',
    'nsBoxLayoutState.cpp',
    'nsButtonBoxFrame.cpp',
    'nsRepeatService.cpp',
    'nsRootBoxFrame.cpp',
    'nsScrollbarButtonFrame.cpp',
    'nsScrollbarFrame.cpp',
    'nsSliderFrame.cpp',
    'nsSprocketLayout.cpp',
    'nsStackFrame.cpp',
    'nsStackLayout.cpp',
    'nsXULTooltipListener.cpp',
]

if CONFIG['MOZ_XUL']:
    UNIFIED_SOURCES += [
        'nsDeckFrame.cpp',
        'nsDocElementBoxFrame.cpp',
        'nsGroupBoxFrame.cpp',
        'nsImageBoxFrame.cpp',
        'nsLeafBoxFrame.cpp',
        'nsMenuBarFrame.cpp',
        'nsMenuBarListener.cpp',
        'nsMenuFrame.cpp',
        'nsMenuPopupFrame.cpp',
        'nsPopupSetFrame.cpp',
        'nsResizerFrame.cpp',
        'nsSplitterFrame.cpp',
        'nsTextBoxFrame.cpp',
        'nsTitleBarFrame.cpp',
        'nsXULLabelFrame.cpp',
        'nsXULPopupManager.cpp',
    ]

if CONFIG['MOZ_XUL']:
    DIRS += ['tree', 'grid']

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

FINAL_LIBRARY = 'xul'
LOCAL_INCLUDES += [
    '../base',
    '../generic',
    '../painting',
    '../style',
    '/dom/base',
    '/dom/xul',
]

if CONFIG['CC_TYPE'] in ('clang', 'gcc'):
    CXXFLAGS += ['-Wno-error=shadow']