bug 1409276 - disable warnings-as-errors for Rust libraries/programs. r=chmanchester

When compiling C/C++ sources via Rust build scripts there's no point in
enabling warnings-as-errors as all such code is third-party code.

MozReview-Commit-ID: 5pGH6w9ZE2I

--HG--
extra : rebase_source : ad36be6aed39d55055728f85b799adf5f0cf0f4b
This commit is contained in:
Ted Mielczarek 2018-07-16 13:52:14 -04:00
Родитель c8b54935b3
Коммит ce290f24b1
2 изменённых файлов: 9 добавлений и 4 удалений

Просмотреть файл

@ -53,6 +53,9 @@ def Library(name):
'''Template for libraries.'''
LIBRARY_NAME = name
@template
def AllowCompilerWarnings():
COMPILE_FLAGS['WARNINGS_AS_ERRORS'] = []
@template
def RustLibrary(name, features=None, target_dir=None):
@ -60,6 +63,8 @@ def RustLibrary(name, features=None, target_dir=None):
Library(name)
IS_RUST_LIBRARY = True
# Some Rust build scripts compile C/C++ sources, don't error on warnings for them.
AllowCompilerWarnings()
if features:
RUST_LIBRARY_FEATURES = features
@ -125,6 +130,8 @@ def HostRustLibrary(name, features=None):
HostLibrary(name)
IS_RUST_LIBRARY = True
# Some Rust build scripts compile C/C++ sources, don't error on warnings for them.
AllowCompilerWarnings()
if features:
HOST_RUST_LIBRARY_FEATURES = features
@ -137,10 +144,6 @@ def DisableStlWrapping():
def NoVisibilityFlags():
COMPILE_FLAGS['VISIBILITY'] = []
@template
def AllowCompilerWarnings():
COMPILE_FLAGS['WARNINGS_AS_ERRORS'] = []
@template
def ForceInclude(*headers):
"""Force includes a set of header files in C++ compilations"""

Просмотреть файл

@ -3,6 +3,8 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
RUST_PROGRAMS += ["geckodriver"]
# Some Rust build scripts compile C/C++ sources, don't error on warnings for them.
AllowCompilerWarnings()
# https://bugzil.la/1425365
if CONFIG["OS_ARCH"] != "WINNT":