Bug 1795215 - Keep -Wno-* flags when disabling compiler warnings. r=firefox-build-system-reviewers,andi

Differential Revision: https://phabricator.services.mozilla.com/D159364
This commit is contained in:
Mike Hommey 2022-10-18 19:46:45 +00:00
Родитель 8f4d47c529
Коммит c13f7a7abe
1 изменённых файлов: 7 добавлений и 4 удалений

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

@ -60,10 +60,13 @@ def AllowCompilerWarnings():
@template
def DisableCompilerWarnings():
COMPILE_FLAGS['WARNINGS_CFLAGS'] = []
COMPILE_FLAGS['WARNINGS_CXXFLAGS'] = []
HOST_COMPILE_FLAGS['WARNINGS_CFLAGS'] = []
HOST_COMPILE_FLAGS['WARNINGS_CXXFLAGS'] = []
# Keep the -Wno-* flags to disable warnings that may be enabled through other means.
def filter(flags):
return [f for f in flags or [] if f.startswith('-Wno-')]
COMPILE_FLAGS['WARNINGS_CFLAGS'] = filter(CONFIG['WARNINGS_CFLAGS'])
COMPILE_FLAGS['WARNINGS_CXXFLAGS'] = filter(CONFIG['WARNINGS_CXXFLAGS'])
HOST_COMPILE_FLAGS['WARNINGS_CFLAGS'] = filter(CONFIG['WARNINGS_HOST_CFLAGS'])
HOST_COMPILE_FLAGS['WARNINGS_CXXFLAGS'] = filter(CONFIG['WARNINGS_HOST_CXXFLAGS'])
@template
def RustLibrary(name, features=None, output_category=None, is_gkrust=False):