config/moz.build
author Mozilla Releng Treescript <release+treescript@mozilla.org>
Thu, 13 May 2021 18:57:44 +0000
changeset 644565 34a0727058f8b9067ca084dd5b9069fbd41e70dd
parent 620830 994ae8e4833c90447d91f0e26a718573cff5a514
permissions -rw-r--r--
no bug - Bumping Firefox l10n changesets r=release a=l10n-bump cs -> 8ad1ae100fca65eb8759d652e342474fcb6c9253 cy -> 006b24131d69b9a11b4547a713e9c2989870f099 da -> 945417728fc338e6daa717afac9439569af4960e dsb -> c27c4696ab1595f8e3d9ed60d94a5ac85580a4ef el -> e0ae2eb55eb4d7d1d71ca9c76e965b446e71cb6c en-GB -> 206806495dbc34684c65c00af9d34379be61387e es-AR -> cd765580823b4687c1b4a30f399270f759a72c5d es-CL -> a534a6b13139c26ef66dc0848264ea48f3d5873d fi -> d497a878dd115b9556ab3aac26da8012ef20141c fr -> 6455a6f788f0e70efead9f7bbd91bbbaf7688123 gd -> 6b01f26cfd0e50c0f93e4fbfc77133c53e5d2960 he -> fa7289107632a059f0d0905097bbe54d80d8e9ec hsb -> 76c635644278e0e7c0781f0ddbfab98981612d9e hu -> 2d1abd0a983307d8003e9590b60817f1e4cb658a ia -> b76d27b59178c70960bccc38af7c243975bd4ed5 it -> 9b80f811247966070550f4c59ca32621440d5180 ka -> 298ab020a3ad9926a4002fa310b355c9f30badc6 kab -> 8bc67ce295c8053eb2cf778a24bf5e028abaf968 ko -> e12836f04891a17213732f8286dbe3fbff7aef77 lt -> 7d854e695a6f83c1357e972ed1239abd884a7c9e mk -> 12bc4190cb2b86c3d0372b51b5902fcbc129e400 nb-NO -> fb040b7d43936ce385a7c6f656c0572eab87161b nl -> 0e7e2ff5fd88b78d55634f5328943c4a3a72bd27 nn-NO -> 815606b90e18da8d37ffc981a740511b3658edfa oc -> 021786ac7813a717ef7a12fb56bc7ca54f3a2c34 pt-BR -> 9c49820e2001df24802781decbd0bfa26e60fce3 rm -> 7b93a344c406241cf5a6a7d6889af80af5a5c807 sk -> 78dec26f8cd76e7c3dccc6ff084f1d8bdb84aaa8 sl -> 74a52c8fc4d529420207488b7ea73d258937d5e3 sq -> 6a51ec8fc0b6b3429ff9301a8f6f2deb0fe9fe12 sv-SE -> 0de3019ee10ea2f050f62c66e3164fa9deb39442 tr -> a91cec7706499b3eabd8e2fdbd6f60ea8cde6f71 uk -> ba8d9d9d5959dfe76c2fc1fa1138be510deabfbd vi -> 06b7e67ab5168e4a4c0f2b3defc676dde95c73ad zh-CN -> 051b8b79e6db9faedd35ff9fe4dcda65818e33c1

# -*- 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 = ("Firefox Build System", "General")

with Files("mozunit/**"):
    BUG_COMPONENT = ("Testing", "Python Test")

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 += [
    "tests/src-simple/Makefile",
]

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

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

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

HOST_DEFINES["UNICODE"] = True
HOST_DEFINES["_UNICODE"] = True

include("stl-headers.mozbuild")
if CONFIG["WRAP_STL_INCLUDES"]:
    stl_compiler = None
    if CONFIG["OS_TARGET"] == "WINNT":
        stl_compiler = "msvc"
    else:
        stl_compiler = "gcc"

    if stl_compiler:
        # Note that the 'stl_wrappers' folder is known to the build system as
        # containing generated files; if this is changed here then the code in
        # GeneratedFile.__init__ in python/mozbuild/mozbuild/frontend/data.py
        # might need to be updated accordingly as well.
        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]
        )
        GeneratedFile(
            *outputs,
            script="make-stl-wrappers.py",
            entry_point="gen_wrappers",
            flags=[TOPOBJDIR + output_dir, stl_compiler, template_file] + stl_headers
        )

    # Wrap <windows.h> to make it easier to use correctly
    # NOTE: If we aren't wrapping STL includes, we're building part of the browser
    # which won't need this wrapper, such as L10N. Just don't try to generate the
    # wrapper in that case.
    if CONFIG["OS_TARGET"] == "WINNT":
        GeneratedFile(
            "/dist/stl_wrappers/windows.h",
            script="make-windows-h-wrapper.py",
            entry_point="generate",
            inputs=[
                "windows-h-constant.decls.h",
                "windows-h-unicode.decls.h",
                "windows-h-wrapper.template.h",
            ],
            flags=[stl_compiler],
        )

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]
    )
    GeneratedFile(
        *outputs,
        script="make-system-wrappers.py",
        entry_point="gen_wrappers",
        flags=[TOPOBJDIR + output_dir] + stl_headers + system_headers
    )

if CONFIG["COMPILE_ENVIRONMENT"] and CONFIG["CBINDGEN"]:
    GeneratedFile(
        "cbindgen-metadata.json",
        script="/build/RunCbindgen.py",
        entry_point="generate_metadata",
        inputs=["!/.cargo/config"],
    )