Upgrade VSCode CPP manifest to v3

This commit is contained in:
Ivan Kravets
2018-04-20 13:56:04 +03:00
parent 6a04f52620
commit b77160d363
2 changed files with 27 additions and 6 deletions

View File

@ -53,7 +53,7 @@ def _dump_includes(env):
if unity_dir:
includes.append(unity_dir)
# remove dupicates
# remove duplicates
result = []
for item in includes:
if item not in result:
@ -101,8 +101,8 @@ def _dump_defines(env):
.replace("ATMEGA", "ATmega").replace("ATTINY", "ATtiny")))
# built-in GCC marcos
if env.GetCompilerType() == "gcc":
defines.extend(_get_gcc_defines(env))
# if env.GetCompilerType() == "gcc":
# defines.extend(_get_gcc_defines(env))
return defines

View File

@ -1,8 +1,19 @@
{
"!!! WARNING !!!": "PLEASE DO NOT MODIFY THIS FILE! USE http://docs.platformio.org/page/projectconf/section_env_build.html#build-flags",
"configurations": [
{
% import platform
% from os.path import commonprefix, dirname
%
% systype = platform.system().lower()
%
% cleaned_includes = []
% for include in includes:
% if "toolchain-" not in dirname(commonprefix([include, cc_path])):
% cleaned_includes.append(include)
% end
% end
%
% if systype == "windows":
"name": "Win32",
% elif systype == "darwin":
@ -11,7 +22,7 @@
"name": "Linux",
% end
"includePath": [
% for include in includes:
% for include in cleaned_includes:
"{{include.replace('\\\\', '/').replace('\\', '/').replace('"', '\\"')}}",
% end
""
@ -20,7 +31,7 @@
"limitSymbolsToIncludedHeaders": true,
"databaseFilename": "${workspaceRoot}/.vscode/.browse.c_cpp.db",
"path": [
% for include in includes:
% for include in cleaned_includes:
"{{include.replace('\\\\', '/').replace('\\', '/').replace('"', '\\"')}}",
% end
""
@ -32,7 +43,17 @@
% end
""
],
"intelliSenseMode": "clang-x64"
"intelliSenseMode": "clang-x64",
% import re
% STD_RE = re.compile(r"\-std=[a-z\+]+(\d+)")
%
% if STD_RE.search(cc_flags):
"cStandard": "c{{ STD_RE.search(cc_flags).group(1) }}",
% end
% if STD_RE.search(cxx_flags):
"cppStandard": "c++{{ STD_RE.search(cxx_flags).group(1) }}",
% end
"compilerPath": "{{ cc_path }}"
}
]
}