Updated compiler version detection

This fixes multiple issues/inconsistencies around  `get_compiler_version()`:
* With no shell allocated, launching the compiler could fail even
  with proper paths being set.
* The return value was described as "an array of version numbers as ints",
  but the function actually returned a `Dictionary` (or `None`).
* Not all calls were properly handling a `None` return value in case of errors.
  On Windows this broke compiling for me since #81869 with default settings.
* Some calls defined inconsistent defaults/fallbacks (`0` or `-1`).
This commit is contained in:
Mario Liebisch 2023-09-25 21:08:36 +02:00
parent fcbc50ec14
commit 426e18fd37
No known key found for this signature in database
GPG key ID: 32B56AC1F87EFBF9
4 changed files with 31 additions and 21 deletions

View file

@ -120,16 +120,9 @@ def configure(env: "Environment"):
env.Append(CCFLAGS=["-arch", "x86_64", "-mmacosx-version-min=10.13"])
env.Append(LINKFLAGS=["-arch", "x86_64", "-mmacosx-version-min=10.13"])
cc_version = get_compiler_version(env) or {
"major": None,
"minor": None,
"patch": None,
"metadata1": None,
"metadata2": None,
"date": None,
}
cc_version_major = int(cc_version["major"] or -1)
cc_version_minor = int(cc_version["minor"] or -1)
cc_version = get_compiler_version(env)
cc_version_major = cc_version["major"]
cc_version_minor = cc_version["minor"]
vanilla = is_vanilla_clang(env)
# Workaround for Xcode 15 linker bug.