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

Loading…
Cancel
Save