Browse Source

Fix compiler search in non-default PIO installs (#18960)

Victor Oliveira 3 years ago
parent
commit
e3c0891d2b
No account linked to committer's email address
1 changed files with 3 additions and 3 deletions
  1. 3
    3
      buildroot/share/PlatformIO/scripts/common-dependencies.py

+ 3
- 3
buildroot/share/PlatformIO/scripts/common-dependencies.py View File

@@ -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):

Loading…
Cancel
Save