dom/plugins/test/testplugin/testplugin.mozbuild
author Cosmin Sabou <csabou@mozilla.com>
Thu, 02 Aug 2018 19:59:53 +0300
changeset 487628 f7f4ba3486b5e44b6ccdc3b150f5aa0aab76ffb7
parent 487622 5950c9d63c3b4fd63a25464a7b50944aaec7079f
child 487990 997fd8419a4b28cdaaf3263e88dcad585ccfb101
permissions -rw-r--r--
Backed out changeset 5950c9d63c3b (bug 1090497) for build bustages on several files. CLOSED TREE

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

UNIFIED_SOURCES += [
    'nptest.cpp',
    'nptest_utils.cpp',
]

UNIFIED_SOURCES += [
    '%s/nptest_name.cpp' % relative_path,
]

toolkit = CONFIG['MOZ_WIDGET_TOOLKIT']
if toolkit == 'cocoa':
    UNIFIED_SOURCES += [
        'nptest_macosx.mm'
    ]
elif toolkit == 'gtk3':
    UNIFIED_SOURCES += [
        'nptest_gtk2.cpp',
    ]
elif toolkit == 'windows':
    UNIFIED_SOURCES += [
        'nptest_windows.cpp',
    ]
    OS_LIBS += [
        'msimg32',
        'imm32'
    ]

# must link statically with the CRT; nptest isn't Gecko code
USE_STATIC_LIBS = True

# Don't use STL wrappers; nptest isn't Gecko code
DisableStlWrapping()

NO_PGO = True

if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
    RCFILE  = 'nptest.rc'
    RESFILE = 'nptest.res'
    DEFFILE = SRCDIR + '/nptest.def'

if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa' and '64' in CONFIG['OS_TEST']:
    OS_LIBS += ['-framework Carbon']

if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk3':
    CXXFLAGS += CONFIG['MOZ_GTK2_CFLAGS']
    CFLAGS += CONFIG['MOZ_GTK2_CFLAGS']
    OS_LIBS += CONFIG['MOZ_GTK2_LIBS']
    OS_LIBS += CONFIG['XLDFLAGS']
    OS_LIBS += CONFIG['XLIBS']
    OS_LIBS += CONFIG['XEXT_LIBS']

if CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
    # This is intended as a temporary hack to support building with VS2015.
    # conversion from 'X' to 'Y' requires a narrowing conversion
    CXXFLAGS += ['-wd4838']

if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
    FINAL_TARGET = 'dist/plugins/%s.plugin/Contents/MacOS' % cocoa_name
    OBJDIR_FILES.dist.plugins['%s.plugin' % cocoa_name].Contents += ['%s/Info.plist' % relative_path]
else:
    FINAL_TARGET = 'dist/plugins'

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