From 5cb06e784f4758b4f5392f47cfff66159208419e Mon Sep 17 00:00:00 2001 From: Natalia Kulatova Date: Thu, 8 Dec 2022 20:49:22 +0000 Subject: Bug 1803595 - Updating the compiler parsing for build r=nss-reviewers,bbeurdouche The patch now introduces a new flag for ninja build - cc_is_cc. It states if the compiler we use is cc (that's indeed often stands for gcc, but for some cases the compiler check fails). Differential Revision: https://phabricator.services.mozilla.com/D163602 --- coreconf/check_cc.py | 9 +++++++-- coreconf/config.gypi | 5 +++++ 2 files changed, 12 insertions(+), 2 deletions(-) (limited to 'coreconf') diff --git a/coreconf/check_cc.py b/coreconf/check_cc.py index 6d7e38096..d0736af7d 100644 --- a/coreconf/check_cc.py +++ b/coreconf/check_cc.py @@ -10,8 +10,13 @@ def main(): else: cc = os.environ.get('CC', 'cc') try: - cc_is_arg = sys.argv[1] in subprocess.check_output( - [cc, '--version'], universal_newlines=True) + if sys.argv[1] == "cc": + cc_output = subprocess.check_output( + [cc, '--version'], universal_newlines=True) + cc_is_arg = "cc" in cc_output and not ("gcc" in cc_output) + else: + cc_is_arg = sys.argv[1] in subprocess.check_output( + [cc, '--version'], universal_newlines=True) except OSError: # We probably just don't have CC/cc. cc_is_arg = False diff --git a/coreconf/config.gypi b/coreconf/config.gypi index 6900f7953..1d731ad85 100644 --- a/coreconf/config.gypi +++ b/coreconf/config.gypi @@ -75,6 +75,11 @@ }, { 'cc_is_gcc%': '0', }], + ['"<(GENERATOR)"=="ninja"', { + 'cc_is_cc%': '