Skip to content

Commit

Permalink
🔨 Use env[PLATFORM]
Browse files Browse the repository at this point in the history
Followup to f2d585a
  • Loading branch information
thinkyhead committed Sep 25, 2024
1 parent 4ef5372 commit e2c0150
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions buildroot/share/PlatformIO/scripts/preprocessor.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#
# preprocessor.py
#
import subprocess, os
import subprocess

nocache = 1
verbose = 0
Expand Down Expand Up @@ -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"

Expand All @@ -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

Expand Down

0 comments on commit e2c0150

Please sign in to comment.