From e2c0150fa82a9d3e730a28236a4b83a3a408e12b Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 24 Sep 2024 18:56:11 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A8=20Use=20env[PLATFORM]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Followup to f2d585ac7f --- buildroot/share/PlatformIO/scripts/preprocessor.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/buildroot/share/PlatformIO/scripts/preprocessor.py b/buildroot/share/PlatformIO/scripts/preprocessor.py index fcfbef62fd14..d409f32f27b7 100644 --- a/buildroot/share/PlatformIO/scripts/preprocessor.py +++ b/buildroot/share/PlatformIO/scripts/preprocessor.py @@ -1,7 +1,7 @@ # # preprocessor.py # -import subprocess, os +import subprocess nocache = 1 verbose = 0 @@ -75,9 +75,7 @@ def search_compiler(env): path_separator = ':' gcc_exe = '*g++' - - sysname = os.uname().sysname - if sysname == 'Windows': + if env['PLATFORM'] == 'win32': path_separator = ';' gcc_exe += ".exe" @@ -97,7 +95,7 @@ def search_compiler(env): for ppath in envpath: for gpath in ppath.glob(gcc_exe): # Skip macOS Clang - if gpath != 'usr/bin/g++' or sysname != 'Darwin': + if gpath != 'usr/bin/g++' or env['PLATFORM'] != 'darwin': gccpath = str(gpath.resolve()) break