build/clang-plugin/moz.build
author Kyle Machulis <kyle@nonpolynomial.com>
Fri, 11 Jan 2019 08:09:33 +0000
changeset 453529 85cbb065250d22e6d4e34fa5db536603cb205fbd
parent 437021 e3118f787e336e908dd7a8f42d71211cb8738bfe
child 466851 dc3b81670b01b95428ad7c361d586845185b4527
permissions -rw-r--r--
Bug 1518956 - Make C++ infallible/simplified versions of nsIURI::SchemeIs; r=valentin SchemeIs only throws exceptions on null arguments now. Assert arguments, as they should never be null anyways, and create an infallible C++ version. Differential Revision: https://phabricator.services.mozilla.com/D16143

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

HostSharedLibrary('clang-plugin')

HOST_SOURCES += ['!ThirdPartyPaths.cpp']

HOST_SOURCES += [
    'ArithmeticArgChecker.cpp',
    'AssertAssignmentChecker.cpp',
    'CanRunScriptChecker.cpp',
    'CustomAttributes.cpp',
    'CustomTypeAnnotation.cpp',
    'DanglingOnTemporaryChecker.cpp',
    'DiagnosticsMatcher.cpp',
    'ExplicitImplicitChecker.cpp',
    'ExplicitOperatorBoolChecker.cpp',
    'KungFuDeathGripChecker.cpp',
    'MozCheckAction.cpp',
    'MustOverrideChecker.cpp',
    'MustReturnFromCallerChecker.cpp',
    'MustUseChecker.cpp',
    'NaNExprChecker.cpp',
    'NeedsNoVTableTypeChecker.cpp',
    'NoAddRefReleaseOnReturnChecker.cpp',
    'NoAutoTypeChecker.cpp',
    'NoDuplicateRefCntMemberChecker.cpp',
    'NoExplicitMoveConstructorChecker.cpp',
    'NonMemMovableMemberChecker.cpp',
    'NonMemMovableTemplateArgChecker.cpp',
    'NonParamInsideFunctionDeclChecker.cpp',
    'OverrideBaseCallChecker.cpp',
    'OverrideBaseCallUsageChecker.cpp',
    'ParamTraitsEnumChecker.cpp',
    'RefCountedCopyConstructorChecker.cpp',
    'RefCountedInsideLambdaChecker.cpp',
    'ScopeChecker.cpp',
    'SprintfLiteralChecker.cpp',
    'TrivialCtorDtorChecker.cpp',
    'VariableUsageHelpers.cpp',
]

if CONFIG['OS_ARCH'] == 'WINNT':
    HOST_SOURCES += [
        'LoadLibraryUsageChecker.cpp',
    ]

if CONFIG['ENABLE_MOZSEARCH_PLUGIN']:
    HOST_SOURCES += [
        'mozsearch-plugin/FileOperations.cpp',
        'mozsearch-plugin/JSONFormatter.cpp',
        'mozsearch-plugin/MozsearchIndexer.cpp',
        'mozsearch-plugin/StringOperations.cpp',
    ]

GENERATED_FILES += ['ThirdPartyPaths.cpp']
third_party_paths = GENERATED_FILES['ThirdPartyPaths.cpp']
third_party_paths.script = "ThirdPartyPaths.py:generate"
third_party_paths.inputs = [
    '/tools/rewriting/ThirdPartyPaths.txt',
]

HOST_COMPILE_FLAGS['STL'] = []
HOST_COMPILE_FLAGS['VISIBILITY'] = []

# libc++ is required to build plugins against clang on OS X.
if CONFIG['HOST_OS_ARCH'] == 'Darwin':
    HOST_CXXFLAGS += ['-stdlib=libc++']

DIRS += [
    'tests',
]


# In the current moz.build world, we need to override essentially every
# variable to limit ourselves to what we need to build the clang plugin.
if CONFIG['HOST_OS_ARCH'] == 'WINNT':
    extra_cxxflags = ['-GR-', '-EHsc']
else:
    extra_cxxflags = ['-fno-rtti', '-fno-exceptions']

if CONFIG['LLVM_CXXFLAGS']:
    HOST_COMPILE_FLAGS['HOST_CXXFLAGS'] = CONFIG['LLVM_CXXFLAGS'] + extra_cxxflags

# Avoid -DDEBUG=1 on the command line, which conflicts with a #define
# DEBUG(...) in llvm headers.
DEFINES['DEBUG'] = False