config/make-system-wrappers.py
author Robert Bartlensky <rbartlensky@mozilla.com>
Thu, 13 Sep 2018 20:58:03 +0000
changeset 436320 aae4f349fa588aa844cfb14fae278b776aed6cb7
parent 419630 da3c81f986fa63b42a2874b1791eddcdbfbe8424
child 446490 1f1eec6abd9b1a33186fd463ba1406adb7e1c233
permissions -rw-r--r--
Bug 1479503: Check infer in ./mach static-analysis autotest. r=nalexander Adds infer to ./mach static-analysis autotest. Differential Revision: https://phabricator.services.mozilla.com/D5692

# 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/.
from __future__ import print_function
import os
from mozbuild.util import FileAvoidWrite

header_template = '''#pragma GCC system_header
#pragma GCC visibility push(default)
#include_next <%(header)s>
#pragma GCC visibility pop
'''


# The 'unused' arg is the output file from the file_generate action. We actually
# generate all the files in header_list
def gen_wrappers(unused, outdir, *header_list):
    for header in header_list:
        with FileAvoidWrite(os.path.join(outdir, header)) as f:
            f.write(header_template % {
                'header': header,
            })