|
@@ -156,16 +156,16 @@ def search_compiler():
|
156
|
156
|
# Find the current platform compiler by searching the $PATH
|
157
|
157
|
if env['PLATFORM'] == 'win32':
|
158
|
158
|
path_separator = ';'
|
159
|
|
- path_regex = r'platformio\\packages.*\\bin'
|
|
159
|
+ path_regex = re.escape(env['PROJECT_PACKAGES_DIR']) + r'.*\\bin'
|
160
|
160
|
gcc = "g++.exe"
|
161
|
161
|
else:
|
162
|
162
|
path_separator = ':'
|
163
|
|
- path_regex = r'platformio/packages.*/bin'
|
|
163
|
+ path_regex = re.escape(env['PROJECT_PACKAGES_DIR']) + r'.*/bin'
|
164
|
164
|
gcc = "g++"
|
165
|
165
|
|
166
|
166
|
# Search for the compiler
|
167
|
167
|
for path in env['ENV']['PATH'].split(path_separator):
|
168
|
|
- if not re.search(path_regex, path):
|
|
168
|
+ if not re.search(path_regex, path, re.IGNORECASE):
|
169
|
169
|
continue
|
170
|
170
|
for file in os.listdir(path):
|
171
|
171
|
if not file.endswith(gcc):
|