forked from mozilla/gecko-dev
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 1407432 - Move system wrapper generation to moz.build; r=froydnj
The make-system-wrappers.py invocation is largely identical to make-stl-wrappers.py, though this script generates wrappers for both the STL headers and every other system header that can be used. Note that the nsprpub script didn't create multiple layers of subdirectories properly, so for example the 'ia64/sys/inline.h' wrapper is now generated properly. Additionally, MOZ_SYSTEM_ICU define was incorrectly using '#ifdef' instead of '#if ... == 1', which causes those unicode headers to have wrappers when they shouldn't. These will show up as differences when comparing the Makefile output to the moz.build output. MozReview-Commit-ID: KvQAawfzXao --HG-- extra : rebase_source : 758e325c6ec192d83fcfa10f8c878ba2629e45a3
- Loading branch information
Showing
4 changed files
with
1,380 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# 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 | ||
import sys | ||
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, | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.