From a838c543a5482aaf5bbb593487309d769f30a244 Mon Sep 17 00:00:00 2001 From: geniusgogo Date: Wed, 13 Jun 2018 18:19:31 +0800 Subject: [PATCH] update vsc.py fixed vscode includepath add error --- tools/vsc.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tools/vsc.py b/tools/vsc.py index 6fec8e17a0..4597c50a34 100644 --- a/tools/vsc.py +++ b/tools/vsc.py @@ -46,13 +46,21 @@ def GenerateCFiles(env): config_obj = {} config_obj['name'] = 'Win32' - config_obj['includePath'] = info['CPPPATH'] config_obj['defines'] = info['CPPDEFINES'] config_obj['intelliSenseMode'] = 'clang-x64' config_obj['compilerPath'] = cc config_obj['cStandard'] = "c99" config_obj['cppStandard'] = "c++11" + # format "a/b," to a/b. remove first quotation mark("),and remove end (",) + includePath = [] + for i in info['CPPPATH']: + if i[0] == '\"' and i[len(i) - 2:len(i)] == '\",': + includePath.append(i[1:len(i) - 2]) + else: + includePath.append(i) + config_obj['includePath'] = includePath + json_obj = {} json_obj['configurations'] = [config_obj]