瀏覽代碼

Fix build for Windows path edge case

Victor Oliveira 5 年之前
父節點
當前提交
2a72f491e4
沒有連結到貢獻者的電子郵件帳戶。
共有 1 個檔案被更改,包括 6 行新增12 行删除
  1. 6
    12
      buildroot/share/PlatformIO/scripts/common-features-dependencies.py

+ 6
- 12
buildroot/share/PlatformIO/scripts/common-features-dependencies.py 查看文件

@@ -127,19 +127,13 @@ def install_features_dependencies():
127 127
 def search_compiler():
128 128
 	if env['PLATFORM'] == 'win32':
129 129
 		# the first path have the compiler
130
-		compiler_path = None
131 130
 		for path in env['ENV']['PATH'].split(';'):
132
-			if re.search(r'platformio\\packages.*\\bin', path):
133
-				compiler_path = path
134
-				break
135
-		if compiler_path == None:
136
-			print("Could not find the g++ path")
137
-			return None
138
-		
139
-		print(compiler_path)
140
-		for file in os.listdir(compiler_path):
141
-			if file.endswith("g++.exe"):
142
-				return file
131
+			if not re.search(r'platformio\\packages.*\\bin', path):
132
+				continue			
133
+			#print(path)
134
+			for file in os.listdir(path):
135
+				if file.endswith("g++.exe"):
136
+					return file
143 137
 		print("Could not find the g++")
144 138
 		return None
145 139
 	else:

Loading…
取消
儲存