From 0bc43e2824b30fadc11f379f8c6ed2e4afecbefc Mon Sep 17 00:00:00 2001 From: Charlie Birks Date: Mon, 24 May 2021 15:48:50 +0100 Subject: [PATCH] Find the VS provided Arm toolchain This is enough to find all the tools if you're running in a developer command prompt. --- src/ttblit/tool/setup.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/ttblit/tool/setup.py b/src/ttblit/tool/setup.py index 3d745fa..d27f7d5 100644 --- a/src/ttblit/tool/setup.py +++ b/src/ttblit/tool/setup.py @@ -21,11 +21,19 @@ def parse_args(self, ctx, args): (['arm-none-eabi-gcc', '--version'], 'GCC Arm Toolchain', [7, 3]) ] + # adjust path to dectct the VS Arm toolchain + path = os.getenv('PATH') + vs_dir = os.getenv('VSInstallDir') + + if vs_dir: + path = ';'.join([path, vs_dir + 'Linux\\gcc_arm\\bin']) + print(path) + failed = False for command, name, version in prereqs: try: - result = subprocess.run(command, stdout=subprocess.PIPE, text=True) + result = subprocess.run(command, stdout=subprocess.PIPE, text=True, shell=True, env={'PATH': path}) version_str = ".".join([str(x) for x in version]) if version else 'any' found_version_str = re.search(r'[0-9]+\.[0-9\.]+', result.stdout).group(0)