From 2380fb0ca1d3cb7fd5b688c46dbd7e63a4134968 Mon Sep 17 00:00:00 2001 From: Timothy Flynn Date: Mon, 2 Jun 2025 07:28:31 -0400 Subject: [PATCH] Meta: Default chosen compilers to the CC and CXX environment variables This regressed when porting find_compiler.sh to python. --- Meta/host_platform.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Meta/host_platform.py b/Meta/host_platform.py index 98582334d2b..933c81bd1ff 100644 --- a/Meta/host_platform.py +++ b/Meta/host_platform.py @@ -4,6 +4,7 @@ # SPDX-License-Identifier: BSD-2-Clause import enum +import os import platform import sys @@ -45,6 +46,11 @@ class Platform: sys.exit(1) def default_compiler(self) -> tuple[str, str]: + cc = os.environ.get("CC", None) + cxx = os.environ.get("CXX", None) + + if cc and cxx: + return (cc, cxx) if self.host_system == HostSystem.Windows: return ("clang-cl", "clang-cl") return ("cc", "c++")