diff options
author | Natalia Kulatova <nkulatova@mozilla.com> | 2022-12-08 20:49:22 +0000 |
---|---|---|
committer | Natalia Kulatova <nkulatova@mozilla.com> | 2022-12-08 20:49:22 +0000 |
commit | 5cb06e784f4758b4f5392f47cfff66159208419e (patch) | |
tree | 7526a90ef648b7c644c08ebf4107c05991555ebd | |
parent | be7ac79609248fccb2f864200e75d78fca1f07fd (diff) | |
download | nss-hg-5cb06e784f4758b4f5392f47cfff66159208419e.tar.gz |
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
-rw-r--r-- | coreconf/check_cc.py | 9 | ||||
-rw-r--r-- | coreconf/config.gypi | 5 |
2 files changed, 12 insertions, 2 deletions
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%': '<!("<(python)" <(DEPTH)/coreconf/check_cc.py cc)', + }, { + 'cc_is_cc%': '0', + }], ], }, # Copy conditionally-set variables out one scope. |