From 50918110738e48de6155cef1956f084deac9860f Mon Sep 17 00:00:00 2001 From: Mike Hommey Date: Fri, 14 Jun 2019 16:14:50 +0000 Subject: [PATCH] Bug 1559301 - Straighten up C/C++ standard compiler flags. r=nalexander - `info.type in ('clang-cl', 'clang', 'gcc')` is always true since MSVC support was removed. - For some reason, we didn't enforce C++14 on GCC. Differential Revision: https://phabricator.services.mozilla.com/D34990 --HG-- extra : moz-landing-system : lando --- build/moz.configure/toolchain.configure | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/build/moz.configure/toolchain.configure b/build/moz.configure/toolchain.configure index 5cd956dafcdb..ad7387f7e54d 100755 --- a/build/moz.configure/toolchain.configure +++ b/build/moz.configure/toolchain.configure @@ -521,22 +521,22 @@ def check_compiler(compiler, language, target): # C99 compiles as e.g. C11 (as of writing, this is true of libnestegg, for # example) if info.language == 'C' and info.language_version != 199901: - if info.type in ('clang-cl', 'clang', 'gcc'): - if info.type == 'clang-cl': - flags.append('-Xclang') - flags.append('-std=gnu99') + if info.type == 'clang-cl': + flags.append('-Xclang') + flags.append('-std=gnu99') # Note: this is a strict version check because we used to always add # -std=gnu++14. cxx14_version = 201402 if info.language == 'C++': - if info.type == 'clang' and info.language_version != cxx14_version: - flags.append('-std=gnu++14') - # MSVC headers include C++14 features, but don't guard them - # with appropriate checks. - elif info.type == 'clang-cl' and info.language_version != cxx14_version: - flags.append('-Xclang') - flags.append('-std=c++14') + if info.language_version != cxx14_version: + # MSVC headers include C++14 features, but don't guard them + # with appropriate checks. + if info.type == 'clang-cl': + flags.append('-Xclang') + flags.append('-std=c++14') + else: + flags.append('-std=gnu++14') # Check compiler target # --------------------------------------------------------------------