config/moz.build
author Narcis Beleuzu <nbeleuzu@mozilla.com>
Fri, 12 Jan 2018 11:32:58 +0200
changeset 398983 c011bb60725113e3da91a813b8ef250cf2109b3d
parent 395870 d7fcb5272323838f125aea773258eb3fab187510
child 401287 b11e44bb24295326ca7ed0ac614cace4f6389792
permissions -rw-r--r--
Backed out 5 changesets (bug 1418425) for windows build bustage "mbsdiff.exe : fatal error LNK1120". on a CLOSED TREE Backed out changeset 8154486d3e00 (bug 1418425) Backed out changeset d32ae48690a7 (bug 1418425) Backed out changeset 772538a846cb (bug 1418425) Backed out changeset 29fd023f999f (bug 1418425) Backed out changeset 218077e82115 (bug 1418425)

# -*- 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', 'Build Config')

DIST_INSTALL = False
# For sanity's sake, we compile nsinstall without the wrapped system
# headers, so that we can use it to set up the wrapped system headers.
NoVisibilityFlags()

CONFIGURE_SUBST_FILES += [
    'doxygen.cfg',
    'makefiles/test/Makefile',
    'tests/src-simple/Makefile',
]

if CONFIG['HOST_OS_ARCH'] != 'WINNT':
    HOST_SOURCES += [
        'nsinstall.c',
        'pathsub.c',
    ]
    HostProgram('nsinstall_real')

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

PYTHON_UNITTEST_MANIFESTS += [
    'tests/python.ini',
]

if CONFIG['CC_TYPE'] in ('clang', 'gcc') and CONFIG['MOZ_OPTIMIZE']:
    CFLAGS += ['-O3']

HOST_DEFINES = {
    'UNICODE': True,
    '_UNICODE': True,
}

include('stl-headers.mozbuild')
if CONFIG['WRAP_STL_INCLUDES']:
    stl_compiler = None
    if CONFIG['CC_TYPE'] in ('clang', 'gcc'):
        stl_compiler = 'gcc'
    elif CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
        stl_compiler = 'msvc'

    if stl_compiler:
        template_file = SRCDIR + '/%s-stl-wrapper.template.h' % stl_compiler
        output_dir = '../dist/stl_wrappers'
        # We have to use a sentinel file as the first file because the
        # file_generate action will create it for us, but we want to create all
        # the files in gen_wrappers()
        outputs = tuple(['stl.sentinel'] + ['%s/%s' % (output_dir, h) for h in stl_headers])
        GENERATED_FILES += [outputs]
        stl = GENERATED_FILES[outputs]
        stl.script = 'make-stl-wrappers.py:gen_wrappers'
        stl.flags = [output_dir, stl_compiler, template_file]
        stl.flags.extend(stl_headers)

if CONFIG['WRAP_SYSTEM_INCLUDES']:
    include('system-headers.mozbuild')
    output_dir = '../dist/system_wrappers'
    outputs = tuple(['system-header.sentinel'] + ['%s/%s' % (output_dir, h) for h in stl_headers + system_headers])
    GENERATED_FILES += [outputs]
    system = GENERATED_FILES[outputs]
    system.script = 'make-system-wrappers.py:gen_wrappers'
    system.flags = [output_dir]
    system.flags.extend(stl_headers)
    system.flags.extend(system_headers)